/* GEO.mmetry — papel de desenho técnico, tinta índigo, violeta como traço principal */
:root {
  --paper: #F1F0F8;
  --sheet: #FFFFFF;
  --ink: #15132A;
  --ink-2: #4B4868;
  --ink-3: #6F6C8A;
  --violet: #451AF0;
  --lilac: #9A85F8;
  --wash: #E4DFFD;
  --rule: #D9D6EA;
  --mark: #FFC93C;
  --ok: #17794F;
  --mid: #8A5A00;
  --bad: #B3261E;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --grid: linear-gradient(rgba(69, 26, 240, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(69, 26, 240, .055) 1px, transparent 1px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--violet); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; background: var(--wash); padding: 1px 6px; border-radius: 4px; }

/* marca: o ponto de GEO.mmetry é o ponto de origem da construção */
.wordmark { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: inherit; text-decoration: none; display: inline-flex; align-items: baseline; }
.wordmark i { width: .34em; height: .34em; border-radius: 50%; background: var(--mark); margin: 0 .06em; display: inline-block; }

/* ================= LOGIN ================= */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.stage { background: var(--ink); background-image: linear-gradient(rgba(154, 133, 248, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(154, 133, 248, .09) 1px, transparent 1px); background-size: 40px 40px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; position: relative; overflow: hidden; }
#construction { width: min(100%, 78vh); height: auto; max-height: 78vh; display: block; }
.c-guides line { stroke: rgba(154, 133, 248, .45); stroke-width: 1; }
.c-circle { fill: none; stroke: var(--lilac); stroke-width: 1.5; stroke-dasharray: 3 7; }
.c-spokes line { stroke: var(--lilac); stroke-width: 1; }
.c-poly { fill: rgba(69, 26, 240, .42); stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; }
.c-dots circle { fill: #fff; }
.c-origin { fill: var(--mark); }
.stage-caption { font-family: var(--display); font-size: 17px; color: #CFC8F5; margin-top: 8px; text-align: center; }
.stage-caption span { color: var(--mark); font-weight: 700; font-size: 1.5em; margin-right: .15em; font-variant-numeric: tabular-nums; }

.auth { background: var(--sheet); display: flex; flex-direction: column; justify-content: space-between; padding: 40px clamp(28px, 6vw, 72px); gap: 32px; }
.auth form { max-width: 400px; width: 100%; }
.auth h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3vw, 38px); line-height: 1.08; letter-spacing: -.025em; }
.lede { color: var(--ink-2); margin: 14px 0 28px; }
.auth label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
.auth input { width: 100%; height: 48px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--sheet); padding: 0 14px; font-size: 16px; }
.auth input:focus { outline: 3px solid var(--mark); outline-offset: 0; border-color: var(--violet); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 88px; }
.pass-wrap button { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--violet); font-weight: 600; font-size: 14px; cursor: pointer; }
.primary { width: 100%; height: 52px; margin-top: 24px; border: 0; background: var(--violet); color: #fff; font-family: var(--display); font-weight: 600; font-size: 17px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
.primary:hover { background: #3613C9; }
.error { color: var(--bad); font-weight: 500; font-size: 14px; margin-top: 14px; }
.demo-note { margin-top: 24px; padding: 14px 16px; background: #FFF6D9; border-left: 4px solid var(--mark); font-size: 14px; color: var(--ink); }
.demo-note button { border: 0; background: none; color: var(--violet); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; margin-left: 4px; }
.credit { color: var(--ink-3); font-size: 13px; }

/* ================= PORTAL ================= */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 28px 20px; display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #C9C4E6; text-decoration: none; padding: 9px 12px; font-weight: 500; border-left: 3px solid transparent; }
.side nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side nav a[aria-current] { color: #fff; border-left-color: var(--mark); background: rgba(154, 133, 248, .18); }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #C9C4E6; gap: 8px; }
.side-foot button { background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff; padding: 6px 12px; cursor: pointer; }
.side-foot button:hover { background: rgba(255, 255, 255, .1); }

.main { background-image: var(--grid); background-size: 32px 32px; padding: 0 clamp(18px, 3vw, 44px) 40px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 0; border-bottom: 1.5px solid var(--ink); }
.top-project { font-family: var(--display); font-size: 18px; }
.top-meta { color: var(--ink-2); font-size: 13.5px; }
.demo-flag { background: var(--mark); padding: 4px 10px; font-size: 13px; font-weight: 600; }
#content { outline: none; }
.foot { color: var(--ink-3); font-size: 13px; margin-top: 32px; }

.hero { padding: 36px 0 28px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.1vw, 42px); line-height: 1.1; letter-spacing: -.025em; max-width: 26em; }
.hero.small h1 { font-size: clamp(22px, 2.3vw, 30px); max-width: 30em; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1.5px solid var(--ink); background: var(--sheet); margin-bottom: 20px; }
.kpis > div { padding: 16px 18px; border-right: 1px solid var(--rule); }
.kpis > div:last-child { border-right: 0; }
.kpis > div:first-child { background: var(--violet); color: #fff; }
.kpis > div:first-child p { color: #DAD3FF; }
.kpis dt { font-size: 13.5px; font-weight: 600; }
.kpis dd { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpis p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.35; }

.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-top: 1.5px solid var(--ink); padding: 22px 24px; margin-bottom: 20px; min-width: 0; }
.grid .panel { margin-bottom: 0; }
.panel h2 { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -.01em; }
.sub { color: var(--ink-2); font-size: 14px; margin: 4px 0 16px; }
.note { color: var(--ink-2); font-size: 13.5px; margin-top: 16px; max-width: 78ch; }
.note.flush { margin-top: 0; }

.insights { list-style: none; margin-top: 12px; }
.insights li { padding: 12px 0 12px 22px; border-top: 1px solid var(--rule); position: relative; font-size: 14.5px; color: var(--ink-2); }
.insights li::before { content: ""; position: absolute; left: 0; top: 18px; width: 0; height: 0; border-left: 9px solid var(--violet); border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }
.insights strong { color: var(--ink); display: block; }

/* gráficos */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .g { stroke: var(--rule); stroke-width: 1; }
.chart .ax { font: 12px var(--body); fill: var(--ink-3); }
.chart .area { fill: var(--wash); opacity: .7; }
.chart .line { fill: none; stroke: var(--violet); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt { fill: var(--sheet); stroke: var(--violet); stroke-width: 2; }
.chart .pt:hover { fill: var(--mark); }
.chart .avg { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .avg-t { fill: var(--ink); font-weight: 600; }
.chart .wl { fill: none; stroke-width: 1.6; opacity: .75; }
.chart .wl.own { stroke: var(--violet); stroke-width: 3.5; opacity: 1; }
.chart .wl-t { font: 12px var(--body); fill: var(--ink-2); }
.chart .wl-t.own { fill: var(--violet); font-weight: 600; }
.radar .r-ring { fill: none; stroke: var(--rule); }
.radar .r-axis { stroke: var(--rule); }
.radar .r-lab { font: 600 14px var(--body); fill: var(--ink); }
.radar .r-sub { font-weight: 400; fill: var(--ink-3); font-size: 12.5px; }
.radar .r-best { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.radar .r-mine { fill: rgba(69, 26, 240, .28); stroke: var(--violet); stroke-width: 2.5; stroke-linejoin: round; }
.radar .r-dot { fill: var(--violet); }
.legend { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.legend .k { width: 22px; height: 0; display: inline-block; border-top: 3px solid var(--violet); }
.legend .k.best { border-top: 2px dashed var(--ink); margin-left: 12px; }

.bars { list-style: none; display: grid; gap: 7px; }
.bars li { display: grid; grid-template-columns: 118px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 14px; }
.bars.gap li { grid-template-columns: 190px minmax(0, 1fr) 54px; }
.b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.b-track { height: 16px; background: var(--paper); display: block; }
.b-fill { height: 100%; background: #B9B5CF; display: block; }
.b-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bars .own .b-name, .bars .own .b-val { color: var(--violet); font-weight: 600; }
.bars .own .b-fill { background: var(--violet); }
.bars.gap .b-fill { background: var(--ink); }

.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.mini dt { font-size: 12.5px; color: var(--ink-3); }
.mini dd { font-family: var(--display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }

/* tabelas */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
thead th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
tbody th, tbody td { padding: 9px 10px; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; vertical-align: top; }
tbody th { font-weight: 500; }
.n { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.own th, tr.own td { background: var(--wash); color: var(--violet); font-weight: 600; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; transform: rotate(45deg); }
td small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.ok { color: var(--ok); } .mid { color: var(--mid); } .bad { color: var(--bad); }
thead button { background: none; border: 0; font-weight: 600; cursor: pointer; color: var(--ink-2); padding: 0; }
thead button::after { content: " ↕"; color: var(--rule); }
thead button.on { color: var(--violet); }
thead button.on::after { content: " ↓"; color: var(--violet); }
thead button.on.asc::after { content: " ↑"; }
.prompts .p-text { min-width: 280px; max-width: 460px; }
.prompts td.vis { min-width: 130px; }
.vbar { display: block; height: 5px; background: var(--paper); margin-bottom: 4px; }
.vbar span { display: block; height: 100%; background: var(--violet); }
.empty { text-align: center; color: var(--ink-2); padding: 28px 10px; }
.filters { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.filters input, .filters select { height: 40px; border: 1.5px solid var(--ink); background: var(--sheet); padding: 0 12px; min-width: 240px; font-weight: 400; font-size: 15px; border-radius: 0; }

.urls { list-style: none; }
.urls li { padding: 11px 0; border-top: 1px solid var(--rule); display: grid; gap: 2px; }
.urls a { font-weight: 600; color: var(--ink); text-decoration-color: var(--lilac); }
.urls a:hover { color: var(--violet); }
.urls span { font-size: 13px; color: var(--ink-2); }
.urls em { font-style: normal; font-size: 12.5px; font-weight: 600; }
.urls em.in { color: var(--ok); } .urls em.out { color: var(--bad); }

.actions { list-style: none; }
.actions li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); align-items: start; }
.actions li:first-child { border-top: 0; padding-top: 0; }
.actions strong { display: block; font-weight: 600; }
.actions div span { font-size: 13.5px; color: var(--ink-2); }
.st { font-size: 12.5px; font-weight: 600; padding: 3px 8px; text-align: center; border: 1.5px solid currentColor; }
.st.pend { color: var(--violet); } .st.exp { color: var(--ink-3); } .st.done { color: var(--ok); }

/* ================= telas menores ================= */
@media (max-width: 1100px) {
  .grid.three { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis > div { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .stage { padding: 20px; }
  #construction { max-height: 38vh; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; }
  .side nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; }
  .side nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .side nav a[aria-current] { border-bottom-color: var(--mark); }
  .side-foot { margin: 0 0 0 auto; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .bars li, .bars.gap li { grid-template-columns: 104px minmax(0, 1fr) 50px; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .filters label { width: 100%; }
  .actions li { grid-template-columns: 1fr; gap: 6px; }
  .st { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
