/* =========================================================
   RASTRO · plataforma (mesma identidade do site)
   ========================================================= */
/* Fontes Geist e Geist Mono (licença SIL OFL 1.1), servidas pelo próprio site */
@font-face { font-family: "Geist"; font-weight: 300; font-style: normal; font-display: swap; src: url("../assets/fonts/Geist-Light.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/Geist-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/Geist-Medium.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/Geist-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/GeistMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/GeistMono-Medium.woff2") format("woff2"); }

:root {
  --ink: #1c1b19;
  --ink-2: #2a2926;
  --paper: #ece6da;
  --card: #f7f3eb;
  --accent: #d6a0c8;
  --accent-2: #c487b5;
  --accent-soft: #f1e2ec;
  --moss: #26321f;
  --line: rgba(28, 27, 25, .14);
  --line-2: rgba(28, 27, 25, .08);
  --muted: #5d5a53;
  --ok: #2f5a36;     --ok-bg: #dbe8d6;
  --warn: #7a4b00;   --warn-bg: #f6e3b8;
  --bad: #8f1f3f;    --bad-bg: #f5d9df;
  --f-sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.side :focus-visible { outline-color: var(--accent); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--ink); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.mono { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }

.app { display: flex; height: 100vh; height: 100dvh; }

/* ---------- barra lateral ---------- */
.side { width: 240px; flex-shrink: 0; background: var(--ink); color: var(--paper); padding: 22px 14px; display: flex; flex-direction: column; gap: 26px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; text-decoration: none; color: var(--accent); font-weight: 600; letter-spacing: .18em; font-size: 17px; }
.brand svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; text-align: left; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper); transition: background .2s; }
.side-nav button:hover { background: rgba(236, 230, 218, .1); }
.side-nav button[aria-current="page"] { background: var(--accent); color: var(--ink); }
.side-nav .count { font-size: 11px; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(236, 230, 218, .14); }
.side-nav button[aria-current="page"] .count { background: rgba(28, 27, 25, .14); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-link { background: none; border: 0; padding: 6px 10px; text-align: left; cursor: pointer; font-size: 13px; color: rgba(236, 230, 218, .7); text-decoration: underline; text-underline-offset: 3px; }
.side-link:hover { color: var(--accent); }
.back { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid rgba(236, 230, 218, .35); border-radius: 999px; text-decoration: none; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.back:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.note { padding: 12px; border-radius: 10px; background: rgba(236, 230, 218, .08); font-size: 12.5px; line-height: 1.45; color: rgba(236, 230, 218, .75); }

/* ---------- área principal ---------- */
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { height: 64px; flex-shrink: 0; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.lab { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lab strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: #6d3a60; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 10px; }
.who { text-align: right; }
.who div:first-child { font-size: 14px; font-weight: 500; }
.who div:last-child { font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.menu-btn { display: none; }
main { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: .95; font-weight: 500; letter-spacing: -.03em; text-transform: uppercase; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 60ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; transition: background .2s, color .2s; }
.btn:hover { background: var(--moss); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn--accent:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--card); border-color: var(--ink); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 11px; }

.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.card { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.card .lbl { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.big { font-size: 56px; line-height: .95; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.card .sm { font-size: 13px; color: var(--muted); }
button.card { text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .2s, transform .2s; }
button.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card .link { font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- painel ---------- */
.kpis { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 14px; }
.kpi-hero { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpi-hero .lbl { color: rgba(236, 230, 218, .7); }
.kpi-hero .big { color: var(--accent); font-size: 80px; }
.kpi-hero .sm { color: rgba(236, 230, 218, .7); }
.bar { height: 8px; border-radius: 999px; background: rgba(236, 230, 218, .16); overflow: hidden; margin: 6px 0 4px; }
.bar div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.textlink { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.secrow { display: flex; flex-direction: column; gap: 6px; }
.secrow .topline { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.track div { height: 100%; border-radius: 999px; transition: width .5s; }
.foot-note { font-size: 12.5px; color: var(--muted); }

.due { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.due:last-child { border-bottom: 0; }
.due .date { width: 48px; flex-shrink: 0; text-align: center; }
.due .date b { display: block; font-size: 28px; line-height: .9; font-weight: 500; letter-spacing: -.03em; }
.due .date span { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; color: var(--muted); }
.due .txt { flex: 1; min-width: 0; }
.due .txt div:first-child { font-weight: 500; }
.due .txt div:last-child { font-size: 13px; color: var(--muted); }

.tag { flex-shrink: 0; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.t-ok { background: var(--ok-bg); color: var(--ok); }
.t-warn { background: var(--warn-bg); color: var(--warn); }
.t-bad { background: var(--bad-bg); color: var(--bad); }
.t-neutral { background: var(--line-2); color: var(--muted); }
.t-accent { background: var(--accent-soft); color: #6d3a60; }

/* ---------- diagnóstico ---------- */
.diag { display: flex; gap: 18px; align-items: flex-start; }
.tabs { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.tabs button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 62px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: left; }
.tabs button:hover { border-color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tabs .t1 { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.tabs .t2 { display: block; font-weight: 500; }
.tabs .pct { font-family: var(--f-mono); font-size: 12px; }
.tabs button[aria-selected="true"] .pct { color: var(--accent); }
.qs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.q { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 12px; }
.q .head { display: flex; gap: 12px; align-items: flex-start; }
.ref { flex-shrink: 0; font-family: var(--f-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--accent); }
.q .text { font-weight: 500; font-size: 15.5px; line-height: 1.4; }
.q .ev { margin-top: 4px; font-size: 13px; color: var(--muted); }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opts button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px; }
.opts button:hover { border-color: var(--ink); }
.opts button[aria-pressed="true"] { font-weight: 600; }
.opts button[aria-pressed="true"][data-v="A"] { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.opts button[aria-pressed="true"][data-v="P"] { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.opts button[aria-pressed="true"][data-v="N"] { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.opts button[aria-pressed="true"][data-v="X"] { background: var(--line-2); border-color: var(--ink); }
.sec-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.aside { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.aside .card { gap: 14px; }
.aside .big { font-size: 48px; }
.ok-msg { padding: 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-size: 13px; }
.info { padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); font-size: 12.5px; color: #4f2c46; }

/* ---------- plano de ação ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13.5px; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.task.is-done { opacity: .65; }
.task.is-done .task__title { text-decoration: line-through; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; cursor: pointer; display: grid; place-items: center; }
.check svg { width: 14px; height: 14px; stroke: var(--paper); fill: none; stroke-width: 3; opacity: 0; }
.task.is-done .check { background: var(--ok); border-color: var(--ok); }
.task.is-done .check svg { opacity: 1; }
.task__title { font-weight: 500; }
.task__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.task__ctrls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.field-sm { display: flex; flex-direction: column; gap: 2px; }
.field-sm label { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field-sm select, .field-sm input { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: 13.5px; }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ---------- documentos ---------- */
.docs { display: flex; gap: 18px; align-items: flex-start; }
.table { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.grid { display: grid; grid-template-columns: 90px minmax(170px, 1fr) 110px 56px 120px; gap: 12px; align-items: center; min-width: 600px; }
.thead { padding: 12px 20px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.row { width: 100%; min-height: 52px; padding: 8px 20px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; cursor: pointer; text-align: left; font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(214, 160, 200, .12); }
.row[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--ink); }
.detail { width: 340px; flex-shrink: 0; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; }
.detail .title { font-size: 26px; line-height: 1.05; font-weight: 500; letter-spacing: -.02em; text-transform: uppercase; }
.detail h3 { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.flow { display: flex; flex-direction: column; gap: 8px; }
.flow div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.dot.done { background: var(--ink); border-color: var(--ink); }
.hist { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- equipamentos ---------- */
.eq { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.eq .card { gap: 10px; }
.eq__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.eq__code { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.eq__name { font-size: 18px; font-weight: 500; line-height: 1.2; }
.eq__dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 4px 0; }
.eq__dl dt { color: var(--muted); }
.eq__dl dd { margin: 0; }

/* ---------- aviso flutuante ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsivo ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag { flex-wrap: wrap; }
  .aside { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .aside > * { flex: 1 1 260px; }
  .docs { flex-direction: column; align-items: stretch; }
  .detail { width: auto; position: static; }
}
@media (max-width: 900px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .25s; box-shadow: 8px 0 32px rgba(0, 0, 0, .3); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(28, 27, 25, .45); z-index: 20; }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }
  .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
  .top { padding: 0 16px; }
  .who, .chip { display: none; }
  main { padding: 20px 16px 40px; }
  .two { grid-template-columns: 1fr; }
  .diag { flex-direction: column; align-items: stretch; }
  main > *, .diag > * { min-width: 0; max-width: 100%; }
  .tabs { width: auto; position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .tabs button { flex: 0 0 auto; min-width: 150px; }
  .task { grid-template-columns: auto 1fr; }
  .task__ctrls { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-hero { grid-column: span 2; }
  .big { font-size: 42px; }
  .kpi-hero .big { font-size: 64px; }
  .sec-nav .btn { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
