/* The operations room, a prototype in the app's identity: JetBrains Mono, dark by default (the app's
   theme), light by the button. Served fonts live one folder up. */

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/jetbrains-mono-latin-ext-400-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/jetbrains-mono-latin-400-normal.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: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/jetbrains-mono-latin-ext-500-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/jetbrains-mono-latin-500-normal.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; }

:root {
  --bg: #030B1A; --panel: #08152D; --panel-2: #0E1E3D; --line: #13274D; --line-2: #1E3663;
  --ink: #E8EFFC; --ink-2: #7F93B5; --ink-3: #5A6C8E;
  --signal: #7BA4F0; --signal-ink: #030B1A; --ember: #F0945A; --ok: #7BC89A; --warn: #E8C36A;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2F4F8; --panel: #FFFFFF; --panel-2: #E9EDF4; --line: #D9DFEA; --line-2: #C3CBDA;
  --ink: #0A111E; --ink-2: #53627C; --ink-3: #7F8AA3;
  --signal: #1B52A4; --signal-ink: #FFFFFF; --ember: #D9622B; --ok: #2E7D4F; --warn: #9A6B00;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 13px/1.55 var(--mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: 0; }
h1 { font-size: 20px; } h2 { font-size: 14px; } h3 { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0; }
a { color: var(--signal); }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; left: -9999px; }
.muted { color: var(--ink-2); } .small { font-size: 12px; }
.ex { border-bottom: 1px dotted var(--ember); cursor: help; }
.type { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; color: var(--ink-2); vertical-align: 2px; }
.type.obs { border-color: var(--signal); color: var(--signal); }
.type.plan { border-style: dotted; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line-2); color: var(--ink-2); vertical-align: 1px; }
.chip.govt { border-color: var(--ok); color: var(--ok); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 6px; }

.govbar { display: flex; gap: 8px; align-items: center; padding: 7px 16px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink-2); flex-wrap: wrap; }
.govbar a { margin-left: auto; white-space: nowrap; }
.stamp { display: inline-block; padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 3px; font: 500 9.5px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); vertical-align: 2px; white-space: nowrap; }
.stamp.obs { border-color: var(--signal); color: var(--signal); }
.stamp.plan { border-style: dotted; }
.tele { font: 500 10px/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

.app { display: grid; grid-template-columns: 224px minmax(0, 1fr) 400px; min-height: calc(100vh - 37px); }

/* Sidebar */
.side { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: calc(100vh - 37px); overflow: auto; }
.brand { font-weight: 500; color: var(--ok); letter-spacing: 0.04em; font-size: 12px; text-transform: uppercase; }
.org-label, .side-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-top: 10px; }
.org { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.side-nav a.on, .side-nav a:hover { background: var(--panel-2); color: var(--ink); }
.secs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.secs button { width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.secs button.on, .secs button:hover { background: var(--panel-2); color: var(--ink); }
.secs span { color: var(--ink-3); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.round-now { font-size: 12px; }
.textbtn { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.textbtn:hover { color: var(--ink); }

/* Main */
.main { padding: 20px 24px 40px; display: grid; gap: 22px; align-content: start; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.sub { color: var(--ink-2); font-size: 12px; margin-top: 4px; }
.primary { background: var(--signal); color: var(--signal-ink); border: 0; border-radius: 6px; padding: 8px 12px; font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.kpi.dim { opacity: 0.38; }
.kpi { transition: opacity 0.3s ease; }
.kpi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-num { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.kpi-num small { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.kpi-bar { position: relative; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: visible; }
.kpi-bar .now { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 1%); background: var(--signal); border-radius: 3px; }
.kpi-bar .goal { position: absolute; top: -4px; bottom: -4px; left: calc(var(--p) * 1%); width: 2px; background: var(--ember); }
.kpi-foot { font-size: 12px; }
.kpi-row .stamp { font-size: 9px; padding: 1px 6px; }
.kpi-big-foot { font-size: 12px; color: var(--ink-2); }
.kpi-src { font-size: 11px; color: var(--ink-3); }
.spark { height: 28px; display: flex; align-items: flex-end; gap: 1px; }
.spark i { flex: 1; display: block; background: var(--signal); opacity: 0.6; min-height: 2px; }
.spark i.shrank { background: var(--ember); }

/* Board */
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.board-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search input { font: inherit; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 10px; width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 10px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--panel-2); color: var(--ink); }
.seg.mini button { padding: 3px 8px; font-size: 11px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 12px; }
th.n, td.n { white-space: nowrap; }
.plans td:first-child { min-width: 180px; }
th { font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
th.n, td.n { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--signal); }
td .name { font-weight: 500; }
td .sub2 { display: block; color: var(--ink-3); font-size: 11px; }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line-2); white-space: nowrap; }
.status.simulado { color: var(--signal); border-color: var(--signal); }
.status.execucao { color: var(--warn); border-color: var(--warn); }
.status.veredito { color: var(--ok); border-color: var(--ok); }
.eff.up { color: var(--ok); } .eff.down { color: var(--ember); }

/* Rounds */
.rounds-sec, .cycle-sec, .data-sec { display: grid; gap: 10px; }
.cyc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cyc li { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 12px; }
.cyc li strong { font-weight: 500; }
.cyc li.now { border-color: var(--signal); }
.cyc li.now .mono { color: var(--signal); }
.rounds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; }
.rounds li { height: 26px; border-radius: 4px; background: var(--panel-2); position: relative; }
.rounds li.now { background: var(--signal); }
.rounds li.year::after { content: attr(data-year); position: absolute; left: 0; top: 30px; font-size: 10px; color: var(--ink-3); }
.rounds { margin-bottom: 18px; }
.data-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.data-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.data-list strong { font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.dot.live { background: var(--signal); } .dot.soon { background: transparent; border: 1.5px solid var(--signal); }

/* Detail */
.detail { border-left: 1px solid var(--line); padding: 20px 20px 40px; display: grid; gap: 22px; align-content: start; position: sticky; top: 0; height: calc(100vh - 37px); overflow: auto; }
.detail-head { display: grid; gap: 6px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.detail h2 { font-size: 16px; }
.detail-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.d-sec { display: grid; gap: 10px; }
.d-sec[hidden] { display: none; }
details.d-sec { gap: 0; }
details.d-sec > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
details.d-sec > summary::-webkit-details-marker { display: none; }
details.d-sec > summary::after { content: "+"; color: var(--ink-3); font-size: 14px; }
details.d-sec[open] > summary::after { content: "–"; }
details.d-sec > summary h3 { margin: 0; }
details.d-sec > :not(summary) { margin-top: 10px; }
details.d-sec > ol, details.d-sec > ul, details.d-sec > table, details.d-sec > div, details.d-sec > p { margin-bottom: 8px; }
.protocol { font-size: 11px; color: var(--ink-3); }
.seg.mode { margin-top: 6px; }
.seg.mode button { flex: 1; text-align: center; }
.exec { background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 14px; }
.exec-grid { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.exec-grid div { display: grid; gap: 4px; }
.exec-grid dt { font: 500 10px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.exec-grid dd { margin: 0; font-size: 12px; line-height: 1.5; }
.exec-rec { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.terr { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-end; }
.terr i { display: block; width: var(--s, 5px); height: var(--s, 5px); background: var(--panel-2); border-radius: 1px; }
.terr i.on { background: var(--ember); }
.verdict-table { border-collapse: collapse; width: 100%; }
.verdict-table th, .verdict-table td { padding: 6px 4px; font-size: 11px; }
.verdict-table td.low { color: var(--ember); }
.d-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.reach { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.reach li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12px; align-items: center; }
.reach .bar { grid-column: 1 / -1; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.reach .bar i { display: block; height: 100%; width: calc(var(--p) * 1%); background: var(--signal); transition: width 0.5s cubic-bezier(.2,.7,.2,1); }
.reach .alf { color: var(--ink-2); }
.reach .alf b { color: var(--ink); font-weight: 500; }
.effect-bar { position: relative; height: 10px; background: var(--panel-2); border-radius: 5px; margin: 6px 0 10px; }
.effect-bar span { position: absolute; top: 0; bottom: 0; }
.effect-bar .now { left: 0; width: calc(var(--p) * 1%); background: var(--signal); border-radius: 5px; opacity: 0.55; }
.effect-bar .plan { left: 0; width: calc(var(--p) * 1%); background: var(--signal); border-radius: 5px; transition: width 0.5s cubic-bezier(.2,.7,.2,1); }
.effect-bar .goal { left: calc(var(--p) * 1%); width: 2px; top: -4px; bottom: -4px; background: var(--ember); }
.suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suggestions li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; font-size: 12px; }
.suggestions .from { font-size: 11px; color: var(--ink-3); }
.suggestions .from b { font-weight: 500; color: var(--ink-2); }
.history th, .history td { padding: 7px 8px; font-size: 11px; white-space: normal; }
.history th:first-child, .history td:first-child { padding-left: 0; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg); font: 400 12px/1.4 var(--mono); padding: 6px 8px; border-radius: 6px; max-width: 280px; }

@media (max-width: 1700px) {
}
@media (max-width: 1240px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .detail { grid-column: 1 / -1; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-foot { margin-top: 8px; }
  .kpis { grid-template-columns: 1fr; }
  .rounds { grid-template-columns: repeat(14, 1fr); }
  .main { padding: 16px; }
  .banner { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { .reach .bar i, .effect-bar .plan { transition: none; } }
