/* Central da Diretoria v2 — interface administrativa (tema claro/escuro, identidade discreta) */
/* Inter hospedada localmente (SIL OFL 1.1, /admin/fonts/OFL-Inter.txt); sem Google Fonts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/admin/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/admin/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root, [data-theme="light"] {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f2f0eb; --surface-3: #ebe8e1;
  --border: #e5e2da; --border-strong: #d2cdc2; --text: #18181b; --text-2: #57534b; --text-3: #85807a;
  --brand: #c99a2e; --accent: #8f6510; --accent-bg: #f8edd4; --primary: #18181b; --on-primary: #ffffff;
  --ok: #1b7a46; --ok-bg: #e3f3ea; --warn: #8a5b00; --warn-bg: #fff2d6; --bad: #b42318; --bad-bg: #fde8e6; --info: #1f4e8c; --info-bg: #e7eef9;
  --focus: #d4a63c; --shadow: 0 1px 2px rgba(24, 24, 27, .06), 0 8px 24px -12px rgba(24, 24, 27, .18); --overlay: rgba(18, 18, 20, .45);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0e10; --surface: #161619; --surface-2: #1c1c20; --surface-3: #24242a;
  --border: #2a2a31; --border-strong: #3a3a43; --text: #f2efe8; --text-2: #b9b4aa; --text-3: #8d887e;
  --brand: #d4a63c; --accent: #f0c75a; --accent-bg: rgba(212, 166, 60, .14); --primary: #f2efe8; --on-primary: #121214;
  --ok: #7fd1a1; --ok-bg: rgba(127, 209, 161, .12); --warn: #f3c46b; --warn-bg: rgba(243, 196, 107, .12); --bad: #ff8a7a; --bad-bg: rgba(255, 138, 122, .12); --info: #8db8f2; --info-bg: rgba(141, 184, 242, .12);
  --focus: #f0c75a; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -14px rgba(0, 0, 0, .7); --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100dvh; color: var(--text-3); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 10px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; }
.brand img { width: 30px; height: auto; }
.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand span { font-size: 11.5px; color: var(--text-3); }
.nav-group { display: grid; gap: 1px; }
.nav-group__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 0 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--text-2); font-weight: 500; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-bg); color: var(--text); font-weight: 600; }
.nav-item[aria-current="page"] svg.i { color: var(--accent); }
.nav-item .count { margin-left: auto; }
.side__foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top__brand { display: none; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-3); cursor: text; }
.search input { flex: 1; border: 0; background: none; outline: 0; min-width: 0; color: var(--text); }
.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--text-3); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.env { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 12px; border: 0; cursor: pointer; }
.page { padding: 22px clamp(14px, 3vw, 32px) 90px; max-width: 1280px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 680px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 0 12px; }
  .top__brand { display: flex; }
  .top__brand img { width: 26px; }
  .search .kbd { display: none; }
  .page { padding: 16px 14px 96px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; color: var(--text-3); font-size: 11px; padding: 4px 0; cursor: pointer; }
  .bottom-nav button[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .env { display: none; }
}

/* ---------- Botões e controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn--primary:hover { background: var(--primary); opacity: .9; }
.btn--brand { background: var(--brand); color: #1a1405; border-color: var(--brand); }
.btn--danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn--ghost { background: none; border-color: transparent; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--icon { width: 36px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--plain::before { display: none; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--brand { background: var(--accent-bg); color: var(--accent); }
.count { font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--bad); font-weight: 600; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.field textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 12px; margin-bottom: 14px; }
.section h3 { margin: 0; font-size: 14px; }
.section h3 + p { margin: -6px 0 0; color: var(--text-3); font-size: 13px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.switch strong { display: block; font-size: 13.5px; }
.switch span { font-size: 12.5px; color: var(--text-2); }
.toggle { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle:checked { background: var(--ok); }
.toggle:checked::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; min-height: 38px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.chips span { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 9px; border-radius: 6px; background: var(--surface-3); font-size: 13px; }
.chips span button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 15px; padding: 0 5px; line-height: 1; }
.chips input { flex: 1; min-width: 120px; border: 0; outline: 0; background: none; height: 26px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-3); gap: 2px; }
.segmented button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; text-align: left; }
button.kpi { cursor: pointer; font: inherit; color: inherit; }
button.kpi:hover { border-color: var(--border-strong); }
.kpi__label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__note { font-size: 12px; color: var(--text-3); }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card__head h2 { margin: 0; font-size: 14px; }
.card__body { padding: 14px 16px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.feed small { color: var(--text-3); }
.quick { display: grid; gap: 8px; }
.quick .btn { justify-content: flex-start; white-space: normal; height: auto; min-height: 36px; padding: 8px 12px; text-align: left; }

/* ---------- Tabela de dados ---------- */
.dt { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dt__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.dt__bar .field { flex: 1 1 150px; }
.dt__bar .field--search { flex: 2 1 220px; }
.dt__bar .field > label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.dt__bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--accent-bg); border-bottom: 1px solid var(--border); }
.dt__bulk strong { margin-right: auto; }
.dt__bulk select { height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 8px; max-width: 260px; }
.dt__scroll { overflow-x: auto; }
.dt table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dt th, .dt td { padding: 0 12px; height: 46px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dt th { height: 38px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); position: sticky; top: 0; }
.dt th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.dt th[aria-sort] button { color: var(--text); }
.dt td.num, .dt th.num { text-align: right; }
.dt td.wrap { white-space: normal; min-width: 200px; }
.dt tbody tr { cursor: pointer; }
.dt tbody tr:hover { background: var(--surface-2); }
.dt tbody tr.selected { background: var(--accent-bg); }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.dt .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dt .cell-main strong { font-weight: 600; }
.dt .muted { color: var(--text-3); }
.dt__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; color: var(--text-2); font-size: 13px; }
.dt__empty { padding: 40px 20px; text-align: center; color: var(--text-2); }
.dt__empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.thumb { width: 30px; height: 40px; border-radius: 6px; background: var(--surface-3) center / cover no-repeat; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-3); }
.thumb--round { width: 30px; height: 30px; border-radius: 50%; background-size: contain; }
/* Unificação de adversários: cada cadastro é uma opção do "principal" */
.merge-opt { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.merge-opt.is-on { border-color: var(--accent); background: var(--accent-bg); }
.merge-opt input { margin: 0; width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 520px) { .merge-opt { grid-template-columns: auto auto 1fr; } .merge-opt .pill { grid-column: 2 / -1; justify-self: start; } }
.score { font-weight: 700; }
.res { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.res--V { background: var(--ok-bg); color: var(--ok); }
.res--E { background: var(--surface-3); color: var(--text-2); }
.res--D { background: var(--bad-bg); color: var(--bad); }
/* Cartões no lugar da tabela em telas pequenas */
@media (max-width: 700px) {
  .dt table.responsive thead { display: none; }
  .dt table.responsive tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .dt table.responsive td { height: auto; padding: 0; border: 0; white-space: normal; }
  .dt table.responsive td.hide-sm { display: none; }
  .dt table.responsive td.primary { grid-column: 2; }
  .dt table.responsive td.trail { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .dt table.responsive td.sub { grid-column: 2; color: var(--text-3); font-size: 12.5px; }
  .dt table.responsive td.sel { grid-row: 1 / span 2; align-self: center; }
}

/* ---------- Painel lateral (edição) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: var(--overlay); }
.sheet__panel { width: min(640px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; background: var(--surface); }
.sheet__title h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.sheet__title p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); word-break: break-all; }
.tabs { display: flex; gap: 2px; padding: 12px 18px 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.sheet__body { flex: 1; overflow: auto; padding: 16px 18px; }
.sheet__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; background: var(--surface); border-top: 1px solid var(--border); }
@media (max-width: 640px) { .sheet__panel { width: 100%; } }
@media (prefers-reduced-motion: no-preference) { .sheet__panel { animation: slidein .2s ease-out; } @keyframes slidein { from { transform: translateX(24px); } } } /* só movimento: nunca começa transparente */

/* ---------- Diálogo de confirmação ---------- */
.dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.dialog__box { width: min(540px, 100%); max-height: 88dvh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.dialog__box h2 { margin: 0 0 6px; font-size: 17px; }
.dialog__box p { margin: 0 0 12px; color: var(--text-2); }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.diff th, .diff td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.diff th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.diff .old { color: var(--bad); text-decoration: line-through; }
.diff .new { color: var(--ok); font-weight: 600; }
.dialog__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 70; display: grid; gap: 8px; width: min(400px, calc(100% - 32px)); }
@media (max-width: 900px) { .toasts { bottom: 84px; } }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); font-size: 13.5px; }
.toast--bad { background: var(--bad); color: #fff; }
.toast strong { display: block; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; opacity: .8; }
.notice { padding: 11px 13px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-size: 13px; }
.notice--warn { background: var(--warn-bg); color: var(--warn); }
.notice--bad { background: var(--bad-bg); color: var(--bad); }
.notice--ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Mídia, uploads, prévias ---------- */
.upload { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); }
.upload.drag { border-color: var(--brand); background: var(--accent-bg); }
.upload__img { width: 96px; aspect-ratio: 3 / 4; border-radius: 8px; background: var(--surface-3) center / cover no-repeat; display: grid; place-items: center; font-size: 11px; color: var(--text-3); text-align: center; }
.upload__img--sq { aspect-ratio: 1; background-size: contain; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; }
.media__img { aspect-ratio: 4 / 5; background: var(--surface-3) center / cover no-repeat; }
.media__img--sq { aspect-ratio: 1; background-size: contain; background-color: var(--surface-2); }
.media__body { padding: 8px 10px; display: grid; gap: 4px; font-size: 12.5px; }
.media__body strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: #111113; color: #f2efe8; border: 1px solid #2a2a31; }
.preview-card__img { aspect-ratio: 560 / 765; border-radius: 10px; background: #1c1c20 center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(212,166,60,.35); display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #8a6a24; }
.preview-card strong { display: block; font-size: 18px; text-transform: uppercase; letter-spacing: .02em; }
.preview-card span { color: #b9b4aa; font-size: 13px; }
.check-list { display: grid; gap: 10px; }
.check-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-row dt { color: var(--text-2); font-weight: 600; }
.check-row dd { margin: 0; }
@media (max-width: 600px) { .check-row { grid-template-columns: 1fr; gap: 2px; } }
.stat-grid { width: 100%; border-collapse: collapse; }
.stat-grid th, .stat-grid td { padding: 6px; border-bottom: 1px solid var(--border); text-align: left; }
.stat-grid th { font-size: 12px; color: var(--text-2); }
.stat-grid input:not([type=checkbox]) { width: 64px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); }
.stat-grid select { height: 32px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); max-width: 130px; }
.stat-grid .inativo td:first-child { color: var(--text-3); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 0%, var(--accent-bg), transparent 60%), var(--bg); }
.login__box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; text-align: center; }
.login__box img { width: 72px; margin: 0 auto; }
.login__box h1 { margin: 0; font-size: 20px; }
.login__box p { margin: 0; color: var(--text-2); }
.login__form { display: grid; gap: 14px; text-align: left; }
.login__form input:not([type=checkbox]) { height: 42px; font-size: 15px; }
.login__submit { height: 44px; font-size: 15px; margin-top: 2px; }
.login__help { font-size: 12.5px; color: var(--text-3) !important; }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 84px !important; }
.pw__toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pw__toggle:hover { background: var(--surface-3); color: var(--text); }
.pw__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.temp-pass__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.temp-pass { flex: 1 1 220px; font: 600 18px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; padding: 12px 14px; border-radius: 10px; background: var(--surface-3); border: 1px dashed var(--border-strong); color: var(--text); user-select: all; word-break: break-all; }
.menu { position: absolute; right: 16px; top: 52px; z-index: 40; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.menu__head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu__head strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.menu__head span { color: var(--text-3); font-size: 12px; }
.menu .nav-item { font-weight: 500; }
.palette { position: fixed; inset: 0; z-index: 65; background: var(--overlay); display: grid; justify-items: center; align-items: start; padding: 10vh 16px; }
.palette__box { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.palette__box input { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--border); background: none; outline: 0; font-size: 15px; }
.palette__list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette__list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.palette__list button:hover, .palette__list button[aria-selected="true"] { background: var(--surface-2); }
.palette__list small { margin-left: auto; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Imagens com prévia (foto do jogador, arte, escudo) — 05/12/2026 ===== */
.sheet__panel--wide { width: min(1120px, 100%); }
.imgslot { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: start; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); }
.imgslot.drag { border-color: var(--brand); background: var(--accent-bg); }
.imgslot__frame { width: 132px; border-radius: 10px; background: #1c1c20 center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(212,166,60,.35); display: grid; place-items: center; overflow: hidden; }
.imgslot__frame--carta { aspect-ratio: 560 / 765; }                 /* mesmo enquadramento da carta no site (cover, sem esticar) */
.imgslot__frame--arte { aspect-ratio: 860 / 1018; background-size: contain; }
.imgslot__frame--escudo { aspect-ratio: 1; background-size: contain; background-color: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.imgslot__frame.is-new { box-shadow: inset 0 0 0 2px var(--brand); }
.imgslot__fallback { font: 700 34px/1 Oswald, Inter, system-ui, sans-serif; color: #8a6a24; }
.imgslot__info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.imgslot__hint { font-size: 12.5px; color: var(--text-3); }
.imgslot__status { margin: 0; font-size: 12.5px; color: var(--text-2); }
.imgslot__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .imgslot { grid-template-columns: 96px 1fr; } .imgslot__frame { width: 96px; } }

/* ===== Estatísticas individuais (tabela editável) ===== */
.sgrid-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.sgrid-wrap { min-width: 0; } /* item de grid: sem isso a tabela larga alarga o formulário inteiro */
.sgrid-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sgrid { width: 100%; border-collapse: collapse; }
.sgrid th, .sgrid td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.sgrid th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.sgrid th.num { text-align: center; }
.sgrid__who strong { display: block; font-size: 13.5px; }
.sgrid__who small { color: var(--text-3); font-size: 11.5px; margin-right: 6px; }
.sgrid td:first-child, .sgrid th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.sgrid th:first-child { background: var(--surface-2); z-index: 2; }
.sgrid select { height: 32px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); max-width: 140px; }
.sgrid__num { width: 58px; height: 32px; padding: 0 6px; text-align: center; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.sgrid__num:placeholder-shown { border-style: dashed; background: var(--surface-2); font-weight: 400; }   /* vazio = não informado */
.sgrid__num:disabled { opacity: .35; border-style: dotted; }
.sgrid__num:focus, .sgrid select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.sgrid th.sgrid__def { color: var(--info); } .sgrid th.sgrid__gl { color: var(--accent); }
.sgrid tr.nao-jogou td { background: var(--surface-2); }
.sgrid__x { width: 1%; }
.sgrid-legend { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }
@media (max-width: 700px) { /* celular: cada jogador vira um cartão com os campos rotulados */
  .sgrid-scroll { border: 0; background: none; overflow: visible; }
  .sgrid thead { display: none; }
  .sgrid, .sgrid tbody { display: block; }
  .sgrid tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .sgrid td { display: grid; gap: 3px; padding: 0; border: 0; white-space: normal; position: static !important; background: none !important; }
  .sgrid td::before { content: attr(data-label); font-size: 11px; color: var(--text-3); }
  .sgrid td.sgrid__who, .sgrid td.sgrid__x { grid-column: 1 / -1; }
  .sgrid td.sgrid__who::before, .sgrid td.sgrid__x::before { content: none; }
  .sgrid tr { position: relative; }
  .sgrid td.sgrid__x { position: absolute !important; top: 6px; right: 6px; } /* "tirar da partida" no canto, sem cobrir o nome */
  .sgrid td.sgrid__who { padding-right: 40px; }
  .sgrid td.sgrid__fora { display: none; } /* colunas de goleiro só no cartão de quem jogou de Goleiro */
  .sgrid__num, .sgrid select { width: 100%; max-width: none; height: 40px; font-size: 16px; }
}

/* ===== Seleção de jogadores e adversário na partida ===== */
.ppick { display: grid; gap: 10px; }
.ppick__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ppick__chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }
.ppick__chip b { font-variant-numeric: tabular-nums; color: var(--text-3); }
.ppick__chip small { color: var(--text-3); font-weight: 400; }
.ppick__chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--brand); color: var(--accent); }
.ppick__chip[aria-pressed="true"] b { color: var(--accent); }
.ppick__chip:disabled { cursor: default; opacity: .8; }
.ppick__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ppick__inat { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.opick { display: grid; gap: 8px; }
.opick__info:empty { display: none; }
.opick__found, .opick__new { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.opick__sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
