/* ==========================================================================
   RSG Supervisão — design system
   Identidade: rsggroup.com.br (Unbounded / Instrument Sans / IBM Plex Mono,
   azul #2323ff, ciano #00e5ff, fundo #04040b). Motivo visual: grade de pontos
   conectados do símbolo da RSG — usada no fundo e no mapa de calor.
   ========================================================================== */

:root {
  --bg: #04040b;
  --bg-2: #080814;
  --bg-3: #0c0c1c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --blue: #2323ff;
  --blue-bright: #4d5aff;
  --blue-deep: #0000e0;
  --cyan: #00e5ff;

  --text: #f2f3ff;
  --muted: #9b9eb8;
  --muted-2: #6a6d87;

  --ok: #3ee6a8;
  --ok-bg: rgba(62, 230, 168, 0.1);
  --parcial: #fbbc04;
  --parcial-bg: rgba(251, 188, 4, 0.1);
  --falha: #ff5f57;
  --falha-bg: rgba(255, 95, 87, 0.1);
  --critica: #ff2e63;

  --grad: linear-gradient(120deg, #4d5aff 0%, #00e5ff 100%);
  --grad-btn: linear-gradient(120deg, #1d1dff 0%, #0090ff 100%);

  --font-display: "Unbounded", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sidebar: 256px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);

  /* tokens semânticos (sobrescritos no tema claro) */
  --pink: #ff7a9c;
  --violet: #d4b0ff;
  --indigo-soft: #aab1ff;
  --on-grad: #04040b;
  --on-ok: #03170f;
  --ok-hover: #5ff0bb;
  --field: rgba(0, 0, 0, 0.35);
  --field-focus: rgba(0, 0, 0, 0.5);
  --inset: rgba(0, 0, 0, 0.25);
  --quote: rgba(0, 0, 0, 0.3);
  --hover-line: rgba(255, 255, 255, 0.27);
  --row-hover: rgba(255, 255, 255, 0.02);
  --col-bg: rgba(255, 255, 255, 0.02);
  --ring: rgba(255, 255, 255, 0.14);
  --dot-grid: rgba(255, 255, 255, 0.07);
  --dot-grid-strong: rgba(255, 255, 255, 0.09);
  --sidebar-bg: linear-gradient(180deg, rgba(8, 8, 20, 0.92), rgba(4, 4, 11, 0.92));
  --topbar-bg: rgba(4, 4, 11, 0.72);
  --toast-bg: rgba(12, 12, 28, 0.96);
  --overlay: rgba(2, 2, 8, 0.7);
  --glow-blue: rgba(35, 35, 255, 0.32);
  --glow-cyan: rgba(0, 229, 255, 0.14);
  --card-shadow: none;
  --hero-bg: linear-gradient(140deg, rgba(35, 35, 255, 0.28), rgba(0, 229, 255, 0.06) 70%);
  --hero-line: rgba(77, 90, 255, 0.35);
  --meter-glow: 0 0 14px rgba(0, 229, 255, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Atmosfera de fundo ---------- */
.bg-dots {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--dot-grid) 1px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 0%, #000 20%, transparent 75%);
}
.bg-glow {
  position: fixed; pointer-events: none; z-index: 0;
  width: 900px; height: 600px; top: -320px; left: 10%;
  background: radial-gradient(closest-side, var(--glow-blue), transparent),
              radial-gradient(closest-side at 70% 60%, var(--glow-cyan), transparent);
  filter: blur(40px);
}

/* ---------- Layout base ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand__mark { width: 34px; height: 34px; filter: drop-shadow(0 0 12px rgba(35, 35, 255, 0.8)); }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; line-height: 1; }
.brand__word em { font-style: normal; font-weight: 400; color: var(--blue-bright); }
.brand__sub { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); margin-top: 6px; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.nav__label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); padding: 18px 12px 8px;
}
.nav__label::before { content: "◆ "; color: var(--blue-bright); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.is-active { color: var(--text); background: var(--surface-2); }
.nav a.is-active::before {
  content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: var(--grad); box-shadow: 0 0 12px var(--cyan);
}
.nav a.is-active .icon { color: var(--cyan); }
.nav__count {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text);
}
.nav__count[hidden] { display: none; }
.nav__count--alerta { background: var(--falha); color: #1a0402; }
.nav__count--pendente { background: rgba(77, 90, 255, 0.25); color: var(--indigo-soft); }

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  background: var(--grad); color: var(--on-grad);
}
.avatar--sm { width: 26px; height: 26px; font-size: 10px; }
.avatar--sys { background: var(--surface-3); color: var(--muted); }
.sidebar__user-info { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar__user-info strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-info span { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar__user form { display: contents; }

.sidebar-backdrop { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 36px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar .topbar__menu { display: none; }
.topbar__date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.topbar__date b { color: var(--text); font-weight: 500; }
.topbar__date i { font-style: normal; color: var(--blue-bright); margin: 0 8px; }
.topbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.content { padding: 32px 36px 64px; max-width: 1480px; width: 100%; }

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.eyebrow::before { content: "◆"; color: var(--cyan); font-size: 10px; }
.eyebrow a:hover { color: var(--text); }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; line-height: 1.1; }
.page-sub { color: var(--muted); margin-top: 8px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-title {
  font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.section-title small { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); font-weight: 400; letter-spacing: 0.06em; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card--flush .card__head { padding: 20px 22px 0; }
.card__link { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.04em; }
.card__link:hover { color: var(--cyan); }
.card__link .icon { width: 14px; height: 14px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  position: relative; overflow: hidden;
  padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
a.kpi:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.kpi__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi__value { font-family: var(--font-display); font-weight: 600; font-size: 36px; letter-spacing: -0.04em; line-height: 1; margin-top: 14px; }
.kpi__value small { font-size: 16px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi__foot { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.kpi__foot b { color: var(--text); font-weight: 600; }
.kpi--hero { background: var(--hero-bg); border-color: var(--hero-line); }
.kpi--hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px;
  background: radial-gradient(var(--hero-dots, rgba(255,255,255,0.18)) 1.5px, transparent 1.8px) 0 0 / 14px 14px;
  mask-image: radial-gradient(closest-side, #000, transparent); opacity: 0.8;
}
.kpi--danger .kpi__value { color: var(--falha); }
.kpi--warn .kpi__value { color: var(--parcial); }
.kpi--danger { border-color: rgba(255, 95, 87, 0.25); }
.kpi .dot { width: 7px; height: 7px; }

.meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: var(--meter-glow); transition: width 0.8s var(--ease); }
.meter--split { display: flex; gap: 2px; background: transparent; }
.meter--split > span { box-shadow: none; border-radius: 3px; }

.prio-row { display: flex; gap: 12px; margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.prio-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Pontos de status ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.dot--ok { background: var(--ok); box-shadow: 0 0 10px rgba(62, 230, 168, 0.6); }
.dot--parcial { background: var(--parcial); box-shadow: 0 0 10px rgba(251, 188, 4, 0.5); }
.dot--falha { background: var(--falha); box-shadow: 0 0 10px rgba(255, 95, 87, 0.6); }
.dot--critica { background: var(--critica); box-shadow: 0 0 10px rgba(255, 46, 99, 0.7); }
.dot--alta { background: var(--falha); }
.dot--media { background: var(--parcial); }
.dot--baixa { background: var(--blue-bright); }
.dot--pendente { background: transparent; border: 1.5px solid var(--muted-2); }
.dot--pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.5); } 50% { box-shadow: 0 0 0 6px rgba(0, 229, 255, 0); } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.badge--resultado-ok, .badge--alerta-resolvido, .badge--status-ativo { background: var(--ok-bg); color: var(--ok); }
.badge--resultado-parcial, .badge--prioridade-media, .badge--status-pausado, .badge--alerta-em_andamento { background: var(--parcial-bg); color: var(--parcial); }
.badge--resultado-falha, .badge--prioridade-alta, .badge--alerta-aberto { background: var(--falha-bg); color: var(--falha); }
.badge--prioridade-critica { background: var(--critica); color: #fff; box-shadow: 0 0 16px rgba(255, 46, 99, 0.45); }
.badge--prioridade-baixa { background: rgba(77, 90, 255, 0.15); color: var(--indigo-soft); }
.badge--resultado-pendente { border: 1px dashed var(--line-strong); background: transparent; }
.badge--resultado-atrasado { border: 1px dashed var(--falha); color: var(--falha); background: transparent; }
.badge--status-encerrado { background: var(--surface); color: var(--muted-2); }
.badge--origem-reclamacao_cliente { background: rgba(255, 46, 99, 0.12); color: var(--pink); }
.badge--origem-conferencia { background: rgba(0, 229, 255, 0.1); color: var(--cyan); }
.badge--origem-etapa_atrasada { background: rgba(192, 132, 252, 0.12); color: var(--violet); }
.badge--risco { background: var(--falha-bg); color: var(--falha); }
.badge--risco::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse-red 1.8s infinite; }
@keyframes pulse-red { 50% { opacity: 0.3; } }
.badge--ghost { background: transparent; border-color: var(--line); }

.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c); white-space: nowrap;
}
.cat-chip::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); transform: rotate(45deg); box-shadow: 0 0 8px var(--c); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.3s, opacity 0.2s;
}
.btn:hover { background: var(--surface-2); border-color: var(--hover-line); }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-loading { opacity: 0.55; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: 0 8px 28px -8px rgba(29, 29, 255, 0.8); }
.btn--primary:hover { background: var(--grad-btn); border-color: transparent; box-shadow: 0 10px 34px -6px rgba(0, 144, 255, 0.8); }
.btn--ok { background: var(--ok); color: var(--on-ok); border-color: transparent; }
.btn--ok:hover { background: var(--ok-hover); border-color: transparent; box-shadow: 0 8px 26px -8px rgba(62, 230, 168, 0.8); }
.btn--danger { background: var(--falha-bg); color: var(--falha); border-color: rgba(255, 95, 87, 0.35); }
.btn--danger:hover { background: rgba(255, 95, 87, 0.18); border-color: var(--falha); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); background: var(--surface); border-color: transparent; }
.btn--del:hover { color: var(--falha); background: var(--falha-bg); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--xs { height: 26px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.field .hint { font-size: 12.5px; color: var(--muted-2); }
.req { color: var(--cyan); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 10px 14px;
  background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-size: 14.5px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--hover-line); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-bright); box-shadow: 0 0 0 4px rgba(77, 90, 255, 0.18); background: var(--field-focus); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9eb8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.select option { background: var(--bg-2); }
input[type="date"].input { color-scheme: dark; }
input[type="color"].input { padding: 4px; height: 42px; width: 64px; cursor: pointer; }
input[type="file"].input { padding: 8px 10px; font-size: 13px; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 600; margin-right: 10px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.25s var(--ease), background 0.2s; }
.switch input:checked { background: var(--blue); border-color: var(--blue-bright); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.segmented a, .segmented label {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: color 0.2s, background 0.2s;
}
.segmented a:hover, .segmented label:hover { color: var(--text); }
.segmented a.is-active, .segmented input:checked + span { color: var(--text); }
.segmented a.is-active { background: var(--surface-3); }
.segmented label:has(input:checked) { background: var(--surface-3); color: var(--text); }
.segmented input { display: none; }
.segmented .n { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.segmented .icon { width: 15px; height: 15px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.toolbar .search .input { padding-left: 40px; border-radius: 999px; }
.toolbar .select { width: auto; border-radius: 999px; min-width: 150px; }
.toolbar .spacer { flex: 1; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-2); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--row-hover); }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table .row-link { font-weight: 600; }
.table .row-link:hover { color: var(--cyan); }
.table .sub { display: block; font-size: 12.5px; color: var(--muted-2); font-weight: 400; margin-top: 2px; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-dim td { opacity: 0.55; }

/* ---------- Mapa de calor (grade de pontos, como o símbolo da RSG) ---------- */
.heat { --cell: 34px; overflow-x: auto; }
.heat__grid { display: grid; grid-template-columns: minmax(140px, 1fr) repeat(var(--cols), var(--cell)); align-items: center; row-gap: 4px; min-width: max-content; }
.heat__head { font-family: var(--font-mono); font-size: 10px; color: var(--muted-2); text-align: center; letter-spacing: 0.04em; padding-bottom: 8px; line-height: 1.2; }
.heat__head.is-now { color: var(--cyan); }
.heat__name { font-size: 13.5px; font-weight: 500; padding-right: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); transition: color 0.2s; }
.heat__name:hover { color: var(--text); }
.heat__cell { position: relative; height: 26px; display: grid; place-items: center; }
.heat__cell i {
  position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--ring); transition: transform 0.25s var(--ease);
}
.heat__cell:hover i { transform: scale(1.35); }
.heat__cell.r-ok i { background: var(--blue-bright); border-color: transparent; box-shadow: 0 0 10px rgba(77, 90, 255, 0.8); width: 14px; height: 14px; }
.heat__cell.r-parcial i { background: var(--parcial); border-color: transparent; box-shadow: 0 0 10px rgba(251, 188, 4, 0.55); }
.heat__cell.r-falha i { background: var(--falha); border-color: transparent; box-shadow: 0 0 12px rgba(255, 95, 87, 0.8); width: 16px; height: 16px; }
.heat__cell.is-now i { border-style: dashed; border-color: rgba(0, 229, 255, 0.5); }
.heat__cell.is-now.r-ok i, .heat__cell.is-now.r-parcial i, .heat__cell.is-now.r-falha i { border: 0; }
/* conectores entre semanas OK consecutivas — as "moléculas" do logo */
.heat__cell.r-ok.link-next::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: var(--cell); height: 6px; transform: translateY(-50%);
  background: var(--blue-bright); border-radius: 6px; opacity: 0.85;
}
.heat__legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.heat__legend span { display: inline-flex; align-items: center; gap: 7px; }
.heat__legend i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ring); }
.heat__legend .l-ok { background: var(--blue-bright); border: 0; }
.heat__legend .l-parcial { background: var(--parcial); border: 0; }
.heat__legend .l-falha { background: var(--falha); border: 0; }

/* ---------- Listas compactas ---------- */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list__item:last-child { border-bottom: 0; padding-bottom: 0; }
.list__item:first-child { padding-top: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
a.list__item:hover .list__title { color: var(--cyan); }
.list__meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.list__meta .sep { color: var(--muted-2); }
.list__aside { text-align: right; flex-shrink: 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.age { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.age--hot { color: var(--falha); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty__icon {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--cyan); border: 1px solid var(--line);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty strong { color: var(--text); font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.empty--ok .empty__icon { color: var(--ok); background: var(--ok-bg); border-color: rgba(62, 230, 168, 0.2); }

/* ---------- Conferência ---------- */
.conf-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 24px 26px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--conf-hero-bg, linear-gradient(120deg, rgba(35, 35, 255, 0.2), rgba(0, 229, 255, 0.04) 60%)), var(--surface);
  border: 1px solid var(--hero-line);
}
.conf-hero__nums { display: flex; align-items: baseline; gap: 10px; }
.conf-hero__big { font-family: var(--font-display); font-weight: 600; font-size: 44px; letter-spacing: -0.04em; line-height: 1; }
.conf-hero__of { font-family: var(--font-display); font-size: 20px; color: var(--muted); }
.conf-hero__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.conf-hero .meter { height: 8px; margin-top: 16px; max-width: 520px; }
.cycle-nav { display: flex; align-items: center; gap: 8px; }
.cycle-nav__label { font-family: var(--font-mono); font-size: 12px; text-align: center; min-width: 170px; line-height: 1.35; }
.cycle-nav__label b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 14px; }

.client-block { margin-bottom: 28px; animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.client-block__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 0 4px; }
.client-block__name { font-family: var(--font-display); font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.client-block__name:hover { color: var(--cyan); }
.client-block__count { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.client-block__line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.svc {
  position: relative; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
  transition: border-color 0.3s, background 0.4s;
}
.svc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--blue-bright)); opacity: 0.9; }
.svc:hover { border-color: var(--line-strong); }
.svc__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px 14px 20px; }
.svc__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc__meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 5px; align-items: center; }
.svc__meta .mono { font-size: 11.5px; }
.svc__meta .icon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.svc__scope {
  font-size: 12.5px; color: var(--muted); margin-top: 6px; max-width: 760px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.svc__scope b { color: var(--text); font-weight: 600; }
.svc__actions { display: flex; gap: 8px; align-items: center; }
.svc__done { display: flex; align-items: center; gap: 12px; text-align: right; }
.svc__who { font-size: 12px; color: var(--muted); line-height: 1.3; }
.svc__who b { color: var(--text); font-weight: 500; }

.svc.is-ok { background: linear-gradient(90deg, rgba(62, 230, 168, 0.06), transparent 50%), var(--surface); }
.svc.is-ok::before { background: var(--ok); }
.svc.is-parcial::before { background: var(--parcial); }
.svc.is-falha { background: linear-gradient(90deg, rgba(255, 95, 87, 0.07), transparent 50%), var(--surface); }
.svc.is-falha::before { background: var(--falha); }
.svc.just-done { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(62, 230, 168, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(62, 230, 168, 0); } }
.svc.just-failed { animation: flash-red 1.2s var(--ease); }
@keyframes flash-red { 0% { box-shadow: 0 0 0 0 rgba(255, 95, 87, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(255, 95, 87, 0); } }

.svc__detail { display: none; border-top: 1px dashed var(--line-strong); padding: 16px 16px 18px 20px; background: var(--inset); }
.svc.is-open .svc__detail { display: block; animation: rise 0.35s var(--ease); }
.checklist { display: grid; gap: 6px; margin-bottom: 14px; }
.check {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-xs);
  cursor: pointer; transition: background 0.15s; user-select: none; font-size: 14px;
}
.check:hover { background: var(--surface); }
.check input { appearance: none; width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; border: 1.5px solid var(--line-strong); display: grid; place-items: center; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-ok); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.2s var(--ease); }
.check input:checked { background: var(--ok); border-color: var(--ok); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:not(:checked) + span { color: var(--falha); text-decoration: line-through; text-decoration-color: rgba(255, 95, 87, 0.5); }
.check--static { cursor: default; padding: 6px 0; }
.check--static:hover { background: none; }
.check__mark { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.check__mark .icon { width: 13px; height: 13px; stroke-width: 3; }
.check__mark--ok { background: var(--ok-bg); color: var(--ok); }
.check__mark--no { background: var(--falha-bg); color: var(--falha); }
.fail-fields { display: none; gap: 12px; margin-bottom: 14px; }
.svc.has-fail .fail-fields, .svc.no-checklist .fail-fields { display: grid; }
.fail-fields .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.svc__detail-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.svc__detail-actions .preview { margin-right: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.form-error { color: var(--falha); font-size: 13px; }

.alert-pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px;
  padding: 2px 8px; border-radius: 999px; background: var(--falha-bg); color: var(--falha);
}
.alert-pill .icon { width: 12px; height: 12px; }
.alert-pill:hover { background: rgba(255, 95, 87, 0.2); }

/* Projetos */
.proj { padding: 18px 20px; }
.proj__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.step::before { content: ""; position: absolute; left: 12px; top: 30px; bottom: -8px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step__dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); background: var(--bg-2); position: relative; z-index: 1; }
.step__dot .icon { width: 13px; height: 13px; stroke-width: 3; }
.step.is-done .step__dot { background: var(--blue-bright); border-color: var(--blue-bright); color: #fff; box-shadow: 0 0 12px rgba(77, 90, 255, 0.7); }
.step.is-done::before { background: var(--blue-bright); }
.step.is-late .step__dot { border-color: var(--falha); color: var(--falha); }
.step__name { font-size: 14px; }
.step.is-done .step__name { color: var(--muted); }
.step__date { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.step.is-late .step__date { color: var(--falha); }

/* ---------- Kanban de alertas ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.board__col { background: var(--col-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 200px; }
.board__col-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; font-family: var(--font-display); font-size: 14px; font-weight: 500; }
.board__col-head .n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: auto; background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.board__col--resolvido { opacity: 0.8; }
.acard {
  display: block; position: relative; padding: 14px 14px 14px 18px; margin-bottom: 10px;
  border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line);
  transition: transform 0.25s var(--ease), border-color 0.2s;
  animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms);
}
.acard::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p, var(--muted-2)); }
.acard:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.acard--critica { --p: var(--critica); border-color: rgba(255, 46, 99, 0.35); box-shadow: 0 0 30px -12px rgba(255, 46, 99, 0.5); }
.acard--alta { --p: var(--falha); }
.acard--media { --p: var(--parcial); }
.acard--baixa { --p: var(--blue-bright); }
.acard__top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; align-items: center; }
.acard__title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.acard__client { font-size: 13px; color: var(--muted); margin-top: 4px; }
.acard__foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; }
.reinc { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--critica); display: inline-flex; align-items: center; gap: 4px; }
.reinc .icon { width: 13px; height: 13px; }

/* ---------- Detalhe do alerta / timeline ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); padding-top: 3px; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-line; overflow-wrap: anywhere; }
.quote { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--quote); border: 1px solid var(--line); border-left: 3px solid var(--falha); }
.quote--ok { border-left-color: var(--ok); }

.timeline { position: relative; display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 34px 1fr; gap: 14px; position: relative; padding-bottom: 20px; }
.tl::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 1px; background: var(--line-strong); }
.tl:last-child::before { display: none; }
.tl:last-child { padding-bottom: 0; }
.tl__icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); position: relative; z-index: 1; }
.tl__icon .icon { width: 15px; height: 15px; }
.tl__icon--ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(62, 230, 168, 0.25); }
.tl__icon--parcial { color: var(--parcial); background: var(--parcial-bg); border-color: rgba(251, 188, 4, 0.25); }
.tl__icon--falha, .tl__icon--alerta { color: var(--falha); background: var(--falha-bg); border-color: rgba(255, 95, 87, 0.25); }
.tl__icon--resolvido { color: var(--cyan); background: rgba(0, 229, 255, 0.08); border-color: rgba(0, 229, 255, 0.25); }
.tl__icon--sys { color: var(--blue-bright); }
.tl__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; padding-top: 6px; }
.tl__head b { font-weight: 600; }
.tl__time { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }
.tl__body { font-size: 14px; color: var(--muted); margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.tl__body a { color: var(--cyan); }

.attach { display: flex; flex-wrap: wrap; gap: 8px; }
.attach a {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 7px 12px; border-radius: var(--radius-xs); background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--text);
}
.attach a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach a:hover { border-color: var(--cyan); }
.attach .icon { width: 14px; height: 14px; color: var(--cyan); }

.hist-dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hist-dots .dot { width: 12px; height: 12px; }

/* ---------- Ficha do cliente ---------- */
.client-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.client-hero__mono {
  width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  background: var(--grad); color: var(--on-grad); box-shadow: 0 10px 40px -10px rgba(35, 35, 255, 0.8);
}
.contact-list { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.contact-list span { display: inline-flex; gap: 6px; align-items: center; }
.contact-list .icon { width: 14px; height: 14px; }

.contract { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contract:last-child { border-bottom: 0; padding-bottom: 0; }
.contract:first-child { padding-top: 0; }
.contract.is-dim { opacity: 0.5; }

/* ---------- Flash / toast ---------- */
.flashes { display: grid; gap: 10px; margin-bottom: 20px; }
.flash {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-size: 14px;
  animation: rise 0.4s var(--ease);
}
.flash .icon { width: 18px; height: 18px; }
.flash--sucesso { border-color: rgba(62, 230, 168, 0.35); background: var(--ok-bg); }
.flash--sucesso .icon { color: var(--ok); }
.flash--erro { border-color: rgba(255, 95, 87, 0.4); background: var(--falha-bg); }
.flash--erro .icon { color: var(--falha); }
.flash--aviso { border-color: rgba(251, 188, 4, 0.35); background: var(--parcial-bg); }
.flash--aviso .icon { color: var(--parcial); }
.flash__close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; display: grid; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--toast-bg); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); font-size: 14px;
  animation: toast-in 0.45s var(--ease);
}
.toast.is-leaving { animation: toast-out 0.3s var(--ease) forwards; }
.toast__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.toast__icon .icon { width: 16px; height: 16px; }
.toast--ok .toast__icon { background: var(--ok-bg); color: var(--ok); }
.toast--erro .toast__icon { background: var(--falha-bg); color: var(--falha); }
.toast--aviso .toast__icon { background: var(--parcial-bg); color: var(--parcial); }
.toast__body { flex: 1; }
.toast__body b { display: block; font-weight: 600; margin-bottom: 2px; }
.toast__body p { color: var(--muted); font-size: 13px; }
.toast__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px; background: var(--overlay); backdrop-filter: blur(6px); }
.modal.is-open { display: grid; animation: fade 0.25s; }
.modal__box { width: min(520px, 100%); background: var(--bg-3); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); animation: rise 0.35s var(--ease); }
.modal__title { font-family: var(--font-display); font-weight: 500; font-size: 18px; margin-bottom: 6px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Login ---------- */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login__art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; border-right: 1px solid var(--line); }
.login__art::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(var(--dot-grid-strong) 1.2px, transparent 1.4px) 0 0 / 30px 30px;
  mask-image: radial-gradient(ellipse at 40% 60%, #000 10%, transparent 70%);
}
.login__glow { position: absolute; width: 700px; height: 700px; left: -140px; bottom: -280px; background: radial-gradient(closest-side, rgba(35, 35, 255, 0.5), transparent); filter: blur(30px); }
.login__mark { position: absolute; right: -150px; top: 50%; width: 480px; transform: translateY(-50%); opacity: 0.5; filter: drop-shadow(0 0 60px rgba(35, 35, 255, 0.7)); animation: float 9s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(calc(-50% - 14px)) rotate(3deg); } }
.login__headline { position: relative; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -0.04em; max-width: 560px; }
.login__headline span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login__foot { position: relative; font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); letter-spacing: 0.08em; display: flex; gap: 14px; flex-wrap: wrap; }
.login__foot i { font-style: normal; color: var(--blue-bright); }
.login__form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login__card { width: min(400px, 100%); }
.login__card h2 { font-family: var(--font-display); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; margin: 26px 0 6px; }
.login__card .btn { width: 100%; height: 48px; margin-top: 6px; }

/* ---------- Erro ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; position: relative; z-index: 1; }
.error-page__code { font-family: var(--font-display); font-weight: 700; font-size: 120px; line-height: 1; letter-spacing: -0.06em; }
.error-page pre { text-align: left; font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--surface); padding: 16px; border-radius: var(--radius-sm); margin-top: 20px; max-width: 800px; overflow: auto; white-space: pre-wrap; }

.danger-zone { max-width: 880px; margin-top: 20px; border-color: rgba(255, 95, 87, 0.25); }
.danger-zone .section-title { margin-bottom: 6px; }
.danger-zone__row { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); }
.danger-zone__row:first-of-type { border-top: 0; }
.danger-zone__row p { font-size: 13.5px; margin-top: 4px; max-width: 560px; }
.danger-zone__row form { flex-shrink: 0; }
@media (max-width: 640px) { .danger-zone__row { flex-direction: column; align-items: stretch; } }

/* ---------- Editor de linhas dinâmicas ---------- */
.rows { display: grid; gap: 8px; }
.rows__item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; }
.rows__item--etapa { grid-template-columns: 22px 1fr 120px auto; }
.rows__item--prazo { grid-template-columns: 22px 1fr 170px auto auto; }
.rows__handle { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); text-align: center; }

/* ---------- Animações de entrada ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.reveal { animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-main, .detail-grid, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform 0.35s var(--ease); }
  .sidebar.is-open { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.6); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 35; display: none; }
  .sidebar.is-open + .sidebar-backdrop { display: block; }
  .topbar { padding: 12px 16px; }
  .topbar .topbar__menu { display: inline-flex; }
  .content { padding: 22px 16px 60px; }
  .login { grid-template-columns: 1fr; }
  .login__art { min-height: 300px; padding: 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login__mark { width: 260px; right: -40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(3, minmax(260px, 86vw)); scroll-snap-type: x mandatory; }
  .board__col { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 16px 16px; }
  .kpi__value { font-size: 28px; }
  .kpi:first-child { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .svc__row { grid-template-columns: 1fr; }
  .svc__actions, .svc__done { justify-content: flex-start; text-align: left; }
  .svc__actions .btn { flex: 1; }
  .fail-fields .row { grid-template-columns: 1fr; }
  .conf-hero { grid-template-columns: 1fr; }
  .cycle-nav { justify-content: space-between; }
  .hide-sm { display: none; }
  .page-head { margin-bottom: 20px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .rows__item--etapa, .rows__item--prazo { grid-template-columns: 22px 1fr auto; }
  .rows__item--etapa > :nth-child(3), .rows__item--prazo > :nth-child(3) { grid-column: 2; }
  .contract { grid-template-columns: 1fr; }
}

/* ==========================================================================
   TEMA CLARO — "papel técnico"
   Fundo branco-azulado com a grade de pontos da marca em azul, tinta quase
   preta e o azul RSG como cor de destaque. Brilhos viram sombras suaves e os
   status ganham tons mais escuros para manter contraste AA sobre o branco.
   Os painéis de destaque (KPI principal, progresso da conferência, arte do
   login) ficam em azul RSG sólido — a assinatura da marca no modo claro.
   ========================================================================== */
:root[data-theme="light"] {
  --bg: #f3f4fa;
  --bg-2: #ffffff;
  --bg-3: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --surface-3: #e2e5f3;
  --line: rgba(14, 16, 54, 0.09);
  --line-strong: rgba(14, 16, 54, 0.16);

  --blue: #2323ff;
  --blue-bright: #2d38f5;
  --cyan: #0081a7;

  --text: #0b0c24;
  --muted: #535875;
  --muted-2: #868aa3;

  --ok: #0c9466;
  --ok-bg: rgba(12, 148, 102, 0.1);
  --parcial: #b06a00;
  --parcial-bg: rgba(240, 160, 0, 0.15);
  --falha: #d9362c;
  --falha-bg: rgba(217, 54, 44, 0.09);
  --critica: #d10f47;

  --grad: linear-gradient(120deg, #2323ff 0%, #0094c7 100%);

  --pink: #cc2f68;
  --violet: #7e3bd0;
  --indigo-soft: #333ed6;
  --on-grad: #ffffff;
  --on-ok: #ffffff;
  --ok-hover: #0a7f58;
  --field: #ffffff;
  --field-focus: #ffffff;
  --inset: #f7f8fd;
  --quote: #f6f7fc;
  --hover-line: rgba(14, 16, 54, 0.3);
  --row-hover: rgba(35, 35, 255, 0.035);
  --col-bg: rgba(14, 16, 54, 0.03);
  --ring: rgba(14, 16, 54, 0.2);
  --dot-grid: rgba(35, 35, 255, 0.14);
  --dot-grid-strong: rgba(255, 255, 255, 0.22);
  --sidebar-bg: linear-gradient(180deg, #ffffff, #f8f9fe);
  --topbar-bg: rgba(243, 244, 250, 0.82);
  --toast-bg: rgba(255, 255, 255, 0.98);
  --overlay: rgba(16, 18, 52, 0.32);
  --glow-blue: rgba(35, 35, 255, 0.13);
  --glow-cyan: rgba(0, 190, 255, 0.1);
  --shadow: 0 24px 60px -18px rgba(14, 16, 54, 0.28);
  --card-shadow: 0 1px 2px rgba(14, 16, 54, 0.04), 0 10px 28px -16px rgba(14, 16, 54, 0.16);
  --hero-bg: linear-gradient(135deg, #2323ff 0%, #1b4dff 60%, #0a8fd8 140%);
  --conf-hero-bg: linear-gradient(120deg, #2323ff 0%, #1b4dff 55%, #0a8fd8 130%);
  --hero-line: transparent;
  --hero-dots: rgba(255, 255, 255, 0.28);
  --meter-glow: none;
  color-scheme: light;
}

[data-theme="light"] input[type="date"].input { color-scheme: light; }
[data-theme="light"] .bg-glow { opacity: 0.9; }
[data-theme="light"] .brand__mark { filter: drop-shadow(0 2px 6px rgba(35, 35, 255, 0.35)); }
[data-theme="light"] .sidebar { backdrop-filter: none; }

/* navegação */
[data-theme="light"] .nav a.is-active { background: rgba(35, 35, 255, 0.07); color: var(--blue); }
[data-theme="light"] .nav a.is-active .icon { color: var(--blue); }
[data-theme="light"] .nav a.is-active::before { background: var(--blue); box-shadow: none; }
[data-theme="light"] .nav__count--pendente { background: rgba(35, 35, 255, 0.1); }
[data-theme="light"] .nav__count--alerta { color: #fff; }
[data-theme="light"] .sidebar__user { background: var(--surface-2); border-color: transparent; }

/* brilhos -> nitidez */
[data-theme="light"] .dot--ok, [data-theme="light"] .dot--parcial, [data-theme="light"] .dot--falha { box-shadow: none; }
[data-theme="light"] .dot--critica { box-shadow: 0 0 0 3px rgba(209, 15, 71, 0.15); }
[data-theme="light"] .badge--prioridade-critica { box-shadow: 0 4px 12px -4px rgba(209, 15, 71, 0.5); }
[data-theme="light"] .badge--prioridade-baixa { background: rgba(35, 35, 255, 0.09); }
[data-theme="light"] .badge--origem-conferencia { background: rgba(0, 129, 167, 0.1); }
[data-theme="light"] .cat-chip { color: color-mix(in srgb, var(--c) 55%, #0b0c24); font-weight: 600; }
[data-theme="light"] .cat-chip::before { box-shadow: none; }
[data-theme="light"] .btn--primary { background: var(--grad-btn); box-shadow: 0 8px 20px -8px rgba(35, 35, 255, 0.55); }
[data-theme="light"] .btn--primary:hover { box-shadow: 0 10px 24px -8px rgba(0, 110, 255, 0.6); }
[data-theme="light"] .btn--ok:hover { box-shadow: 0 8px 20px -8px rgba(12, 148, 102, 0.55); }
[data-theme="light"] .btn--danger { background: var(--falha-bg); }
[data-theme="light"] .segmented a.is-active, [data-theme="light"] .segmented label:has(input:checked) { background: var(--bg-2); box-shadow: 0 1px 3px rgba(14, 16, 54, 0.14); }
[data-theme="light"] .segmented { background: var(--surface-2); border-color: transparent; }
[data-theme="light"] .switch input::after { background: #fff; box-shadow: 0 1px 2px rgba(14, 16, 54, 0.3); }
[data-theme="light"] .switch input { background: var(--surface-3); }

/* painéis de destaque em azul RSG sólido */
[data-theme="light"] .kpi--hero,
[data-theme="light"] .conf-hero { color: #fff; box-shadow: 0 18px 40px -18px rgba(35, 35, 255, 0.65); }
[data-theme="light"] .kpi--hero .kpi__label,
[data-theme="light"] .kpi--hero .kpi__foot,
[data-theme="light"] .conf-hero .conf-hero__label,
[data-theme="light"] .conf-hero .conf-hero__of,
[data-theme="light"] .conf-hero .muted { color: rgba(255, 255, 255, 0.78); }
[data-theme="light"] .kpi--hero .kpi__foot b,
[data-theme="light"] .kpi--hero .kpi__value small { color: #fff; }
[data-theme="light"] .kpi--hero .meter,
[data-theme="light"] .conf-hero .meter { background: rgba(255, 255, 255, 0.22); }
[data-theme="light"] .kpi--hero .meter > span,
[data-theme="light"] .conf-hero .meter > span { background: #fff; }
[data-theme="light"] .conf-hero .grad-text { background: none; color: #fff; -webkit-background-clip: border-box; background-clip: border-box; }
[data-theme="light"] .conf-hero .btn { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
[data-theme="light"] .conf-hero .btn:hover { background: rgba(255, 255, 255, 0.24); }
[data-theme="light"] a.kpi--hero:hover { border-color: transparent; }

/* medidores e mapa */
[data-theme="light"] .heat__cell.r-ok i { background: var(--blue); box-shadow: none; }
[data-theme="light"] .heat__cell.r-ok.link-next::after { background: var(--blue); opacity: 1; }
[data-theme="light"] .heat__cell.r-parcial i { background: #f0a000; box-shadow: none; }
[data-theme="light"] .heat__cell.r-falha i { box-shadow: 0 0 0 4px rgba(217, 54, 44, 0.14); }
[data-theme="light"] .heat__cell.is-now i { border-color: rgba(0, 129, 167, 0.6); }
[data-theme="light"] .heat__legend .l-ok { background: var(--blue); }
[data-theme="light"] .heat__legend .l-parcial { background: #f0a000; }

/* conferência */
[data-theme="light"] .svc { background: var(--surface); box-shadow: var(--card-shadow); }
[data-theme="light"] .svc.is-ok { background: linear-gradient(90deg, rgba(12, 148, 102, 0.07), transparent 45%), var(--surface); }
[data-theme="light"] .svc.is-falha { background: linear-gradient(90deg, rgba(217, 54, 44, 0.07), transparent 45%), var(--surface); }
[data-theme="light"] .check input { background: #fff; }
[data-theme="light"] .step__dot { background: #fff; }
[data-theme="light"] .step.is-done .step__dot { background: var(--blue); border-color: var(--blue); box-shadow: 0 3px 8px -2px rgba(35, 35, 255, 0.5); }
[data-theme="light"] .step.is-done::before { background: var(--blue); }

/* alertas */
[data-theme="light"] .acard { background: var(--surface); box-shadow: 0 1px 2px rgba(14, 16, 54, 0.05); }
[data-theme="light"] .acard:hover { box-shadow: var(--card-shadow); }
[data-theme="light"] .acard--critica { border-color: rgba(209, 15, 71, 0.3); box-shadow: 0 10px 24px -14px rgba(209, 15, 71, 0.55); }
[data-theme="light"] .board__col { border-color: transparent; }
[data-theme="light"] .client-hero__mono { box-shadow: 0 12px 28px -12px rgba(35, 35, 255, 0.6); }

/* toasts, modais, flashes */
[data-theme="light"] .toast { border-color: var(--line); }
[data-theme="light"] .modal__box { border-color: transparent; }
[data-theme="light"] .flash { background: var(--surface); }
[data-theme="light"] .flash--sucesso { background: var(--ok-bg); }
[data-theme="light"] .flash--erro { background: var(--falha-bg); }
[data-theme="light"] .flash--aviso { background: var(--parcial-bg); }

/* login: arte em azul RSG, formulário em papel */
[data-theme="light"] .login__art { background: linear-gradient(150deg, #1717e8 0%, #2323ff 45%, #0a7fd6 120%); border-right: 0; color: #fff; }
[data-theme="light"] .login__glow { background: radial-gradient(closest-side, rgba(0, 229, 255, 0.35), transparent); }
[data-theme="light"] .login__mark { filter: brightness(0) invert(1); opacity: 0.16; }
[data-theme="light"] .login__art .brand__mark { filter: brightness(0) invert(1); }
[data-theme="light"] .login__art .brand__word em { color: #a9f1ff; }
[data-theme="light"] .login__headline span { background: linear-gradient(120deg, #bdf6ff, #6fe6ff); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .login__foot { color: rgba(255, 255, 255, 0.7); }
[data-theme="light"] .login__foot i { color: #a9f1ff; }

/* erro */
[data-theme="light"] .error-page pre { background: var(--surface-2); }

/* ---------- Seletor de tema ---------- */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), fill 0.4s !important;
}
.theme-toggle .icon--sol { display: none; }
[data-theme="light"] .theme-toggle .icon--lua { display: none; }
[data-theme="light"] .theme-toggle .icon--sol { display: block; }
.theme-float { position: fixed; top: 18px; right: 18px; z-index: 50; }
.theme-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-choice label { cursor: pointer; }
.theme-choice input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choice__card {
  display: block; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); padding: 10px; transition: border-color 0.2s, box-shadow 0.2s;
}
.theme-choice input:checked + .theme-choice__card { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 35, 255, 0.18); }
.theme-choice input:focus-visible + .theme-choice__card { outline: 2px solid var(--cyan); outline-offset: 2px; }
.theme-choice__preview { display: block; height: 64px; border-radius: 8px; margin-bottom: 10px; position: relative; overflow: hidden; border: 1px solid var(--line); }
.theme-choice__preview::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 28%; }
.theme-choice__preview::after { content: ""; position: absolute; left: 36%; top: 14px; width: 40%; height: 14px; border-radius: 4px; box-shadow: 0 22px 0 -2px var(--pv-line); }
.pv-escuro { background: #04040b; --pv-line: #1b1b2e; }
.pv-escuro::before { background: #0b0b18; }
.pv-escuro::after { background: #2323ff; }
.pv-claro { background: #f3f4fa; --pv-line: #dfe2f0; }
.pv-claro::before { background: #fff; }
.pv-claro::after { background: #2323ff; }
.pv-sistema { background: linear-gradient(115deg, #f3f4fa 50%, #04040b 50%); --pv-line: #8a8fa8; }
.pv-sistema::before { background: linear-gradient(115deg, #fff 50%, #0b0b18 50%); }
.pv-sistema::after { background: #2323ff; }
.theme-choice__label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.theme-choice__label .icon { width: 16px; height: 16px; color: var(--muted); }

/* ---------- Impressão (relatórios) ---------- */
@media print {
  :root { --text: #111; --muted: #555; --muted-2: #777; --line: #ddd; --line-strong: #bbb; --surface: #fff; --surface-2: #f4f4f4; }
  body { background: #fff; color: #111; font-size: 12px; }
  .sidebar, .topbar, .bg-dots, .bg-glow, .no-print, .toasts, .flashes { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .kpi { border: 1px solid #ddd; background: #fff; break-inside: avoid; }
  .kpi--hero { background: #fff; }
  .grad-text, .login__headline span { color: #2323ff; background: none; }
  .table td, .table th { padding: 6px 8px; }
  .meter > span { box-shadow: none; }
  a { color: inherit; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
