/* ADRIANA | CEUMA — componentes do protótipo. Consome somente tokens (assets/tokens.css). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface-page);
  color: var(--text-primary);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -4rem; z-index: 50; padding: var(--space-2) var(--space-4); background: var(--brand-primary); color: var(--text-on-primary); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-4); }
svg.i { width: var(--icon-md); height: var(--icon-md); flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: var(--icon-sm); height: var(--icon-sm); }
.mono { font-family: var(--font-mono); font-size: var(--text-helper); letter-spacing: -0.01em; }

/* ============ Shell ============ */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: linear-gradient(to right, var(--side-bg) var(--sidebar-width), transparent 0); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-5) var(--space-4);
  background: var(--side-bg); color: var(--side-text);
}
.side-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); text-decoration: none; }
.mark {
  width: 2.125rem; height: 2.125rem; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none;
  background: var(--side-accent); color: var(--text-on-accent);
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-card-title);
}
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: var(--text-brand); letter-spacing: 0.08em; white-space: nowrap; }
.wordmark span { color: var(--side-text-subtle); font-weight: 600; margin: 0 var(--space-1); }
.wordmark b { color: var(--side-accent); font-weight: 700; letter-spacing: 0.12em; }
.side-brand small { display: block; color: var(--side-text-subtle); font-size: var(--text-helper); letter-spacing: 0.02em; }
.nav-group { margin: 0 0 var(--space-2) var(--space-3); font-size: var(--text-caption); letter-spacing: 0.14em; text-transform: uppercase; color: var(--side-text-subtle); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--sidebar-item-height);
  padding: 0 var(--space-3); border-radius: var(--radius-sm);
  color: var(--side-text-muted); text-decoration: none; font-size: var(--text-label);
}
.nav-item:hover { background: var(--side-surface); color: var(--side-text); }
.nav-item[aria-current="page"] { background: var(--side-active-bg); color: var(--side-text); box-shadow: inset 0 0 0 1px var(--side-active-line); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--side-accent); }
.nav-item .count { margin-left: auto; min-width: 1.375rem; text-align: center; font-size: var(--text-caption); font-weight: 700; padding: 1px var(--space-2); border-radius: var(--radius-pill); background: var(--side-accent); color: var(--text-on-accent); }
.side-cycle { margin: var(--space-1) 0 0 2.125rem; padding: var(--space-2) var(--space-3) var(--space-1); border-left: 2px solid var(--side-border); display: flex; flex-direction: column; gap: var(--space-1); }
.side-cycle a { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-helper); color: var(--side-text-subtle); text-decoration: none; padding: 2px 0; }
.side-cycle a .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1.5px solid var(--side-text-subtle); flex: none; }
.side-cycle a.done { color: var(--side-text-muted); }
.side-cycle a.done .dot { background: var(--side-success); border-color: var(--side-success); }
.side-cycle a.current { color: var(--side-text); font-weight: 600; }
.side-cycle a.current .dot { background: var(--side-accent); border-color: var(--side-accent); box-shadow: 0 0 0 3px var(--side-active-bg); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--side-surface); font-size: var(--text-helper); color: var(--side-text-subtle); }
.side-foot div { display: flex; justify-content: space-between; gap: var(--space-3); }
.side-foot b { color: var(--side-text-muted); font-weight: 500; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.side-foot .mono { font-size: var(--text-caption); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: var(--topbar-height);
  display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-6);
  background: color-mix(in srgb, var(--surface-topbar) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-default);
}
.icon-btn.menu-btn { display: none; }
.env { display: inline-flex; align-items: center; height: 1.75rem; padding: 0 var(--space-3); border-radius: var(--radius-pill); background: var(--state-warning-bg); color: var(--state-warning); font-size: var(--text-caption); font-weight: 700; letter-spacing: 0.08em; white-space: nowrap; }
.conn { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--text-helper); white-space: nowrap; }
.conn::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--state-success); box-shadow: 0 0 0 3px var(--state-success-bg); }
.demo-tag { display: inline-flex; align-items: center; height: 1.75rem; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px dashed var(--border-strong); color: var(--text-muted); font-size: var(--text-caption); font-weight: 600; white-space: nowrap; }
.grow { flex: 1; }
.comp-switch { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-height); padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-card); font-size: var(--text-label); color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.comp-switch b { color: var(--text-primary); }
.icon-btn { width: var(--touch-min); height: var(--touch-min); display: grid; place-items: center; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-muted); }
.icon-btn .badge-dot { position: absolute; top: 0.6rem; right: 0.6rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--state-warning); }
.user-chip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3); border: 0; border-left: 1px solid var(--border-default); background: none; cursor: pointer; text-align: left; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-primary); color: var(--text-on-primary); font-weight: 700; font-size: var(--text-label); flex: none; }
.user-chip b { display: block; font-size: var(--text-label); font-weight: 600; }
.user-chip small { display: block; font-size: var(--text-helper); color: var(--text-muted); white-space: nowrap; }

.content { flex: 1; padding: var(--space-10) var(--space-10) var(--space-12); animation: enter 0.22s ease-out; }
.col { width: 100%; max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: var(--page-gap); }
.col.wide { max-width: var(--content-wide); }
@keyframes enter { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ Cabeçalho de página ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.eyebrow { margin: 0 0 var(--space-2); font-size: var(--text-helper); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-primary); font-weight: 700; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: var(--text-page-title); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
.lede { margin: var(--space-3) 0 0; color: var(--text-secondary); font-size: var(--text-lede); max-width: 40rem; }

/* ============ Stepper ============ */
.stepper { display: flex; align-items: center; gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.stepper li { display: contents; }
.step { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-label); color: var(--text-muted); white-space: nowrap; text-decoration: none; border-radius: var(--radius-pill); padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1); }
a.step:hover { background: var(--surface-muted); }
.step .n { width: var(--step-badge); height: var(--step-badge); border-radius: 50%; display: grid; place-items: center; font-size: var(--text-helper); font-weight: 700; font-family: var(--font-display); border: 1.5px solid var(--border-strong); background: var(--surface-card); }
.step.done { color: var(--text-secondary); }
.step.done .n { background: var(--state-success-bg); color: var(--state-success); border-color: transparent; }
.step.current { color: var(--text-primary); font-weight: 600; }
.step.current .n { background: var(--brand-primary); color: var(--text-on-primary); border-color: transparent; box-shadow: 0 0 0 4px var(--brand-primary-soft); }
.step-line { flex: 1; min-width: var(--space-4); height: 2px; border-radius: 2px; background: var(--border-default); }
.step-line.done { background: var(--state-success); }

/* ============ Cartões ============ */
.card { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); min-width: 0; }
.card.focus { border-color: var(--brand-primary-line); padding: var(--card-padding) var(--card-padding) 0; overflow: hidden; }
.card.plain { padding: var(--card-padding); }
.focus-top { display: flex; gap: var(--space-5); align-items: flex-start; }
.big-ic { width: 3rem; height: 3rem; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; background: var(--brand-primary-soft); color: var(--brand-primary); }
.big-ic svg { width: 1.5rem; height: 1.5rem; }
.big-ic.ok { background: var(--state-success-bg); color: var(--state-success); }
.big-ic.warn { background: var(--state-warning-bg); color: var(--state-warning); }
.big-ic.lock { background: var(--surface-muted); color: var(--text-muted); }
.focus h2, .card h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-focus-title); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.card h3 { margin: 0; font-family: var(--font-display); font-size: var(--text-card-title); font-weight: 700; }
.sub { margin: var(--space-2) 0 0; color: var(--text-secondary); font-size: var(--text-body); }
.focus-body { margin-top: var(--space-6); display: flex; flex-direction: column; }
.focus-foot { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-6) calc(var(--card-padding) * -1) 0; padding: var(--space-5) var(--card-padding); border-top: 1px solid var(--border-default); background: var(--surface-muted); }
.focus-foot .note { flex: 1; min-width: 14rem; display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--text-label); }

/* Linhas de verificação */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--border-default); font-size: var(--text-body); }
.rows > li .end { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.ck { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-muted); color: var(--text-muted); }
.ck.ok { background: var(--state-success-bg); color: var(--state-success); }
.ck.warn { background: var(--state-warning-bg); color: var(--state-warning); }
.ck.run { background: var(--brand-primary-soft); color: var(--brand-primary); }
.row-main { min-width: 0; }
.row-main b { display: block; font-weight: 600; }
.row-main span { display: block; color: var(--text-muted); font-size: var(--text-label); }

/* Fatos-chave */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); padding: var(--space-5) 0 var(--space-1); border-top: 1px solid var(--border-default); }
.facts span { display: block; font-size: var(--text-helper); color: var(--text-muted); }
.facts b { display: block; margin-top: var(--space-1); font-family: var(--font-display); font-size: var(--text-section-title); font-weight: 700; }

/* KPIs do início */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.kpi { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface-card); border: 1px solid var(--border-default); }
.kpi .lbl { font-size: var(--text-label); color: var(--text-secondary); display: flex; align-items: center; gap: var(--space-2); }
.kpi .val { margin-top: var(--space-2); font-family: var(--font-display); font-size: var(--text-kpi); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .val small { font-size: var(--text-body); color: var(--text-muted); font-weight: 600; margin-left: var(--space-1); }
.kpi .delta { margin-top: var(--space-2); font-size: var(--text-helper); color: var(--text-muted); }
.up { color: var(--state-success); font-weight: 600; }
.down { color: var(--state-danger); font-weight: 600; }

/* ============ Botões e controles ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--button-height); padding: 0 var(--space-5); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-primary); font-size: var(--text-button); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.12s, box-shadow 0.12s; }
.btn:hover { border-color: var(--brand-primary-line); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-primary); border-color: transparent; color: var(--text-on-primary); box-shadow: 0 8px 20px -10px var(--brand-primary-line); }
.btn.primary:hover { box-shadow: 0 10px 24px -8px var(--brand-primary-line); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--surface-muted); }
.btn.danger { background: var(--state-danger-bg); border-color: transparent; color: var(--state-danger); }
.btn.lg { min-height: calc(var(--button-height) + 0.25rem); padding: 0 var(--space-6); font-size: var(--text-body); }
.btn.sm { min-height: 2.25rem; padding: 0 var(--space-3); font-size: var(--text-helper); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.lnk { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--brand-primary); font-weight: 600; font-size: var(--text-label); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.lnk:hover { text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-label); color: var(--text-secondary); }
.field select, .field input[type="text"] { height: var(--control-height); min-width: 11rem; padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-primary); font: inherit; font-size: var(--text-body); }
.field-row { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.field-row .arrow { height: var(--control-height); display: grid; place-items: center; color: var(--text-muted); }

/* ============ Pílulas de estado (sempre ícone/ponto + rótulo) ============ */
.pill { display: inline-flex; align-items: center; gap: var(--space-2); height: 1.625rem; padding: 0 var(--space-3); border-radius: var(--radius-pill); font-size: var(--text-badge); font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--state-success); background: var(--state-success-bg); }
.pill.warn { color: var(--state-warning); background: var(--state-warning-bg); }
.pill.danger { color: var(--state-danger); background: var(--state-danger-bg); }
.pill.info { color: var(--state-info); background: var(--state-info-bg); }
.pill.run { color: var(--brand-primary); background: var(--brand-primary-soft); }
.pill.muted { color: var(--text-muted); background: var(--surface-muted); }

/* ============ Pendência, avisos ============ */
.waiting { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-secondary); font-size: var(--text-label); flex-wrap: wrap; }
.waiting b { color: var(--text-primary); }
.waiting .w-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--state-warning); box-shadow: 0 0 0 4px var(--state-warning-bg); flex: none; }
.waiting .w-dot.info { background: var(--state-info); box-shadow: 0 0 0 4px var(--state-info-bg); }
.waiting .btn { margin-left: auto; }
.callout { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-md); font-size: var(--text-label); color: var(--text-secondary); background: var(--state-info-bg); }
.callout svg { color: var(--state-info); margin-top: 2px; }
.callout.warn { background: var(--state-warning-bg); } .callout.warn svg { color: var(--state-warning); }
.callout b { color: var(--text-primary); }

/* ============ Importação: três relatórios ============ */
.slots { display: flex; flex-direction: column; }
.slot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--border-default); }
.slot .file-ic { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-muted); color: var(--text-secondary); }
.slot.ready .file-ic { background: var(--state-success-bg); color: var(--state-success); }
.slot .meta { font-size: var(--text-label); color: var(--text-muted); }
.slot .name { font-weight: 600; display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.slot .actions { display: flex; gap: var(--space-2); align-items: center; }
.drop { display: flex; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-5); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); font-size: var(--text-label); background: var(--surface-muted); text-align: center; }
.drop.over { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-soft); }

/* ============ Abas e listas ============ */
.tabs { display: flex; align-items: center; gap: var(--space-1); border-bottom: 1px solid var(--border-default); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: var(--space-3) var(--space-4); color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: var(--text-label); }
.tabs button[aria-selected="true"] { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--brand-primary); }
.tabs .tabs-note { margin-left: auto; font-size: var(--text-helper); color: var(--text-muted); white-space: nowrap; padding-left: var(--space-4); }
.plist { list-style: none; margin: 0; padding: 0; }
.plist > li { border-bottom: 1px solid var(--border-default); }
.prow { display: grid; grid-template-columns: 3rem minmax(10rem, 15rem) minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-1); width: 100%; background: none; border: 0; text-align: left; cursor: pointer; font-size: var(--text-body); }
.prow:hover { background: var(--surface-muted); }
.prow .code { color: var(--text-muted); }
.prow b { font-weight: 600; }
.prow .pv { color: var(--text-secondary); font-size: var(--text-label); }
.prow .chev { color: var(--text-muted); transition: transform 0.15s; }
.prow[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pdetail { padding: 0 var(--space-1) var(--space-5) 3.75rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.pdetail p { margin: 0; color: var(--text-secondary); font-size: var(--text-label); }
.mini-table { width: 100%; border-collapse: collapse; font-size: var(--text-label); }
.mini-table td { padding: var(--space-1) 0; border-bottom: 1px dashed var(--border-default); }
.mini-table td:last-child { text-align: right; font-weight: 600; }

/* Gráfico de barras acessível */
.bars { display: flex; align-items: flex-end; gap: var(--space-2); height: 7rem; padding-top: var(--space-2); border-bottom: 1px solid var(--border-default); }
.bars .g { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; }
.bars .b { width: 40%; max-width: 1rem; border-radius: 3px 3px 0 0; background: var(--chart-base); }
.bars .b.cur { background: var(--chart-current); }
.bars-x { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.bars-x span { flex: 1; text-align: center; font-size: var(--text-caption); color: var(--text-muted); }
.legend { display: flex; gap: var(--space-4); font-size: var(--text-helper); color: var(--text-muted); margin-top: var(--space-2); }
.legend i { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; margin-right: var(--space-1); vertical-align: -1px; }
.legend .base { background: var(--chart-base); } .legend .cur { background: var(--chart-current); }
.legend .nd { border: 1.5px dashed var(--border-strong); }
.bars .b.nd { background: none; border: 1.5px dashed var(--border-strong); border-bottom: 0; height: 30%; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-table); }
table.data th { text-align: left; font-size: var(--text-caption); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: var(--space-3); border-bottom: 1px solid var(--border-default); white-space: nowrap; }
table.data td { padding: var(--space-3); border-bottom: 1px solid var(--border-default); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data .tab { font-family: var(--font-mono); font-size: var(--text-helper); }
.muted { color: var(--text-muted); }

/* Proteções */
.protect { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.protect div { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px dashed var(--border-strong); font-size: var(--text-label); color: var(--text-secondary); }
.protect svg { color: var(--brand-primary); margin-top: 2px; }
.protect b { display: block; color: var(--text-primary); }

/* Progresso */
.progress { height: 0.375rem; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand-primary); border-radius: inherit; transition: width 0.35s ease; }
.spin { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--brand-primary-soft); border-top-color: var(--brand-primary); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Linha do tempo (auditoria) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 6.5rem 1rem minmax(0, 1fr); gap: var(--space-3); padding-bottom: var(--space-5); position: relative; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: calc(6.5rem + var(--space-3) + 0.4375rem); top: 1.1rem; bottom: 0; width: 1px; background: var(--border-default); }
.timeline time { font-size: var(--text-helper); color: var(--text-muted); text-align: right; padding-top: 2px; }
.timeline .pt { width: 0.875rem; height: 0.875rem; border-radius: 50%; margin-top: 3px; border: 2px solid var(--border-strong); background: var(--surface-card); position: relative; z-index: 1; }
.timeline .pt.ok { border-color: var(--state-success); }
.timeline .pt.write { border-color: var(--state-warning); background: var(--state-warning); }
.timeline .pt.read { border-color: var(--state-info); }
.timeline b { display: block; font-weight: 600; }
.timeline span { display: block; color: var(--text-muted); font-size: var(--text-label); }

/* Cartões dos 5 painéis */
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--space-4); }
.panel { padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--surface-card); display: flex; flex-direction: column; gap: var(--space-2); }
.panel .top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.panel h3 { font-size: var(--text-body); }
.panel p { margin: 0; color: var(--text-muted); font-size: var(--text-label); }

/* Estado vazio */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-10) var(--space-6); color: var(--text-muted); }
.empty img { width: 9rem; height: auto; }
.empty h2 { color: var(--text-primary); }

/* Esqueleto de carregamento */
.skel { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-muted), var(--surface-sunken), var(--surface-muted)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; height: 1rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Conclusão do ciclo */
.done-hero { display: flex; align-items: center; gap: var(--space-6); }
.done-hero img { width: 8rem; flex: none; }

/* ============ Diálogo da aplicação (sem alert/confirm nativos) ============ */
.scrim { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 8vh var(--space-4) var(--space-4); background: var(--surface-overlay); backdrop-filter: blur(3px); overflow-y: auto; }
.dialog { width: min(40rem, 100%); background: var(--surface-card); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); animation: pop 0.18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-h { display: flex; gap: var(--space-4); padding: var(--space-6) var(--space-6) var(--space-2); }
.dialog-h .eyebrow { color: var(--state-warning); margin: 0 0 var(--space-1); }
.dialog-h h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-section-title); }
.dialog-h p { margin: var(--space-2) 0 0; color: var(--text-secondary); font-size: var(--text-label); }
.dialog-h .icon-btn { margin-left: auto; margin-top: calc(var(--space-2) * -1); }
.dialog-b { padding: var(--space-3) var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.dialog-f { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default); background: var(--surface-muted); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.dialog-f .note { flex: 1; min-width: 12rem; font-size: var(--text-helper); color: var(--text-muted); display: flex; gap: var(--space-2); align-items: center; }
.sumbox { border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.sumbox .r { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-4); padding: var(--space-2) var(--space-4); font-size: var(--text-label); border-bottom: 1px solid var(--border-default); }
.sumbox .r:last-child { border-bottom: 0; }
.sumbox .r.h { background: var(--surface-muted); font-size: var(--text-caption); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.sumbox .r span:not(:first-child) { text-align: right; }
.ack { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-label); color: var(--text-secondary); cursor: pointer; }
.ack input { width: 1.125rem; height: 1.125rem; margin: 2px 0 0; accent-color: var(--brand-primary); flex: none; }
.typed label { display: block; font-size: var(--text-label); color: var(--text-secondary); margin-bottom: var(--space-2); }
.typed code { font-family: var(--font-mono); font-size: var(--text-helper); color: var(--text-primary); background: var(--surface-muted); border: 1px solid var(--border-default); padding: 1px var(--space-2); border-radius: var(--radius-sm); }
.typed input { width: 100%; height: calc(var(--control-height) + 0.25rem); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--surface-muted); color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-body); letter-spacing: 0.06em; }
.typed input.match { border-color: var(--state-success); }
.typed small { display: block; margin-top: var(--space-2); font-size: var(--text-helper); color: var(--text-muted); }
.typed small.ok { color: var(--state-success); }

/* Toast */
.toast { position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 60; display: flex; align-items: center; gap: var(--space-3); max-width: min(28rem, calc(100vw - 2rem)); padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); background: var(--text-primary); color: var(--surface-card); font-size: var(--text-label); box-shadow: var(--shadow-pop); transform: translateY(150%); opacity: 0; transition: transform 0.25s, opacity 0.25s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }

/* Menu do usuário / popover simples */
.menu-pop { position: fixed; z-index: 45; min-width: 15rem; padding: var(--space-2); border-radius: var(--radius-md); background: var(--surface-card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: none; border: 0; text-align: left; cursor: pointer; font-size: var(--text-label); color: var(--text-primary); text-decoration: none; min-height: 2.5rem; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-muted); }
.menu-pop .sep { height: 1px; background: var(--border-default); margin: var(--space-2) 0; }
.menu-pop small { padding: var(--space-2) var(--space-3); color: var(--text-muted); font-size: var(--text-helper); }

/* ============ Responsivo (faixas de comportamento) ============ */
@media (max-width: 1400px) {
  .content { padding: var(--space-8) var(--space-8) var(--space-10); }
}
@media (max-width: 1180px) {
  .conn { display: none; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: min(18rem, 86vw); transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 20; background: var(--surface-overlay); }
  .icon-btn.menu-btn { display: grid; }
  .topbar { padding: 0 var(--space-4); }
  .content { padding: var(--space-6) var(--space-5) var(--space-10); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-tag { display: none; }
  .pdetail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .stepper .step .lbl { display: none; }
  .stepper .step.current .lbl { display: inline; }
  .protect { grid-template-columns: minmax(0, 1fr); }
  .prow { grid-template-columns: 2.5rem minmax(0, 1fr) auto auto; }
  .prow .pv { grid-column: 2 / -1; grid-row: 2; }
  .pdetail { padding-left: var(--space-1); }
  .user-chip > span:not(.avatar) { display: none; }
  .comp-switch .lbl { display: none; }
}
@media (max-width: 600px) {
  .content { padding: var(--space-5) var(--space-4) var(--space-10); }
  .topbar { gap: var(--space-2); }
  .env { display: none; }
  #tema-btn { display: none; }
  .user-chip { border-left: 0; padding-left: 0; }
  .focus-top { gap: var(--space-3); }
  .stepper { gap: var(--space-1); }
  .step { padding: 0; gap: var(--space-1); }
  .step-line { min-width: var(--space-2); }
  .field select { min-width: 0; width: 100%; }
  .field-row > .field { flex: 1 1 8rem; }
  .field-row .btn { flex: 1 1 100%; }
  .prow { gap: var(--space-2); }
  .big-ic { width: 2.5rem; height: 2.5rem; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .slot { grid-template-columns: auto minmax(0, 1fr); }
  .slot .actions { grid-column: 1 / -1; }
  .focus-foot .btn { width: 100%; }
  .timeline li { grid-template-columns: 4.5rem 1rem minmax(0, 1fr); }
  .timeline li:not(:last-child)::after { left: calc(4.5rem + var(--space-3) + 0.4375rem); }
  .done-hero { flex-direction: column; align-items: flex-start; }
  .waiting .btn { margin-left: 0; width: 100%; }
  .toast { right: var(--space-4); left: var(--space-4); bottom: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
