/* GomesTechnology — painel administrativo e telas de acesso */

/* ---------- Login / instalação ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-lg); animation: pop .5s var(--ease);
}
.auth-card.wide { width: min(640px, 100%); }
.auth-card h1 { font-size: 1.6rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 26px; text-align: center; }
.auth-brand .brand-mark { width: 56px; height: 56px; }
.auth-brand strong { font-family: var(--font-head); font-size: 1.3rem; }
.auth-brand small { font: 500 .75rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 46px !important; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; }
.back-link { display: inline-block; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.admin .back-link { margin: 0 0 16px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Estrutura ---------- */
.admin { background: var(--bg); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 60; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px;
  transition: transform .35s var(--ease);
}
.sidebar .brand { padding: 0 10px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: .93rem; transition: all var(--t);
}
.side-nav a:hover { background: var(--accent-soft); color: var(--text); }
.side-nav a.is-active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav span { flex: 1; }
.pill { font-style: normal; font: 700 .72rem/1 var(--font); padding: 4px 8px; border-radius: 999px; background: var(--danger); color: #fff; }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.side-foot a, .side-foot button {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; width: 100%;
  background: none; border: 0; color: var(--muted); font: 600 .9rem var(--font); cursor: pointer; text-align: left;
}
.side-foot a:hover, .side-foot button:hover { color: var(--text); background: var(--accent-soft); }

.admin-main { margin-left: 250px; min-height: 100vh; }
.admin-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 16px 32px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.admin-top h1 { font-size: 1.35rem; margin: 0; flex: 1; }
.admin-top-tools { display: flex; align-items: center; gap: 12px; }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.admin-content { padding: 28px 32px 60px; max-width: 1200px; animation: pageIn .4s var(--ease); }
.side-toggle { display: none; }
.side-scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .side-open .sidebar { transform: none; }
  .side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5); }
  .admin-main { margin-left: 0; }
  .side-toggle { display: inline-grid; }
  .admin-top { padding: 12px 16px; }
  .admin-content { padding: 20px 16px 48px; }
  .who { display: none; }
}

/* ---------- Componentes ---------- */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.box h2 { font-size: 1.05rem; margin-bottom: 14px; }
.box + .box { margin-top: 18px; }
.narrow-box { max-width: 520px; }
.box hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: transform var(--t), border-color var(--t);
}
.stat:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.stat strong { font: 700 2rem/1.15 var(--font-head); }
.stat-label { font: 500 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.stat .muted { font-size: .8rem; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.dash-grid .box + .box { margin-top: 0; }
.mini-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: var(--text); font-weight: 600; flex: 1; min-width: 0; }
.mini-list a:hover { color: var(--accent); }
.mini-list .muted { font-size: .8rem; }
.mini-list li.unread a::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-search { display: flex; gap: 10px; flex-wrap: wrap; }
.search.sm { height: 44px; max-width: 320px; }
.toolbar select, .settings select {
  height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 .9rem var(--font);
}

/* lista de itens */
.item-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color var(--t), box-shadow var(--t), opacity var(--t), transform var(--t);
}
.item-row:hover { border-color: var(--line-strong); }
.item-row.is-draft { opacity: .72; }
.item-row.dragging { opacity: .5; transform: scale(.99); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drag { color: var(--muted); cursor: grab; display: grid; place-items: center; }
.row-thumb { width: 104px; flex: none; border-radius: 10px; overflow: hidden; }
.row-thumb .cover-art .ic { width: 24px; height: 24px; }
.row-thumb .cover-art span { display: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; color: var(--text); font-weight: 700; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title:hover { color: var(--accent); }
.row-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; }
.row-actions { display: flex; gap: 6px; flex: none; }
.row-actions form { margin: 0; }
.icon-btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.icon-btn.is-star { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.icon-btn.is-star svg { fill: currentColor; }
@media (max-width: 720px) {
  .item-row { flex-wrap: wrap; }
  .row-thumb { width: 72px; }
  .row-main { flex-basis: calc(100% - 120px); }
  .row-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; }
  .drag { display: none; }
}

/* editor */
.editor { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.editor .box { display: flex; flex-direction: column; gap: 16px; }
.editor .box + .box { margin-top: 0; }
.editor-main, .editor-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sticky { position: sticky; top: 88px; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } .editor-side { order: -1; } .sticky { position: static; } }
.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.type-opt { cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt > span {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text-2); transition: all var(--t);
}
.type-opt b { color: var(--text); font-size: .92rem; }
.type-opt small { font-weight: 500; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.type-opt:hover > span { border-color: var(--accent); }
.type-opt.is-on > span, .type-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-group { display: flex; flex-direction: column; gap: 10px; }
.field-group + .field-group { padding-top: 16px; border-top: 1px dashed var(--line); }
.body-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.body-head label { font-weight: 600; font-size: .88rem; color: var(--text-2); }
textarea.code, .form textarea.code { font-family: var(--font-mono); font-size: .86rem; line-height: 1.55; tab-size: 2; background: #050a12; color: #d6e3f3; }
[data-theme="light"] textarea.code { background: #0e1828; color: #d6e3f3; }
.yt-preview { display: flex; align-items: center; gap: 14px; }
.yt-preview img { width: 180px; border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; }
.ok-tag { color: var(--ok); font-weight: 600; font-size: .88rem; }
.bad-tag { color: var(--danger); font-weight: 600; font-size: .88rem; }
.pdf-preview iframe, .html-preview iframe { width: 100%; height: 520px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }
.slug-wrap { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: .8rem; }
.slug-wrap input { font-family: var(--font-mono) !important; font-size: .85rem !important; }
.save-row { display: flex; flex-direction: column; gap: 8px; }

/* chave liga/desliga */
.switch { flex-direction: row !important; align-items: center; gap: 12px !important; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background-color var(--t); flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform var(--t), background-color var(--t); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* mensagens */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.msg.unread { border-left: 3px solid var(--accent); }
.msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .92rem; }
.msg header a { margin-left: 6px; font-size: .88rem; }
.msg h3 { margin: 10px 0 4px; font-size: 1rem; }
.msg-body { color: var(--text-2); margin: 10px 0 14px; white-space: normal; overflow-wrap: anywhere; }
.msg footer { display: flex; gap: 8px; flex-wrap: wrap; }
.msg footer form { margin: 0; }

.settings .box { display: flex; flex-direction: column; gap: 16px; }
.save-bar { position: sticky; bottom: 16px; margin-top: 18px; display: flex; justify-content: flex-end; }
.save-bar .btn { box-shadow: var(--shadow-lg); }
