/* ============================================================
   PAINEL CESTA — tema "Despensa editorial"
   Identidade própria sobre os tokens Emtel: verde-folha + papel
   creme quente + Fraunces (display serifado). Carregado DEPOIS de
   emtel-tokens.css e dashboard.css — sobrepõe o acento azul herdado.
   ============================================================ */

/* reset de box model — o login não carrega mais o login.css do fiscal (que
   trazia este reset); sem ele, width + padding estouram a largura e desalinham */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Fraunces self-hosted (variável: opsz 9-144, wght 100-900) — sem CDN,
   funciona offline na VM interna. Licença: static/fonts/Fraunces-OFL.txt */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces-var.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.cbrand-word,
.ctitle,
.ccard-title,
.clock-title,
.cstep-dot,
.ctile-num,
.login-side .pitch h1,
.login-card h2,
.ccard h3 {
  font-optical-sizing: auto;
}

:root,
:root[data-theme="light"] {
  --cesta-green: #1F7A4D;
  /* acento principal — verde-folha institucional */
  --cesta-green-deep: #143D29;
  --cesta-green-mid: #2E9E63;
  --cesta-green-bright: #46C07E;
  --cesta-green-wash: #E7F3EA;
  --cesta-cream: #FAF8F1;
  /* papel quente */
  --cesta-cream-2: #F2EEE2;
  --cesta-line: #E4DECF;
  /* bordas quentes */
  --cesta-amber: #C8842B;
  /* acento secundário (trigo) */
  --cesta-ink: #23291F;
  /* texto — verde-quase-preto, não azul */

  /* Painel inteiro na fonte do design system (Noto Sans). Antes os títulos usavam
     Fraunces; unificado a pedido do Kauã (2026-06-23). O @font-face do Fraunces acima
     fica inerte (browser só baixa a fonte se alguém referenciar 'Fraunces'). */
  --font-display: var(--font-family);

  /* Remapeia os semânticos do design system para a paleta da cesta */
  --bg-page: #F2F4F8;
  /* branco frio Emtel */
  --bg-surface: #FFFFFF;
  --bg-surface-2: #E9ECF2;
  --bg-wash: var(--cesta-green-wash);
  --bg-input: #FFFFFF;

  --fg-heading: var(--cesta-green-deep);
  --fg-body: var(--cesta-ink);
  --fg-muted: #7C7869;

  --border: var(--cesta-line);
  --border-strong: #D8D0BC;
  --hover-row: var(--cesta-green-wash);

  --state-info: var(--cesta-green);
  --state-info-bg: var(--cesta-green-wash);

  --shadow-sm: 0 1px 2px rgba(31, 61, 41, 0.06), 0 1px 3px rgba(31, 61, 41, 0.05);
  --shadow-md: 0 6px 18px rgba(31, 61, 41, 0.10), 0 2px 6px rgba(31, 61, 41, 0.06);
  --shadow-lg: 0 18px 48px rgba(31, 61, 41, 0.16), 0 6px 16px rgba(31, 61, 41, 0.08);

  --scrollbar-thumb: rgba(31, 61, 41, 0.24);
  --scrollbar-thumb-hover: rgba(31, 61, 41, 0.44);

  /* Remapeia o ramp azul herdado → verde, p/ telas que usam os tokens crus
     diretamente (login, solicitar-acesso) ficarem coerentes sem editar login.css */
  --color-blue-primary: var(--cesta-green);
  --color-blue-dark: var(--cesta-green-deep);
  --color-blue-mid: var(--cesta-green-mid);
  --color-blue-light: var(--cesta-green-bright);
  --color-blue-wash: var(--cesta-green-wash);
  --topbar-bg: var(--cesta-green-deep);
}

/* headline das telas de auth (login/solicitar) ganha o display serifado */
.login-side .pitch h1,
.login-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ===== Auth (login / solicitar) — coluna única editorial, igual à home ===== */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}

.auth-shell>* {
  position: relative;
  z-index: 1;
}

/* moldura de largura fixa — card e footer compartilham a MESMA régua/centro */
.auth-frame {
  width: min(412px, 100%);
  display: flex;
  flex-direction: column;
}

.auth-watermark {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: min(620px, 92vw);
  height: auto;
  right: -120px;
  bottom: -140px;
  transform: rotate(-6deg);
  color: var(--cesta-green-mid);
  /* marca de pessoas em azul Emtel (palette fixa) */
  opacity: .10;
  filter: saturate(.7);
}

/* fundo do login/auth: brilho azul Emtel suave atrás do card (evita branco chapado) */
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 50% 30%,
      color-mix(in srgb, var(--cesta-green-mid) 18%, transparent), transparent 70%),
    radial-gradient(42% 52% at 90% 102%,
      color-mix(in srgb, var(--cesta-amber) 9%, transparent), transparent 70%);
}

.auth-card {
  position: relative;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8) var(--space-8);
  box-shadow: var(--shadow-lg);
  animation: cfade .5s var(--ease-out) both;
}

/* fio verde→âmbar no topo do card (assinatura da marca) */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-8);
  right: var(--space-8);
  height: 4px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: linear-gradient(90deg, var(--cesta-green-mid), var(--cesta-amber));
}

.auth-logo {
  width: 196px;
  max-width: 66%;
  height: auto;
  display: block;
  margin: 0 0 var(--space-6);
}

.auth-eyebrow {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cesta-green-mid);
  margin: 0 0 var(--space-2);
}

.auth-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg-heading);
  margin: 0 0 var(--space-6);
}

.auth-form .cfield {
  margin-bottom: var(--space-4);
}

.auth-form .cbtn {
  width: 100%;
  margin-top: var(--space-2);
  justify-content: center;
}

.auth-hint {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin: calc(var(--space-1) * -1) 0 var(--space-4);
}

.auth-alt {
  margin: var(--space-5) 0 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.auth-alt a {
  color: var(--cesta-green);
  font-weight: 700;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.auth-foot {
  width: 100%;
  margin: var(--space-6) 0 0;
  text-align: center;
  font-size: var(--text-xs);
  letter-spacing: .06em;
  color: var(--fg-muted);
}

.auth-ok {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--state-ok-bg);
  color: var(--state-ok);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

/* Botão "Entrar com a Microsoft" (login principal) */
.btn-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: #fff;
  color: #3b3a39;
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid #d0d0cf;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-ms:hover {
  border-color: #9a9a99;
  box-shadow: var(--shadow-sm);
}

.btn-ms svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ===== Login — override do split azul-fiscal → editorial verde ===== */
.login-side {
  background: linear-gradient(158deg, var(--cesta-green-mid) 0%, var(--cesta-green-deep) 90%) !important;
  position: relative;
  overflow: hidden;
}

/* trama de pontos + brilho radial p/ profundidade */
.login-side::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(255, 255, 255, 0.10), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: auto, 22px 22px;
}

.login-side>* {
  position: relative;
  z-index: 1;
}

.login-side .logo {
  height: 34px;
  opacity: .95;
}

.login-side .pitch {
  display: flex;
  flex-direction: column;
}

.login-side .pitch-mark {
  width: 92px;
  height: 92px;
  margin-bottom: var(--space-6);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.login-side .pitch h1 {
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.05;
}

.login-side .pitch p {
  font-weight: 400;
  opacity: .9;
}

.login-side footer {
  letter-spacing: .06em;
}

/* card do formulário — papel quente + emblema no lugar do wordmark azul */
.login-form {
  background: var(--bg-page);
}

.login-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg);
}

.login-card .login-mark {
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-5);
}

.login-card .login-wordmark {
  width: 210px;
  max-width: 70%;
  height: auto;
  margin-bottom: var(--space-5);
  display: block;
}

.login-card h2 {
  font-weight: 600;
  font-size: var(--text-xl);
}

.form-row input:focus {
  border-color: var(--cesta-green-mid) !important;
  box-shadow: 0 0 0 4px var(--cesta-green-wash) !important;
}

/* topbar: emblema cesta+trigo dentro do badge verde (creme lê bem sobre verde) */
.cbrand-mark {
  width: 40px;
  height: 40px;
  padding: 5px;
}

.cbrand-mark img,
.cbrand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

:root[data-theme="dark"] {
  --cesta-green: #5BD394;
  --cesta-green-deep: #0E2A1B;
  --cesta-green-mid: #46C07E;
  --cesta-green-bright: #7BE3AC;
  --cesta-green-wash: rgba(91, 211, 148, 0.12);
  --cesta-cream: #11150F;
  /* "papel" escuro com toque verde */
  --cesta-cream-2: #181E14;
  --cesta-line: #2A3322;
  --cesta-amber: #E0A653;
  --cesta-ink: #E8EFE2;

  --bg-page: var(--cesta-cream);
  --bg-surface: #181E14;
  --bg-surface-2: #1F271A;
  --bg-wash: var(--cesta-green-wash);
  --bg-input: #11150F;

  --fg-heading: #F2F8EE;
  --fg-body: var(--cesta-ink);
  --fg-muted: #93A088;

  --border: var(--cesta-line);
  --border-strong: #36422C;
  --hover-row: rgba(91, 211, 148, 0.10);

  --state-info: var(--cesta-green);
  --state-info-bg: var(--cesta-green-wash);
}

/* ===== Base ===== */
.cesta-body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg-body);
  font-family: var(--font-family);
  min-height: 100vh;
  /* atmosfera: wash radial frio bem sutil no topo, some pro branco Emtel */
  background-image:
    radial-gradient(120% 80% at 85% -10%, color-mix(in srgb, var(--cesta-green-mid) 5%, transparent), transparent 60%);
  background-attachment: fixed;
}

/* textura sutil de grão/pontos sobre o papel */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--cesta-green-deep) 5%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}

:root[data-theme="dark"] .paper-grain {
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  opacity: .6;
}

/* Marca d'água temática — "rede de gente" (Gente & Cultura).
   Mesma família gravada/guilhoché do painel de faturamento, mas o motivo
   remete a pessoas conectadas. O SVG é só a forma (mask); a cor vem do
   accent da página, então acompanha tema e paleta automaticamente. */
.dp-weave {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: color-mix(in srgb, var(--cesta-green-deep) 22%, transparent);
  -webkit-mask: url("../img/pattern-gente-cultura.svg") 0 0 / 300px 300px repeat;
  mask: url("../img/pattern-gente-cultura.svg") 0 0 / 300px 300px repeat;
  opacity: .22;
}

:root[data-theme="dark"] .dp-weave {
  background: rgba(255, 255, 255, 0.07);
  opacity: .32;
}

/* ===== Topbar — azul institucional Emtel ===== */
.ctopbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(118deg, #16325B 0%, #1A56AB 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 12px rgba(13, 33, 64, 0.22);
}

/* três zonas: marca (esquerda) · nav (centro) · ações (direita) */
.cbrand {
  flex: 1 0 auto;
}

.ctopbar-right {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.cbrand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: #fff;
}

.cbrand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.cbrand-divider {
  width: 1px;
  height: 40px;
  flex: none;
  background: rgba(255, 255, 255, 0.24);
}

.cbrand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

.cbrand-word {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #fff;
}

.cbrand-word small {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.70);
  margin-top: 4px;
}

.ctopnav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ctopnav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.80);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.ctopnav-link .nav-ico {
  width: 17px;
  height: 17px;
  flex: none;
}

.ctopnav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.ctopnav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.20);
}

/* rótulo da área atual (não-clicável) — separa "Início" dos menus da área */
.ctopnav-area {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  padding-left: var(--space-3);
  margin-left: var(--space-1);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.cbadge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--cesta-amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.cicon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.cicon-btn:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* toggle de tema: lua no claro, sol no escuro */
.tg-ico {
  display: block;
}

.tg-sun {
  display: none;
}

:root[data-theme="dark"] .tg-moon {
  display: none;
}

:root[data-theme="dark"] .tg-sun {
  display: block;
}

/* foco por teclado visível sobre o azul da topbar */
.ctopbar a:focus-visible,
.ctopbar button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: var(--radius-pill);
}

.cuser {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cuser-avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.cuser-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cuser-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: #fff;
}

.cuser-out {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.cuser-out:hover {
  color: #fff;
  border-color: #fff;
}

.cburger {
  display: none;
}

/* ===== Página ===== */
.cpage {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-12);
}

/* página larga (conferência): cabe a tabela de 8 colunas sem scroll lateral */
.cpage.is-wide {
  max-width: min(1340px, 96vw);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

/* tabela mais compacta na página larga — todos os campos visíveis */
.cpage.is-wide .ctable { font-size: 13px; }
.cpage.is-wide .ctable thead th { padding: var(--space-2) var(--space-3); }
.cpage.is-wide .ctable tbody td { padding: var(--space-2) var(--space-3); }
.cpage.is-wide .covr { font-size: 12px; gap: 5px; }
.cpage.is-wide .covr input[type="checkbox"] { width: 14px; height: 14px; }

.ceyebrow {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cesta-green-mid);
  margin: 0 0 var(--space-2);
}

.ctitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--fg-heading);
  margin: 0;
}

.csub {
  color: var(--fg-muted);
  font-size: var(--text-md);
  margin: var(--space-3) 0 0;
  max-width: 56ch;
}

/* ===== Stepper ===== */
.cstepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: var(--space-10) 0 var(--space-8);
}

.cstep {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

/* fio de ligação entre passos */
.cstep::before,
.cstep::after {
  content: "";
  position: absolute;
  top: 27px;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.cstep::before {
  left: 0;
  right: 50%;
}

.cstep::after {
  left: 50%;
  right: 0;
}

.cstep:first-child::before {
  display: none;
}

.cstep:last-child::after {
  display: none;
}

/* trechos preenchidos */
.cstep.is-done::before,
.cstep.is-done::after,
.cstep.is-current::before {
  background: var(--cesta-green-mid);
}

.cstep-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 3px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--fg-muted);
  transition: all var(--transition-base) var(--ease-spring);
}

.cstep.is-current .cstep-dot {
  border-color: var(--cesta-green-mid);
  color: var(--cesta-green-deep);
  box-shadow: 0 0 0 6px var(--cesta-green-wash);
  transform: scale(1.06);
}

.cstep.is-done .cstep-dot {
  background: var(--cesta-green-mid);
  border-color: var(--cesta-green-mid);
  color: #fff;
}

:root[data-theme="dark"] .cstep.is-current .cstep-dot {
  color: var(--cesta-green-bright);
}

:root[data-theme="dark"] .cstep.is-done .cstep-dot {
  color: var(--cesta-green-deep);
}

.cstep-label {
  margin-top: var(--space-3);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.cstep.is-current .cstep-label,
.cstep.is-done .cstep-label {
  color: var(--fg-heading);
}

/* ===== Painéis de passo ===== */
.cpanel {
  display: none;
  animation: cfade .4s var(--ease-out) both;
}

.cpanel.is-active {
  display: block;
}

@keyframes cfade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ccard {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.ccard+.ccard {
  margin-top: var(--space-5);
}

.ccard-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--fg-heading);
  margin: 0 0 var(--space-2);
}

.ccard-hint {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-6);
}

/* campos */
.cfield {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cfield label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--fg-muted);
}

.cinput {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--fg-body);
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cinput:focus {
  outline: none;
  border-color: var(--cesta-green-mid);
  box-shadow: 0 0 0 4px var(--cesta-green-wash);
}

.cgrid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* botões */
.cbtn {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--fg-body);
  cursor: pointer;
  transition: all var(--transition-fast) var(--ease-out);
}

.cbtn:hover:not(:disabled) {
  border-color: var(--cesta-green-mid);
  transform: translateY(-1px);
}

.cbtn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--cesta-green-mid), var(--cesta-green-deep));
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .cbtn-primary {
  color: var(--cesta-green-deep);
  background: linear-gradient(135deg, var(--cesta-green-bright), var(--cesta-green-mid));
}

.cbtn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.cbtn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.cactions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.cactions .cspacer {
  flex: 1;
}

/* ===== Tiles de resumo ===== */
.ctiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.ctile {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

/* toggle switch (permissões na tabela de admin) — estilo hub, paleta verde */
.toggle { display: inline-block; position: relative; cursor: pointer; vertical-align: middle; }
.toggle input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  display: inline-block;
  width: 38px;
  height: 20px;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background var(--transition-fast);
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.toggle input:checked + .toggle-track { background: var(--cesta-green-mid); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--cesta-green-wash); }

/* avatar do usuário na tabela de admin */
.cusr-cell { display: inline-flex; align-items: center; gap: 9px; }
.cusr-foto {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--cesta-green-mid);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.cusr-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* KPI clicável (filtra a tabela na conferência; leva pra ela na visão geral) */
button.ctile, a.ctile.is-clicavel {
  font: inherit;
  text-align: left;
  width: 100%;
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

button.ctile:hover, a.ctile.is-clicavel:hover {
  border-color: var(--cesta-green-mid);
  transform: translateY(-2px);
}

.ctile.is-active {
  border-color: var(--cesta-green-mid);
  box-shadow: 0 0 0 2px var(--cesta-green-wash);
}

.ctile-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 38px;
  line-height: 1;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
}

.ctile-num.is-ok {
  color: var(--state-ok);
}

.ctile-num.is-bad {
  color: var(--state-danger);
}

.ctile-num.is-warn {
  color: var(--cesta-amber);
}

.ctile-cap {
  margin-top: var(--space-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--fg-muted);
  font-weight: 700;
}

/* ===== Tabela ===== */
.ctable-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: 72vh;
}

.ctable {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ctable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  white-space: nowrap;
  padding: var(--space-3) var(--space-4);
  background: var(--cesta-green-deep);
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

:root[data-theme="dark"] .ctable thead th {
  background: #20281A;
  color: var(--cesta-green-bright);
}

/* cabeçalho clicável p/ ordenar */
.ctable thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.ctable thead th[data-sort]::after {
  content: '↕';
  margin-left: 6px;
  opacity: .35;
  font-weight: 400;
}

.ctable thead th[data-sort].is-asc::after { content: '↑'; opacity: 1; }
.ctable thead th[data-sort].is-desc::after { content: '↓'; opacity: 1; }

.ctable thead th[data-sort]:hover { background: var(--cesta-green-mid); }

.ctable tbody td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}

/* zebra — listra par com um creme/verde bem sutil (antes do hover p/ não cobri-lo) */
.ctable tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--cesta-green-deep) 4%, transparent);
}

.ctable tbody tr:hover {
  background: var(--hover-row);
}

.cmat {
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}

.cpill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.cpill.ok {
  background: var(--state-ok-bg);
  color: var(--state-ok);
}

.cpill.bad {
  background: var(--state-danger-bg);
  color: var(--state-danger);
}

/* ===== Ajustes manuais (override) na conferência ===== */
.covr-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.covr-busca {
  max-width: 280px;
}

.covr-only {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
}

.covr-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cesta-green-mid);
  white-space: nowrap;
}

/* checkbox-label por linha */
.covr {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cesta-green);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.covr.covr-epi {
  color: var(--cesta-amber);
}

.covr input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cesta-green-mid);
  cursor: pointer;
}

.covr.covr-epi input[type="checkbox"] {
  accent-color: var(--cesta-amber);
}

/* tag "ajustado" ao lado do status efetivo */
.covr-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--cesta-amber) 18%, transparent);
  color: var(--cesta-amber);
  vertical-align: middle;
}

.ctable tbody tr.is-ajustado {
  background: color-mix(in srgb, var(--cesta-amber) 7%, transparent);
}

.ctable tbody tr.is-ajustado:hover {
  background: color-mix(in srgb, var(--cesta-amber) 12%, transparent);
}

.covr-confirma {
  margin: var(--space-4) 0;
  font-size: var(--text-md);
}

/* aviso do teste de envio (Theo real x mock) */
.ctest-aviso {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.ctest-aviso.is-real {
  border-color: color-mix(in srgb, var(--cesta-amber) 55%, var(--border));
  background: color-mix(in srgb, var(--cesta-amber) 10%, transparent);
}

.ctest-aviso.is-mock {
  color: var(--fg-muted);
  background: var(--bg-surface-2);
}

.ctest-aviso code {
  font-family: ui-monospace, monospace;
  font-size: .9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--fg-body) 8%, transparent);
}

/* seletor de modelo da mensagem (cards de rádio) */
.cfield-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-body);
  margin-bottom: var(--space-2);
}

.ctest-modelos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.ctest-modelo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  cursor: pointer;
  font: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.ctest-modelo:hover {
  border-color: var(--cesta-green-mid);
  transform: translateY(-2px);
}

.ctest-modelo.is-active {
  border-color: var(--cesta-green-mid);
  background: var(--cesta-green-wash);
  box-shadow: 0 0 0 2px var(--cesta-green-wash);
}

.ctest-modelo-ic { font-size: 22px; line-height: 1; }
.ctest-modelo-t { font-weight: 700; color: var(--fg-heading); }
.ctest-modelo-d { font-size: var(--text-xs); color: var(--fg-muted); }

/* chips de motivo (radio em pílulas) */
.ctest-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.ctest-chip {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--fg-body);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.ctest-chip:hover { border-color: var(--cesta-green-mid); }

.ctest-chip.is-active {
  background: var(--cesta-green-mid);
  border-color: var(--cesta-green-mid);
  color: #fff;
}

/* relatório do disparo / simulação */
.covr-rel {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-2);
}

.covr-rel.is-loading { color: var(--fg-muted); }
.covr-rel.is-sim { border-color: color-mix(in srgb, var(--cesta-amber) 45%, var(--border)); }
.covr-rel.is-ok  { border-color: var(--cesta-green-mid); }
.covr-rel.is-erro {
  border-color: var(--state-danger);
  background: var(--state-danger-bg);
  color: var(--state-danger);
}

.covr-rel-h {
  font-weight: 700;
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
  color: var(--fg-heading);
}

.covr-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.covr-rel-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.covr-rel-num {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--cesta-green-deep);
  font-variant-numeric: tabular-nums;
}

.covr-rel-cap {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ===== Dashboard (panorama) ===== */
.cfilter {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  flex-wrap: wrap;
  margin: var(--space-6) 0;
}

.cdemo-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: var(--space-3);
  background: var(--state-warn-bg);
  color: var(--state-warn);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.cdash-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

/* donut */
.cdonut-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.cdonut-holder {
  position: relative;
  flex-shrink: 0;
}

.cdonut {
  width: 150px;
  height: 150px;
  display: block;
}

.cdonut circle {
  transition: stroke-dasharray .6s var(--ease-out);
}

.cdonut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.cdonut-center strong {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 30px;
  line-height: 1;
  color: var(--fg-heading);
}

.cdonut-center span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--fg-muted);
  margin-top: 2px;
}

.clegend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.clegend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-body);
}

.clegend-item strong {
  color: var(--fg-heading);
  font-variant-numeric: tabular-nums;
}

.cdot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* barras horizontais */
.cbars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cbar {
  display: grid;
  grid-template-columns: 120px 1fr 38px;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.cbar-label {
  color: var(--fg-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cbar-track {
  height: 14px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.cbar-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  width: 0;
  background: linear-gradient(90deg, var(--cesta-green-mid), var(--cesta-green-deep));
  transition: width .6s var(--ease-out);
}

.cbar-fill.amber {
  background: linear-gradient(90deg, var(--cesta-amber), #9C6418);
}

.cbar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--fg-heading);
}

@media (max-width: 720px) {
  .cdash-grid {
    grid-template-columns: 1fr;
  }

  .cdonut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .cbar {
    grid-template-columns: 96px 1fr 34px;
  }
}

/* ===== Avisos / gate ===== */
.cnote {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  border: 1px solid;
  margin-bottom: var(--space-5);
}

.cnote-warn {
  background: var(--state-warn-bg);
  border-color: color-mix(in srgb, var(--state-warn) 35%, transparent);
  color: var(--fg-body);
}

.cnote-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.cnote strong {
  color: var(--state-warn);
}

.clock-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-10);
  border-radius: var(--radius-xl);
  background: var(--bg-surface-2);
  border: 2px dashed var(--border-strong);
}

.clock-emoji {
  font-size: 40px;
}

.clock-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--fg-heading);
  margin: 0;
}

.cerror {
  background: var(--state-danger-bg);
  color: var(--state-danger);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.cmuted {
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

/* ===== Reaproveitado por admin/alterar-senha (extends base) ===== */
.ccard h3 {
  font-family: var(--font-display);
}

/* ===== Responsivo ===== */
@media (max-width: 720px) {
  .cgrid-3 {
    grid-template-columns: 1fr;
  }

  .ctiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .cstep-label {
    font-size: 12px;
  }

  .cuser-name {
    display: none;
  }

  .cburger {
    display: grid;
  }

  .ctopnav {
    position: absolute;
    top: 100%;
    right: var(--space-4);
    flex-direction: column;
    align-items: stretch;
    background: #1A56AB;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 200px;
  }

  .ctopnav.is-open {
    display: flex;
  }

  /* no dropdown vertical, o rótulo da área vira cabeçalho de seção */
  .ctopnav-area {
    border-left: 0;
    padding: var(--space-2) var(--space-3) 0;
    margin: var(--space-1) 0 0;
  }
}

/* ===== Transições entre páginas (abas) + revelação ===== */
/* View Transitions cross-document: crossfade suave ao navegar entre abas.
   Progressive enhancement — navegadores sem suporte ignoram e navegam normal. */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {

  /* topbar fica estável (não pisca) enquanto o conteúdo faz crossfade */
  .ctopbar {
    view-transition-name: ctopbar;
  }

  /* pílula da aba ativa "desliza" da posição antiga p/ a nova */
  .ctopnav-link.is-active {
    view-transition-name: active-tab;
  }

  /* afina o crossfade do conteúdo */
  ::view-transition-old(root) {
    animation-duration: .26s;
  }

  ::view-transition-new(root) {
    animation-duration: .32s;
  }

  /* entrada do cabeçalho da página */
  .ceyebrow {
    animation: revUp .5s var(--ease-out) both;
  }

  .csub {
    animation: revUp .55s var(--ease-out) both .12s;
  }

  /* título: revelado letra a letra (JS adiciona .is-split + spans .char) */
  .ctitle .char {
    display: inline-block;
    white-space: pre;
    animation: charIn .52s var(--ease-out) both;
    animation-delay: calc(var(--i) * 26ms);
  }
}

/* esconde o título até o JS dividir em letras — evita o bloco aparecer e
   reanimar ("pisca duplo"). Só com anim-ready (JS on + sem reduced-motion);
   sob reduced-motion a classe não é setada e o título aparece normal. */
html.anim-ready .ctitle {
  opacity: 0;
}

html.anim-ready .ctitle.is-split {
  opacity: 1;
}

@keyframes revUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes charIn {
  from {
    opacity: 0;
    transform: translateY(0.45em);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
