/* The admin panel's only stylesheet. The page's content policy allows no inline styles,
   so everything visual lives here. */
:root {
  --paper: #FBFAF8; --card: #FFFFFF; --ink: #1C1714; --muted: #6F6660; --line: #E6DFD8;
  --brand: #1F3A8A; --brand-ink: #FFFFFF; --soft: #EEF1F9;
  --danger: #A3261B; --danger-soft: #FBE9E7; --ok-soft: #E9EEF9; --track: #EFEAE4;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120F; --card: #1E1A16; --ink: #F1ECE6; --muted: #A69C93; --line: #352E28;
    --brand: #9DB2F5; --brand-ink: #10131F; --soft: #232A44;
    --danger: #F08A7E; --danger-soft: #3A1B17; --ok-soft: #1D2540; --track: #2B2520;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 21px; margin: 36px 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 24px 16px; position: sticky; top: 0;
  align-self: start; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand);
  margin: 0 8px 20px; font-weight: 600; }
.brand span { color: var(--muted); font-weight: 400; }
.side ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.side a { display: block; padding: 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.side a:hover { background: var(--soft); }
.side a.here { background: var(--soft); color: var(--brand); font-weight: 600; }
.who { border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: 13px; color: var(--muted);
  overflow-wrap: anywhere; }
main { padding: 32px 36px 72px; max-width: 1240px; min-width: 0; }
main.alone { max-width: 420px; margin: 0 auto; padding: 64px 24px; }
main.alone .brand { margin: 0 0 28px; }
main.alone h1 { margin-bottom: 10px; }
.head { margin-bottom: 20px; }
.head h1 { margin-bottom: 4px; }
.head.person { display: flex; gap: 16px; align-items: center; }
.crumb { margin-bottom: 14px; font-size: 14px; }

@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 14px 16px; }
  .side ul { display: flex; flex-wrap: wrap; gap: 2px; }
  .who { border-top: 0; display: flex; gap: 12px; align-items: center; padding: 10px 8px 0; }
  .who p { margin: 0; }
  main { padding: 20px 16px 56px; }
}

.note { border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.note.ok { background: var(--ok-soft); color: var(--brand); }
.note.bad { background: var(--danger-soft); color: var(--danger); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile, .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tile { padding: 14px 16px; }
.tile-label { color: var(--muted); font-size: 13px; margin: 0; }
.tile-value { font: 400 30px/1.15 Georgia, serif; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted); font-size: 13px; margin: 0; }
.card { padding: 18px 20px; margin: 16px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h3 { margin-top: 18px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.cols.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

.switch { margin: 28px 0 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.switch a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  color: var(--ink); background: var(--card); }
.switch a.here { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
@media (max-width: 460px) { .charts { grid-template-columns: 1fr; } }
.chart { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.chart figcaption { margin-bottom: 6px; }
.chart figcaption .muted { display: block; font-size: 13px; }
.chart svg { display: block; width: 100%; height: auto; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.bar-fill { fill: var(--brand); }
.bar-hit { fill: transparent; }
.bar:hover .bar-hit { fill: var(--soft); }
.chart details { margin-top: 8px; font-size: 13px; color: var(--muted); }
.chart summary { cursor: pointer; }
.chart details table { margin-top: 8px; }

table { border-collapse: collapse; width: 100%; }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.list th, .list td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list thead th { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.list tbody tr:last-child td { border-bottom: 0; }
.list.small th, .list.small td { padding: 7px 10px; font-size: 14px; }
.n { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown th { text-align: left; font-weight: 400; padding: 4px 10px 4px 0; white-space: nowrap; }
.breakdown td { padding: 4px 0 4px 10px; }
.breakdown .bar-cell { width: 55%; padding-left: 0; }
.hbar { display: block; width: 100%; height: 8px; }
.hbar-track { fill: var(--track); }
.hbar-fill { fill: var(--brand); }

.badge { display: inline-block; font-size: 12px; line-height: 1.5; padding: 0 8px; border-radius: 999px;
  background: var(--track); color: var(--ink); white-space: nowrap; }
.badge.s-active, .badge.i-usado { background: var(--ok-soft); color: var(--brand); }
.badge.s-suspended, .badge.i-revogado { background: var(--danger-soft); color: var(--danger); }

form { margin: 0; }
label { font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number],
select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; }
button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--brand); background: var(--brand);
  color: var(--brand-ink); border-radius: 999px; padding: 8px 18px; }
button.quiet { background: transparent; color: var(--brand); border-color: var(--line); padding: 5px 14px; font-weight: 500; }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--card); }
button.quiet.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.stack { display: grid; gap: 6px; max-width: 360px; margin-bottom: 10px; }
.stack.wide { max-width: 560px; }
.stack label { margin-top: 8px; }
.stack input, .stack select { width: 100%; }
.stack button { justify-self: start; margin-top: 10px; }
main.alone .stack { max-width: none; }
main.alone .stack button { justify-self: stretch; padding: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.inline input[type=number] { width: 90px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
td.actions { white-space: nowrap; }
.decide { display: grid; gap: 6px; margin-top: 12px; }
.decide input { max-width: 520px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0 0 10px; }
.plain li { padding: 4px 0; }
.plain li.line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.item { padding: 14px 0; border-top: 1px solid var(--line); }
.card .item:first-of-type { border-top: 0; padding-top: 4px; }
.card.item { padding: 18px 20px; border-top: 1px solid var(--line); }
.item.reply { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.quote { border-left: 3px solid var(--line); padding-left: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--track); display: block; flex: none; }
.thumb { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; }
.cover { max-width: 100%; max-height: 180px; border-radius: 10px; display: block; margin-bottom: 10px; }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 16px; color: var(--muted); }
