/* Direção Coral (2026-10-15): navy profundo, coral de marca, carmim só para risco.
   Camada de tokens sobre o ShadCn, carregada por último: todo o painel herda daqui. A marca
   (coral, puxado para o laranja) nunca marca falha; falha e MED usam o carmim, sempre com
   ícone e rótulo. */
/* Figtree servida daqui (2026-10-16): pelo Google Fonts, cada abertura do painel mandava o IP de
   quem opera para fora. Fonte variável, OFL 1.1 (fonts/Figtree-OFL.txt): um arquivo por subconjunto. */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/figtree-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/figtree-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --background: 222 33% 97%;
    --foreground: 224 42% 11%;
    --card: 0 0% 100%;
    --card-foreground: 224 42% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 42% 11%;
    --muted: 222 28% 94%;
    --muted-foreground: 222 14% 38%;
    --secondary: 222 28% 94%;
    --secondary-foreground: 224 42% 11%;
    --accent: 222 28% 94%;
    --accent-foreground: 224 42% 11%;
    --border: 222 22% 88%;
    --input: 222 18% 82%;
    --primary: 12 88% 60%;
    --brand-ink: 12 78% 40%;
    --primary-foreground: 222 47% 9%;
    --ring: 12 88% 52%;
    --destructive: 345 75% 38%;
    --destructive-foreground: 0 0% 100%;
    --font-sans: "Figtree", system-ui, sans-serif;
}
.dark {
    --background: 222 47% 6%;
    --foreground: 210 40% 96%;
    --card: 222 42% 9%;
    --card-foreground: 210 40% 96%;
    --popover: 222 42% 9%;
    --popover-foreground: 210 40% 96%;
    --muted: 222 32% 14%;
    --muted-foreground: 216 20% 70%;
    --secondary: 222 32% 14%;
    --secondary-foreground: 210 40% 96%;
    --accent: 222 32% 15%;
    --accent-foreground: 210 40% 96%;
    --border: 222 28% 18%;
    --input: 222 26% 25%;
    --primary: 10 92% 66%;
    --brand-ink: 10 92% 66%;
    --primary-foreground: 222 47% 8%;
    --ring: 10 92% 66%;
    --destructive: 345 78% 55%;
    --destructive-foreground: 222 47% 8%;
}

.shell { font-family: "Figtree", system-ui, sans-serif; }
.shell :is(table, .vx-tile, .vx-node, .day-stats, .queue-count, .vx-route dd) { font-variant-numeric: tabular-nums; }
.shell ::selection { background: hsl(var(--primary) / .28); }
.shell :is(input, textarea) { caret-color: hsl(var(--primary)); }
.shell :focus-visible { outline-color: hsl(var(--ring)); }
.shell { scrollbar-color: hsl(var(--input)) transparent; }

/* Fundo: luz azul fria no alto, como o brilho de uma tela de operação. */
.dark .shell {
    background: radial-gradient(1200px 560px at 72% -180px, rgb(37 99 235 / .18), transparent 70%), hsl(var(--background));
}
.dark .shell .workspace { background: transparent; }
:root .shell { background: radial-gradient(1200px 520px at 72% -200px, hsl(12 88% 60% / .07), transparent 70%), hsl(var(--background)); }
:root .shell .workspace { background: transparent; }

/* Menu */
.shell .sidebar { background: hsl(var(--card)); border-color: hsl(var(--border)); }
.dark .shell .sidebar { background: linear-gradient(180deg, hsl(var(--card)), hsl(var(--background))); }
.shell .brand-mark { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: 0 6px 20px hsl(var(--primary) / .32); }
.shell .section-nav a.active {
    border-color: hsl(var(--primary) / .32);
    background: hsl(var(--primary) / .12);
    color: hsl(var(--brand-ink));
}
.shell .section-nav a.active .nav-icon { background: hsl(var(--primary) / .16); color: hsl(var(--brand-ink)); }
.shell .nav-badge { border-color: hsl(var(--primary) / .4); background: hsl(var(--primary) / .12); color: hsl(var(--brand-ink)); }

/* Superfícies com profundidade: luz por cima, sombra deslocada por baixo. */
.shell :is(.panel, .vx-tile, .vx-card, .vx-route, .vx-combo, .vx-flow, .operational-alerts) {
    border-color: hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 1px 2px rgb(16 24 40 / .05), 0 6px 16px rgb(16 24 40 / .05);
}
.dark .shell :is(.panel, .vx-tile, .vx-card, .vx-route, .vx-combo, .vx-flow, .operational-alerts) {
    border-top-color: hsl(var(--foreground) / .12);
    background: linear-gradient(180deg, hsl(var(--muted) / .85), hsl(var(--card)) 56%);
    box-shadow: inset 0 1px 0 hsl(var(--foreground) / .07), 0 12px 32px -8px rgb(0 0 0 / .6);
}
.shell :is(.vx-node, .queue-list a) { background: hsl(var(--muted) / .6); }

/* Ícone de cada número na cor do que ele mede. */
.shell .vx-tile > span svg {
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 8px;
    background: color-mix(in srgb, currentColor 14%, transparent);
}
.shell .vx-tiles > .vx-tile:nth-child(1) > span svg, .shell .vx-tiles > .vx-tile:nth-child(3) > span svg { color: var(--vx-in); }
.shell .vx-tiles > .vx-tile:nth-child(2) > span svg { color: var(--vx-out); }
.shell .vx-tiles > .vx-tile:nth-child(4) > span svg { color: hsl(var(--foreground)); }
.shell .vx-tiles > .vx-tile:nth-child(5) > span svg { color: var(--vx-amber); }
.shell .vx-tiles > .vx-tile:nth-child(6) > span svg { color: hsl(var(--muted-foreground)); }
.shell .vx-tiles > .vx-tile.risk > span svg { color: hsl(var(--destructive)); }

/* Alertas: borda inteira na cor da gravidade, nunca a faixa lateral grossa. */
.shell .operational-alerts { border: 1px solid color-mix(in srgb, var(--warning) 40%, hsl(var(--border))); }
.shell .operational-alerts.error { border: 1px solid hsl(var(--destructive) / .45); }
.shell .alert-group-title { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; }
.shell .alert-group-detail { max-width: 80ch; margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: 13px; line-height: 1.55; }
.shell .alert-group-side { display: grid; justify-items: end; gap: 6px; }
.shell .alert-group-side .operational-alerts-item-count { white-space: nowrap; }
.shell .alert-group-side .alert-group-open { margin-top: 0; }
.shell .alert-group-clients { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shell .alert-group-clients span {
    padding: 2px 8px;
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    background: hsl(var(--muted) / .6);
    font-size: 12px;
}
.shell .alert-group-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: hsl(var(--foreground)); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.shell .alert-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }

.shell .alert-sev { display: grid; place-items: start; padding-top: 2px; }
.shell .alert-sev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.shell .alert-sev.error { color: hsl(var(--destructive)); }
.shell .alert-sev.warning { color: var(--warning); }
.shell .operational-alerts-item .alert-level {
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
.shell .operational-alerts-item .alert-level.error { background: hsl(var(--destructive) / .14); color: hsl(var(--destructive)); }
.shell .operational-alerts-item .alert-level.warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning-text, var(--warning)); }
.shell svg.link-arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; }

/* Ao vivo */
.shell .vx-live { display: inline-flex; align-items: center; gap: 6px; }
.shell .vx-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
@media (prefers-reduced-motion: no-preference) {
    .shell .vx-live i { animation: vx-live 2s ease-out infinite; }
}
@keyframes vx-live { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 0%, transparent); } }

/* Primeira tela: faixa, fila e os seis números cabem em 1440x900. */
.shell.screen-overview .hero { margin-bottom: 16px; padding-bottom: 16px; }
.shell .vx-status { margin-bottom: 14px; }
.shell .queue-list a { min-height: 92px; }
.shell.screen-overview .queue-panel .panel-head { margin-bottom: 12px; padding-bottom: 12px; }

/* Financeiro: rota como metadado; "entrou hoje" no verde de entrada, nunca na cor da marca. */
.shell .finance-provider-type { display: block; margin-bottom: 2px; color: hsl(var(--muted-foreground)); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.shell .finance-provider-grid .finance-primary { border-color: color-mix(in srgb, var(--success) 35%, hsl(var(--border))); background: color-mix(in srgb, var(--success) 8%, transparent); }

.shell .vx-narrow { display: none; }
@media (max-width: 560px) {
    .shell .vx-wide { display: none; }
    .shell .vx-narrow { display: inline; }
}

/* Item ativo do menu marcado pelo fundo e pela cor, sem faixa lateral. */
.shell .section-nav a.active::before { display: none; }
/* Etapas dos pagamentos de teste como texto de apoio, não sobretítulo. */
.shell .client-test-payments-kicker { color: hsl(var(--muted-foreground)); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
