/* ==========================================================================
   Hora Extra — folha do redesenho, no padrão do design system do portal
   (referências: rh/admissao-digital/assets/style.css e sms/pmoc/assets/app.css).

   Substitui assets/style.css nas telas já migradas — é standalone, não depende
   dela. A antiga continua servindo as telas ainda não migradas.

   Cor do sistema: AZUL (transporte/frota). Cada sistema tem a sua — Admissão
   usa coral, PMOC teal, o portal o vermelho da marca. Azul aqui é deliberado:
   os status usam âmbar ("Pendente…") e vermelho ("Não aprovado no prazo"),
   então uma marca âmbar competiria com o próprio alerta da tela.

   Travas vindas do assets/script.js (não quebrar):
     - .employee-card PRECISA ser display:grid — o filtro faz style.display='grid';
     - .deadline-status tem os estados .is-valid / .is-invalid;
     - .route-line e .empty-row são gerados por innerHTML no JS.
   ========================================================================== */

:root {
    --brand-1: #3b82f6;
    --brand-2: #1e3a8a;
    --brand: #1d4ed8;
    --brand-claro: #e8effc;
    --brand-glow: rgba(29, 78, 216, 0.32);
    --brand-suave: rgba(37, 99, 235, 0.08);

    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --vidro: rgba(255, 255, 255, 0.72);
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --ring: rgba(29, 78, 216, 0.28);

    --ok-bg: #dcfce7;   --ok-fg: #15803d;
    --warn-bg: #fef3c7; --warn-fg: #b45309;
    --erro-bg: #fee2e2; --erro-fg: #b91c1c;

    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.18);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transicao: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --mola: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --brand-1: #60a5fa;
    --brand-2: #1e40af;
    --brand: #60a5fa;
    --brand-claro: rgba(59, 130, 246, 0.18);
    --brand-glow: rgba(59, 130, 246, 0.42);
    --brand-suave: rgba(59, 130, 246, 0.1);

    --bg: #0b1220;
    --surface: #131d31;
    --surface-2: #0f1829;
    --vidro: rgba(19, 29, 49, 0.76);
    --text: #e6edf6;
    --muted: #94a3b8;
    --border: #263349;
    --ring: rgba(96, 165, 250, 0.45);

    --ok-bg: rgba(34, 197, 94, 0.16);   --ok-fg: #4ade80;
    --warn-bg: rgba(234, 179, 8, 0.16); --warn-fg: #fbbf24;
    --erro-bg: rgba(239, 68, 68, 0.16); --erro-fg: #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 28px 70px rgba(0, 0, 0, 0.7);

    color-scheme: dark;
}

/* ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transicao), color var(--transicao);
    opacity: 0;
    animation: corpoEntra 0.01s linear 1.2s forwards; /* fallback se o JS falhar */
}
body.pronto { opacity: 1; animation: none; transition: opacity 0.4s ease; }
@keyframes corpoEntra { to { opacity: 1; } }

/* Brilho ambiente atrás de tudo */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(760px circle at 12% -8%, var(--brand-suave), transparent 60%),
        radial-gradient(620px circle at 92% 4%, rgba(96, 165, 250, 0.09), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.fundo-marcas {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.fundo-marcas span {
    position: absolute;
    display: block;
    color: var(--brand);
    opacity: 0.05;
    animation: flutua linear infinite;
}
:root[data-theme="dark"] .fundo-marcas span { opacity: 0.09; }
@keyframes flutua {
    from { transform: translateY(110vh) rotate(0deg); }
    to   { transform: translateY(-16vh) rotate(360deg); }
}

/* Aproveita a tela toda */
.page {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 18px clamp(14px, 2vw, 30px) 60px;
}

/* ==========================================================================
   Cabeçalho — banner com a marca
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 30px 32px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(125deg, #16307a 0%, var(--brand) 46%, #2f6fe4 100%);
    color: #fff;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
:root[data-theme="dark"] .hero {
    background: linear-gradient(125deg, #0d1c3f 0%, #143a86 50%, #1c4ba8 100%);
}
/* Malha de pontos + brilho */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(105deg, #000 8%, transparent 62%);
    -webkit-mask-image: linear-gradient(105deg, #000 8%, transparent 62%);
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    top: -60%;
    right: -8%;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 66%);
    pointer-events: none;
}
.hero > div { position: relative; z-index: 1; }
.hero > div:not(.hero-actions) { flex: 1 1 340px; }

/* Logo institucional. Na folha antiga isto era o .hero::before; virou markup
   real (com alt) porque o ::before agora desenha a malha do banner. */
.hero-logo {
    position: relative;
    z-index: 1;
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    padding: 9px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
    object-fit: contain;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    margin-bottom: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
}
.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 2.6vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}
.hero p {
    margin: 0;
    max-width: 70ch;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    line-height: 1.55;
}

.hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

/* Relógio ao vivo (tema.js) */
.relogio {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}
.relogio strong {
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.relogio span {
    font-size: 10.5px;
    text-transform: capitalize;
    color: rgba(255, 255, 255, 0.8);
}

.user-session-card {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}
.user-session-card span {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.user-session-card strong { font-size: 13px; }
.user-session-card small { font-size: 11px; color: rgba(255, 255, 255, 0.72); }

/* ==========================================================================
   KPIs do topo (montados no PHP)
   ========================================================================== */

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 13px;
    margin-bottom: 20px;
}
.kpi {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--kpi-cor, var(--brand));
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    animation: popIn var(--mola) both;
    transition: transform var(--transition), box-shadow var(--transition);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi:nth-child(1) { animation-delay: 0.04s; }
.kpi:nth-child(2) { animation-delay: 0.1s; }
.kpi:nth-child(3) { animation-delay: 0.16s; }
.kpi:nth-child(4) { animation-delay: 0.22s; }
.kpi-icone {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-2); /* fallback: color-mix() é recente (Chrome 111+) */
    background: color-mix(in srgb, var(--kpi-cor, var(--brand)) 14%, transparent);
    color: var(--kpi-cor, var(--brand));
}
.kpi-icone svg { width: 20px; height: 20px; }
.kpi-info { display: flex; flex-direction: column; min-width: 0; }
.kpi-info strong {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.kpi-info span {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Botões
   ========================================================================== */

.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition),
                background var(--transition), border-color var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    box-shadow: 0 4px 16px var(--brand-glow);
}
:root[data-theme="dark"] .btn-primary { color: #08111f; }
.btn-primary:hover { box-shadow: 0 10px 26px var(--brand-glow); }
.btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
}
.btn-primary:hover::after { left: 130%; }

/* No cabeçalho os botões são de vidro sobre o gradiente */
.hero-actions .btn-light {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
    backdrop-filter: blur(6px);
}
.hero-actions .btn-light:hover { background: rgba(255, 255, 255, 0.26); }
.hero-actions .btn-dark {
    background: #fff;
    color: var(--brand-2);
    box-shadow: var(--shadow-md);
}
.hero-actions .btn-dark:hover { background: #fff; }

.btn-light {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
.btn-light:hover { border-color: var(--brand); color: var(--brand); }
.btn-light:focus-visible { outline-color: var(--ring); }

.btn-dark { background: var(--text); color: var(--surface); }

.btn-full { width: 100%; padding: 14px 18px; font-size: 15px; }

.ondulacao {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.5);
    animation: ondula 0.6s linear;
    pointer-events: none;
}
.btn-light .ondulacao, .tema-toggle .ondulacao { background: var(--brand-glow); }
@keyframes ondula { to { transform: scale(3.2); opacity: 0; } }

/* Alternador de tema */
.tema-toggle {
    position: relative;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: transform var(--transition), background var(--transition);
}
.tema-toggle:hover { transform: translateY(-2px) rotate(-12deg); background: rgba(255, 255, 255, 0.28); }
.tema-toggle svg { width: 18px; height: 18px; }
.tema-toggle .icone-lua { display: none; }
:root[data-theme="dark"] .tema-toggle .icone-sol { display: none; }
:root[data-theme="dark"] .tema-toggle .icone-lua { display: block; }

/* ==========================================================================
   Avisos
   ========================================================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 17px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    border-left-width: 5px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    animation: surge var(--transicao) both;
}
.alert-error   { background: var(--erro-bg); color: var(--erro-fg); border-color: currentColor; }
.alert-success { background: var(--ok-bg);   color: var(--ok-fg);   border-color: currentColor; }
@keyframes surge { from { opacity: 0; transform: translateY(-7px); } }

/* ==========================================================================
   Cartões
   ========================================================================== */

.card {
    position: relative;
    padding: 24px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transicao), border-color var(--transicao), transform var(--transicao);
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border); /* fallback: color-mix() é recente (Chrome 111+) */
    border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
}

.top-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}
.top-card { margin-bottom: 18px; }

.card-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 17px;
}
.card-title h2 { margin: 0 0 3px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.015em; }
.card-title p  { margin: 0; font-size: 13px; color: var(--muted); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-claro);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: pontoRespira 2s ease-in-out infinite;
}
.badge-danger { background: var(--erro-bg); color: var(--erro-fg); }
@keyframes pontoRespira {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 currentColor; }
    50%      { opacity: 0.5; transform: scale(0.72); box-shadow: 0 0 0 4px transparent; }
}

.pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.pill.is-ok       { background: var(--ok-bg);   color: var(--ok-fg);   border-color: transparent; }
.pill.is-pendente { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.pill.is-erro     { background: var(--erro-bg); color: var(--erro-fg); border-color: transparent; }

.muted-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ==========================================================================
   Campos
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12px; font-weight: 700; color: var(--muted); }

.input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input:hover { border-color: var(--muted); }
.input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring);
}
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
:root[data-theme="dark"] .input::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); }

.model-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.program-grid, .leader-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 16px;
}

/* Alimentação: a lista de chips ocupa a linha inteira, senão fica espremida. */
.food-field { grid-column: 1 / -1; }
.food-list { display: flex; flex-wrap: wrap; gap: 8px; }
.food-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}
.food-option:hover { border-color: var(--brand); transform: translateY(-2px); }
.food-option input { accent-color: var(--brand); margin: 0; }
.food-option:has(input:checked) {
    background: var(--brand-claro);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand) inset;
}

/* ==========================================================================
   Seções numeradas
   ========================================================================== */

.section-header {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 19px;
    border-bottom: 1px solid var(--border);
}
.section-header h2 { margin: 0 0 3px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.section-header p  { margin: 0; font-size: 13px; color: var(--muted); }

.step {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    min-width: 46px;
    height: 46px;
    padding: 0 11px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 18px var(--brand-glow);
}
:root[data-theme="dark"] .step { color: #08111f; }
/* Anel pulsante em volta do passo */
.step::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 18px;
    border: 2px solid var(--brand);
    opacity: 0;
    animation: anelPulsa 3s ease-out infinite;
}
@keyframes anelPulsa {
    0%   { opacity: 0.5; transform: scale(0.9); }
    70%  { opacity: 0; transform: scale(1.14); }
    100% { opacity: 0; }
}

/* ==========================================================================
   Layout principal
   ========================================================================== */

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 20px;
    align-items: start;
}
.main-content { min-width: 0; }

/* ==========================================================================
   Filtros + lista de colaboradores
   ========================================================================== */

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}
.search-field { grid-column: span 2; }
.filter-clear { white-space: nowrap; }

.employee-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 10px;
    max-height: 470px;
    overflow-y: auto;
    padding: 6px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(var(--surface-2) 30%, transparent),
        linear-gradient(transparent, var(--surface-2) 70%) 0 100%,
        radial-gradient(farthest-side at 50% 0, rgba(15, 23, 42, 0.1), transparent),
        radial-gradient(farthest-side at 50% 100%, rgba(15, 23, 42, 0.1), transparent) 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
    background-attachment: local, local, scroll, scroll;
    scrollbar-width: thin;
}

/* display:grid é obrigatório — o filtro do script.js restaura exatamente este valor. */
.employee-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.employee-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.employee-card input { position: absolute; opacity: 0; pointer-events: none; }
.employee-card:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-claro);
    box-shadow: 0 0 0 1.5px var(--brand) inset;
}
.employee-card:focus-within { outline: 3px solid var(--ring); outline-offset: 1px; }

/* Avatar com as iniciais — o matiz vem do data-tom (tema.js) */
.employee-card::before {
    content: attr(data-iniciais);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: hsl(var(--tom, 220) 62% 92%);
    color: hsl(var(--tom, 220) 68% 34%);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: transform var(--transition);
}
:root[data-theme="dark"] .employee-card::before {
    background: hsl(var(--tom, 220) 52% 24%);
    color: hsl(var(--tom, 220) 76% 76%);
}
.employee-card:hover::before { transform: scale(1.06) rotate(-3deg); }

/* Marca de seleção no canto */
.checkmark {
    position: absolute;
    top: 9px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    transition: all var(--transition);
}
.checkmark::after {
    content: "";
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--mola);
}
:root[data-theme="dark"] .checkmark::after { border-color: #08111f; }
.employee-card:has(input:checked) .checkmark { background: var(--brand); border-color: var(--brand); }
.employee-card:has(input:checked) .checkmark::after { transform: rotate(45deg) scale(1); }

.employee-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 18px; }
.employee-info strong {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.employee-info small { font-size: 11.5px; color: var(--muted); }
.employee-info em {
    display: inline-block;
    max-width: 100%;
    margin-top: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--brand-suave);
    color: var(--brand);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 34px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ==========================================================================
   Selecionados + tabelas
   ========================================================================== */

.selected-block { padding-top: 17px; border-top: 1px solid var(--border); }
.selected-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.selected-title h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.selected-title span {
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px var(--brand-glow);
}
:root[data-theme="dark"] .selected-title span { color: #08111f; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    scrollbar-width: thin;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 13px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.table tbody td { padding: 11px 13px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--brand-suave); }
.table .empty-row td, .table tbody tr td[colspan] {
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

/* ==========================================================================
   Prazos
   ========================================================================== */

.deadline-card {
    background:
        radial-gradient(circle at top right, var(--warn-bg), transparent 38%),
        var(--surface);
}

.deadline-rules { display: grid; gap: 9px; margin-bottom: 14px; }
.deadline-rules > div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border-left: 3px solid var(--brand);
    font-size: 13px;
    transition: transform var(--transition), border-color var(--transition);
}
.deadline-rules > div:hover { transform: translateX(3px); }
.deadline-rules strong { font-size: 12.5px; font-weight: 700; }
.deadline-rules span { color: var(--muted); }

.deadline-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transicao);
}
.deadline-status::before {
    content: "○";
    font-size: 15px;
    line-height: 1;
}
.deadline-status.is-valid {
    background: var(--ok-bg);
    border: 1px solid transparent;
    color: var(--ok-fg);
}
.deadline-status.is-valid::before { content: "✔"; }
.deadline-status.is-invalid {
    background: var(--erro-bg);
    border: 1px solid transparent;
    color: var(--erro-fg);
    animation: chacoalha 0.4s ease;
}
.deadline-status.is-invalid::before { content: "✕"; }
@keyframes chacoalha {
    10%, 90% { transform: translateX(-2px); }
    30%, 70% { transform: translateX(3px); }
    50%      { transform: translateX(-3px); }
}

/* ==========================================================================
   Modelo
   ========================================================================== */

.template-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.template-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.template-check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ==========================================================================
   Resumo (coluna lateral)
   ========================================================================== */

.summary { position: sticky; top: 14px; }
.summary-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.summary-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-1));
    background-size: 200% 100%;
    animation: desliza 4s linear infinite;
}
@keyframes desliza { to { background-position: 200% 0; } }

.summary-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-top: 5px;
}
.summary-title span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.summary-title strong { font-size: 15px; font-weight: 700; color: var(--brand); }

.summary-stats { display: grid; gap: 9px; }
.summary-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    animation: popIn var(--mola) both;
}
.summary-stats > div:nth-child(1) { animation-delay: 0.05s; }
.summary-stats > div:nth-child(2) { animation-delay: 0.12s; }
.summary-stats > div:nth-child(3) { animation-delay: 0.19s; }
.summary-stats > div:last-child {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px var(--brand-glow);
}
:root[data-theme="dark"] .summary-stats > div:last-child { color: #08111f; }
.summary-stats > div:last-child span { color: rgba(255, 255, 255, 0.82); }
:root[data-theme="dark"] .summary-stats > div:last-child span { color: rgba(8, 17, 31, 0.7); }
.summary-stats span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.summary-stats strong {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.summary-stats strong.mudou { animation: pulsaNumero 0.45s ease; }
@keyframes pulsaNumero { 50% { transform: scale(1.18); } }

/* Linha do tempo do turno (montada no tema.js) */
.turno {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.turno-trilho {
    position: relative;
    height: 34px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}
.turno-normal {
    position: absolute;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
        var(--border) 0 5px, transparent 5px 10px);
}
.turno-extra {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    box-shadow: 0 0 14px var(--brand-glow);
    transition: left var(--transicao), width var(--transicao);
}
.turno-extra span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}
.turno-escala {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.summary-section { display: flex; flex-direction: column; gap: 7px; }
.summary-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.summary-routes {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--muted);
    scrollbar-width: thin;
}
.route-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--surface-2);
    border-left: 3px solid var(--brand);
    color: var(--text);
    font-weight: 600;
    animation: surge var(--transition) both;
}
.route-line strong {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--brand-claro);
    color: var(--brand);
    font-size: 12px;
}

.summary-note {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--warn-bg);
    color: var(--warn-fg);
    border-left: 4px solid currentColor;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
}

.manager-approval-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
.manager-approval-box label { font-size: 12px; font-weight: 700; color: var(--muted); }
.manager-approval-box small { font-size: 11.5px; color: var(--muted); }

/* ==========================================================================
   Trilha de navegação por seção (scroll-spy, montada no tema.js)
   ========================================================================== */

.trilha {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 11px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--vidro);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    opacity: 0;
    transition: opacity var(--transicao);
}
.trilha.aparece { opacity: 1; }
.trilha button {
    position: relative;
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all var(--transicao);
}
.trilha button:hover { background: var(--brand); transform: scale(1.3); }
.trilha button.ativo {
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-claro);
    height: 24px;
    border-radius: 999px;
}
.trilha button::after {
    content: attr(data-rotulo);
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--text);
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
}
.trilha button:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* ==========================================================================
   Barra de progresso, voltar ao topo, avisos flutuantes
   ========================================================================== */

.barra-progresso {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
    box-shadow: 0 0 12px var(--brand-glow);
    z-index: 60;
    transition: width 0.12s linear;
}

.ao-topo {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--vidro);
    backdrop-filter: blur(10px);
    color: var(--brand);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    pointer-events: none;
    transition: all var(--transicao);
    z-index: 55;
}
.ao-topo.aparece { opacity: 1; transform: none; pointer-events: auto; }
.ao-topo:hover { background: var(--brand); color: #fff; transform: translateY(-3px); }

/* Avisos flutuantes */
.avisos {
    position: fixed;
    right: 18px;
    bottom: 78px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    z-index: 70;
    pointer-events: none;
}
.aviso {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    background: var(--vidro);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-xl);
    font-size: 13px;
    font-weight: 600;
    animation: avisoEntra var(--mola) both;
}
.aviso.saindo { animation: avisoSai var(--transicao) both; }
.aviso.is-erro { border-left-color: var(--erro-fg); color: var(--erro-fg); }
.aviso.is-ok   { border-left-color: var(--ok-fg); color: var(--ok-fg); }
@keyframes avisoEntra { from { opacity: 0; transform: translateX(40px); } }
@keyframes avisoSai   { to   { opacity: 0; transform: translateX(40px); } }

/* ==========================================================================
   Paleta de comandos (Ctrl+K)
   ========================================================================== */

.paleta-fundo {
    position: fixed;
    inset: 0;
    display: none;
    padding-top: 14vh;
    justify-content: center;
    background: rgba(8, 15, 30, 0.55);
    backdrop-filter: blur(5px);
    z-index: 80;
}
.paleta-fundo.aberta { display: flex; animation: surge var(--transition) both; }
.paleta {
    width: min(560px, 92vw);
    height: max-content;
    max-height: 62vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    animation: paletaEntra var(--mola) both;
}
@keyframes paletaEntra { from { opacity: 0; transform: translateY(-16px) scale(0.97); } }
.paleta input {
    padding: 17px 19px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15.5px;
}
.paleta input:focus { outline: none; }
.paleta ul { list-style: none; margin: 0; padding: 7px; overflow-y: auto; }
.paleta li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.paleta li[aria-selected="true"] { background: var(--brand-claro); color: var(--brand); }
.paleta li small { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.paleta-vazio { padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px; }

kbd {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface-2);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 1240px) {
    .main-grid { grid-template-columns: 1fr; }
    .summary { position: static; }
    .trilha { display: none; }
}
@media (max-width: 760px) {
    .page { padding: 12px 11px 44px; }
    .hero { padding: 22px 19px; align-items: flex-start; }
    .hero-actions { width: 100%; }
    .relogio { display: none; }
    .model-row { grid-template-columns: 1fr; }
    .search-field, .filters { grid-column: span 1; grid-template-columns: 1fr; }
    .employee-list { grid-template-columns: 1fr; max-height: 400px; }
    .ao-topo { display: none; }
}

/* ==========================================================================
   Movimento reduzido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .fundo-marcas { display: none; }
    body { opacity: 1; animation: none; }
}

/* ==========================================================================
   TELAS INTERNAS — famílias portadas da assets/style.css para os tokens novos.
   O layout (grades, tamanhos, quebras) é o mesmo da folha antiga de propósito:
   aqui só troca a pele. Assim as telas migram sem mudar de comportamento.
   ========================================================================== */

/* ---- Botões extras (painéis e ações) ---- */
.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; box-shadow: 0 4px 14px rgba(21, 128, 61, 0.3); }
.btn-danger  { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3); }
.btn-success:hover, .btn-danger:hover { filter: brightness(1.06); }
.btn-disabled {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}
.btn-disabled:hover { transform: none; }
.btn-small { padding: 7px 13px; font-size: 12.5px; }

.btn-mini {
    min-height: 32px;
    padding: 7px 11px;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: filter var(--transition), transform var(--transition);
}
.btn-mini:hover { transform: translateY(-1px); }
.btn-mini-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.btn-mini-danger  { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.btn-mini-success:hover, .btn-mini-danger:hover { filter: brightness(1.08); }

/* ---- Status: classes vindas do painel_status_class() no PHP ---- */
.pill.ok   { background: var(--ok-bg);   color: var(--ok-fg);   border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.pill.bad  { background: var(--erro-bg); color: var(--erro-fg); border-color: transparent; }
.pill-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

/* ---- Cabeçalho de cartão / tabela / formulário em linha ---- */
.card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.table-responsive { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); scrollbar-width: thin; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; flex-wrap: wrap; }

/* ---- admin_rotas: portal-* estavam SEM definição na folha antiga ---- */
.portal-page { position: relative; z-index: 1; width: 100%; padding: 18px clamp(14px, 2vw, 30px) 60px; }
.portal-header {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(125deg, #16307a 0%, var(--brand) 46%, #2f6fe4 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}
.portal-header h1 { margin: 0 0 4px; font-size: clamp(20px, 2vw, 28px); font-weight: 800; letter-spacing: -0.02em; }
.portal-header p  { margin: 0; color: rgba(255, 255, 255, 0.82); font-size: 13.5px; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.portal-actions .btn-light {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
    backdrop-filter: blur(6px);
}
.portal-actions .btn-light:hover { background: rgba(255, 255, 255, 0.26); }
.route-edit-form { display: grid; gap: 9px; }

/* ---- Painel do Transporte ---- */
.transport-kpis, .rh-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.transport-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 19px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    animation: popIn var(--mola) both;
    transition: transform var(--transition), box-shadow var(--transition);
}
.transport-kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.transport-kpi-card:nth-child(1) { animation-delay: 0.04s; }
.transport-kpi-card:nth-child(2) { animation-delay: 0.1s; }
.transport-kpi-card:nth-child(3) { animation-delay: 0.16s; }
.transport-kpi-card:nth-child(4) { animation-delay: 0.22s; }
.transport-kpi-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.transport-kpi-card strong {
    display: block;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.transport-kpi-card small { display: block; margin-top: 7px; color: var(--muted); font-weight: 600; font-size: 12px; }
.transport-kpi-card.accent {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    border-color: transparent;
    box-shadow: 0 8px 24px var(--brand-glow);
}
.transport-kpi-card.accent span,
.transport-kpi-card.accent small,
.transport-kpi-card.accent strong { color: #fff; }
:root[data-theme="dark"] .transport-kpi-card.accent span,
:root[data-theme="dark"] .transport-kpi-card.accent small,
:root[data-theme="dark"] .transport-kpi-card.accent strong { color: #08111f; }

.transport-filter-card, .rh-filter-card { margin-bottom: 20px; }
.transport-filter { display: grid; grid-template-columns: 220px auto auto; gap: 12px; align-items: end; }

.transport-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.status-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}
.status-card:hover { transform: translateY(-2px); }
.status-card span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12.5px; font-weight: 800; }
.status-card strong { display: block; font-size: 29px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.status-card.ok   { background: var(--ok-bg);   border-color: transparent; }
.status-card.ok strong   { color: var(--ok-fg); }
.status-card.warn { background: var(--warn-bg); border-color: transparent; }
.status-card.warn strong { color: var(--warn-fg); }
.status-card.bad  { background: var(--erro-bg); border-color: transparent; }
.status-card.bad strong  { color: var(--erro-fg); }

/* ---- Ações do Transporte ---- */
.transport-action-form { display: grid; gap: 8px; min-width: 210px; }
.transport-action-note {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.transport-action-note:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.transport-action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.func-cell { min-width: 190px; }
.func-cell-list { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }

/* ---- Painel RH / relatório do gerente ---- */
.rh-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto auto; gap: 12px; align-items: end; }
.rh-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.chart-card canvas { width: 100%; max-width: 100%; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.row-subtotal { background: var(--surface-2); font-weight: 700; }
.row-subtotal td { border-top: 2px solid var(--border); }

/* ---- Monitores de rota (admin) ---- */
.monitor-login-card { max-width: 720px; margin: 40px auto; }
.monitor-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.monitor-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.route-add-row { display: grid; grid-template-columns: 260px minmax(260px, 1fr); gap: 14px; margin-bottom: 16px; }
.btn-route-action { margin-top: 16px; }

.ad-search-field { position: relative; }
.ad-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    scrollbar-width: thin;
}
.ad-search-item {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
}
.ad-search-item:hover { background: var(--brand-claro); }
.ad-search-item strong { font-size: 14px; font-weight: 700; }
.ad-search-item span { color: var(--muted); font-size: 12px; }
.ad-search-item small { color: var(--brand); font-size: 12px; font-weight: 800; }
.ad-search-empty { padding: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }

.rota-multi-select { min-height: 230px; padding: 8px; }
.rota-multi-select option { padding: 8px; border-radius: 8px; }

@media (max-width: 1250px) {
    .rh-filter, .rh-kpis, .rh-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
    .transport-kpis, .transport-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transport-filter { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .monitor-admin-grid, .route-add-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .transport-kpis, .transport-status-grid, .rh-filter, .rh-kpis, .rh-charts { grid-template-columns: 1fr; }
    .portal-header { padding: 18px; }
}

/* ---- Painel do Transporte: célula expansível de funcionários ----
   Estava num <style> inline do painel_transporte.php, com cores cravadas que
   não sobreviveriam ao tema escuro. */
.func-cell > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
    list-style: none;
    white-space: nowrap;
}
.func-cell > summary::-webkit-details-marker { display: none; }
.func-cell > summary::after { content: ' \25B8'; color: var(--muted); }
.func-cell[open] > summary::after { content: ' \25BE'; }
.func-cell-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
    min-width: 170px;
}
.func-cell-list li {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
}
.func-cell-list strong { display: block; font-size: 13px; color: var(--text); }
.func-cell-list small { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   TELAS DE APROVAÇÃO (magic link) — aprovar_chefia.php e aprovar_sucon.php.

   Estas regras estavam DUPLICADAS, idênticas, num <style> inline em cada uma
   das duas telas; ficam aqui uma vez só. São telas sem sessão, abertas por link
   do e-mail e muito acessadas pelo celular: por isso continuam com layout
   próprio (centrado, sem sidebar) em vez de herdar o das telas internas.
   ========================================================================== */

.approval-page {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100% - 32px));
    margin: 28px auto 48px;
}
.approval-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.approval-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.approval-header h1 { margin: 0; font-size: 29px; font-weight: 800; letter-spacing: -0.04em; }
.approval-header p  { margin: 8px 0 0; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.detail {
    padding: 13px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.detail span {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.detail strong { display: block; color: var(--text); }

.func-section {
    margin-top: 18px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.func-title {
    display: block;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.func-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.func-item {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color var(--transition), transform var(--transition);
}
.func-item:hover { border-color: var(--brand); transform: translateX(3px); }
.func-nome { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.func-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.func-tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--brand-suave);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

.approval-actions { display: grid; gap: 12px; margin-top: 18px; }
.approval-actions textarea { min-height: 100px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
    .detail-grid { grid-template-columns: 1fr; }
    .approval-card { padding: 19px; }
    .approval-header { flex-direction: column; }
    .buttons .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   GESTÃO DE MONITORES DE ROTA (gestao_monitores_rota.php)

   Tela "fácil", mobile-first, com vocabulário próprio (route-*): foi desenhada
   à parte para o monitor usar no celular. Portada da assets/style.css com as
   cores trocadas pelos tokens — layout e quebras idênticos ao original.

   Dois seletores (.hero-actions e .user-session-card) estavam SOLTOS dentro do
   @media de celular na folha antiga e vazavam para todas as telas; aqui vão
   escopados em .route-easy-page.
   ========================================================================== */
/* ==========================================================
   Gestão de Monitores de Rota - Tela simplificada
   ========================================================== */

.route-easy-page {
    --route-primary: var(--brand);
    --route-primary-dark: var(--brand-2);
    --route-danger: var(--erro-fg);
    --route-success: var(--ok-fg);
    --route-text: var(--text);
    --route-muted: var(--muted);
    --route-border: var(--border);
    --route-bg-soft: var(--surface-2);
}

.route-hero-simple {
    margin-bottom: 18px;
}

.route-help-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.route-help-item {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--route-border);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.route-help-item > span {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--route-primary);
    color: var(--surface);
    font-size: 20px;
    font-weight: 1000;
}

.route-help-item strong {
    display: block;
    color: var(--route-text);
    font-size: 15px;
}

.route-help-item small {
    display: block;
    color: var(--route-muted);
    margin-top: 3px;
}

.route-alert {
    display: grid;
    gap: 4px;
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid;
    font-weight: 800;
}

.route-alert span {
    font-weight: 700;
}

.route-alert-error {
    background: var(--erro-bg);
    border-color: var(--erro-bg);
    color: var(--erro-fg);
}

.route-alert-success {
    background: var(--ok-bg);
    border-color: var(--ok-bg);
    color: var(--ok-fg);
}

.route-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.route-big-card {
    background: var(--surface);
    border: 1px solid var(--route-border);
    border-radius: 26px;
    padding: 20px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.route-big-card span {
    display: block;
    color: var(--route-muted);
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.route-big-card strong {
    display: block;
    color: var(--route-text);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.05em;
}

.route-big-card small {
    display: block;
    margin-top: 8px;
    color: var(--route-muted);
    font-weight: 800;
}

.route-big-card.accent {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: var(--brand);
}

.route-big-card.accent span,
.route-big-card.accent strong,
.route-big-card.accent small {
    color: var(--surface);
}

.route-section {
    background: var(--surface);
    border: 1px solid var(--route-border);
    border-radius: 28px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.route-section-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.route-step-number {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 18px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-bg);
    color: var(--warn-fg);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 1000;
}

.route-section-title h2 {
    margin: 0;
    color: var(--route-text);
    font-size: 25px;
    letter-spacing: -.04em;
}

.route-section-title p {
    margin: 6px 0 0;
    color: var(--route-muted);
    line-height: 1.5;
}

.route-select-form,
.route-add-destination,
.route-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.route-toolbar {
    margin-bottom: 16px;
}

.route-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.route-field,
.route-search-box {
    display: grid;
    gap: 7px;
}

.route-field label,
.route-search-box label {
    color: var(--text);
    font-size: 13px;
    font-weight: 1000;
}

.route-input {
    min-height: 52px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 12px 14px;
    outline: none;
    font-size: 15px;
    background: var(--surface);
}

.route-input:focus {
    border-color: var(--route-primary);
    box-shadow: 0 0 0 4px rgba(173, 26, 5, 0.10);
}

.route-primary-button,
.route-secondary-button,
.route-light-button,
.route-danger-button {
    min-height: 52px;
    border: 0;
    border-radius: 17px;
    padding: 13px 18px;
    font-weight: 1000;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.route-primary-button {
    background: var(--route-primary);
    color: var(--surface);
}

.route-primary-button:hover {
    background: var(--route-primary-dark);
}

.route-secondary-button {
    background: var(--text);
    color: var(--surface);
}

.route-light-button {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.route-danger-button {
    background: var(--route-danger);
    color: var(--surface);
}

.route-list {
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding: 2px 4px 2px 2px;
}

.route-person-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 74px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    cursor: pointer;
    transition: .14s ease;
}

.route-person-card:hover {
    border-color: var(--brand-1);
    background: var(--warn-bg);
}

.route-person-card input {
    display: none;
}

.route-person-check {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface);
    display: grid;
    place-items: center;
}

.route-person-card input:checked + .route-person-check {
    background: var(--route-primary);
    border-color: var(--route-primary);
}

.route-person-card input:checked + .route-person-check::after {
    content: "✓";
    color: var(--surface);
    font-size: 18px;
    font-weight: 1000;
}

.route-person-card:has(input:checked) {
    border-color: var(--route-primary);
    background: var(--brand-claro);
    box-shadow: 0 10px 22px rgba(173, 26, 5, 0.10);
}

.route-person-main {
    min-width: 0;
}

.route-person-main strong {
    display: block;
    color: var(--route-text);
    font-size: 15px;
    font-weight: 1000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-person-main small {
    display: block;
    color: var(--route-muted);
    margin-top: 4px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-person-badge {
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--ok-bg);
    border: 1px solid var(--ok-bg);
    color: var(--ok-fg);
    font-size: 12px;
    font-weight: 1000;
}

.route-person-badge.no-route {
    background: var(--warn-bg);
    border-color: var(--warn-bg);
    color: var(--warn-fg);
}

.route-empty {
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    color: var(--route-muted);
    text-align: center;
    font-weight: 900;
    background: var(--surface-2);
}

.route-action-form {
    display: grid;
    gap: 14px;
}

.route-sticky-action {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.route-sticky-action strong {
    display: block;
    color: var(--surface);
    font-size: 16px;
}

.route-sticky-action small {
    display: block;
    color: var(--border);
    margin-top: 3px;
}

@media (max-width: 1000px) {
    .route-help-card,
    .route-dashboard {
        grid-template-columns: 1fr;
    }

    .route-select-form,
    .route-add-destination,
    .route-toolbar {
        grid-template-columns: 1fr;
    }

    .route-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .route-person-card {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .route-person-badge {
        grid-column: 2;
        justify-self: start;
    }

    .route-sticky-action {
        position: static;
        display: grid;
    }
}

@media (max-width: 560px) {
    .route-section {
        padding: 16px;
        border-radius: 22px;
    }

    .route-section-title {
        display: grid;
    }

    .route-toolbar-actions {
        grid-template-columns: 1fr;
    }

    .route-person-main strong,
    .route-person-main small {
        white-space: normal;
    }
}



/* MOBILE-FIRST - Gestão de Monitores de Rota */

/*
   Ajustes específicos para celular:
   - botões maiores
   - menos rolagem interna
   - cards mais fáceis de tocar
   - formulário em coluna única
   - ação de confirmar sempre destacada
*/

@media (max-width: 820px) {
    body {
        background: var(--bg);
    }

    .route-easy-page.page,
    .page.route-easy-page {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin: 0;
    }

    .route-hero-simple,
    .hero.route-hero-simple {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px;
        border-radius: 22px;
        margin-bottom: 12px;
    }

    .route-hero-simple::before,
    .hero.route-hero-simple::before {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
        order: -1;
    }

    .route-hero-simple h1,
    .hero.route-hero-simple h1 {
        font-size: 26px;
        line-height: 1.05;
        margin-bottom: 8px;
    }

    .route-hero-simple p,
    .hero.route-hero-simple p {
        font-size: 14px;
        line-height: 1.45;
    }

    .route-easy-page .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
    }

    .route-easy-page .hero-actions .btn,
    .route-easy-page .hero-actions a.btn {
        width: 100%;
        min-height: 52px;
        justify-content: center;
        font-size: 15px;
    }

    .route-easy-page .user-session-card {
        width: 100%;
        max-width: 100%;
        min-height: 64px;
    }

    .route-help-card {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .route-help-item {
        padding: 13px;
        border-radius: 18px;
    }

    .route-help-item > span {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 14px;
        font-size: 18px;
    }

    .route-dashboard {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .route-big-card {
        border-radius: 20px;
        padding: 16px;
    }

    .route-big-card strong {
        font-size: 30px;
    }

    .route-section {
        padding: 14px;
        border-radius: 20px;
        margin-bottom: 14px;
    }

    .route-section-title {
        display: grid;
        grid-template-columns: 42px 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .route-step-number {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 15px;
        font-size: 20px;
    }

    .route-section-title h2 {
        font-size: 21px;
        line-height: 1.12;
    }

    .route-section-title p {
        font-size: 14px;
        line-height: 1.45;
    }

    .route-select-form,
    .route-add-destination,
    .route-toolbar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .route-field label,
    .route-search-box label {
        font-size: 14px;
    }

    .route-input {
        min-height: 56px;
        border-radius: 16px;
        font-size: 16px;
        padding: 13px 14px;
    }

    .route-toolbar {
        position: sticky;
        top: 0;
        z-index: 6;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(8px);
        padding: 10px 0;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--bg);
    }

    .route-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .route-primary-button,
    .route-secondary-button,
    .route-light-button,
    .route-danger-button {
        width: 100%;
        min-height: 56px;
        border-radius: 16px;
        font-size: 15px;
        padding: 14px 16px;
    }

    .route-list {
        max-height: none;
        overflow: visible;
        gap: 9px;
        padding: 0;
    }

    .route-person-card {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        min-height: 86px;
        padding: 14px;
        border-radius: 18px;
    }

    .route-person-check {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .route-person-main strong {
        font-size: 15px;
        white-space: normal;
        line-height: 1.25;
    }

    .route-person-main small {
        font-size: 13px;
        white-space: normal;
        line-height: 1.35;
    }

    .route-person-badge {
        grid-column: 2;
        justify-self: start;
        margin-top: 2px;
        font-size: 12px;
        padding: 7px 9px;
    }

    .route-sticky-action {
        position: sticky;
        bottom: 8px;
        z-index: 20;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 13px;
        border-radius: 20px;
        margin-top: 12px;
    }

    .route-sticky-action strong {
        font-size: 15px;
    }

    .route-sticky-action small {
        font-size: 12px;
        line-height: 1.3;
    }

    .route-alert {
        border-radius: 18px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .route-empty {
        padding: 18px;
        border-radius: 18px;
        font-size: 14px;
    }
}

@media (max-width: 460px) {
    .route-easy-page.page,
    .page.route-easy-page {
        padding: 8px;
    }

    .route-hero-simple,
    .hero.route-hero-simple {
        padding: 15px;
        border-radius: 20px;
    }

    .route-hero-simple h1,
    .hero.route-hero-simple h1 {
        font-size: 24px;
    }

    .route-section {
        padding: 12px;
    }

    .route-section-title {
        grid-template-columns: 1fr;
    }

    .route-toolbar-actions {
        grid-template-columns: 1fr;
    }

    .route-person-card {
        min-height: 92px;
    }
}

/* FIM MOBILE-FIRST - Gestão de Monitores de Rota */


/* Etapas separadas - Gestão de Monitores de Rota */
.route-step-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.route-step-tab {
    display: grid;
    gap: 5px;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.route-step-tab span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.route-step-tab strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 1000;
}

.route-step-tab.active {
    background: var(--warn-bg);
    border-color: var(--warn-bg);
}

.route-step-tab.active span,
.route-step-tab.active strong {
    color: var(--warn-fg);
}

.route-action-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.route-choice-card {
    display: grid;
    gap: 16px;
    align-content: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.route-choice-card.remove {
    border-color: var(--erro-bg);
}

.route-choice-card.add {
    border-color: var(--ok-bg);
}

.route-choice-number {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 1000;
    background: var(--warn-bg);
    color: var(--warn-fg);
    border: 1px solid var(--warn-bg);
}

.route-choice-card h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -.04em;
    color: var(--text);
}

.route-choice-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.route-simple-note {
    display: grid;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 16px;
    color: var(--text);
    margin-bottom: 18px;
}

.route-simple-note strong {
    color: var(--text);
}

@media (max-width: 820px) {
    .route-step-menu {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .route-step-tab {
        min-height: 64px;
        border-radius: 18px;
        padding: 13px;
    }

    .route-action-choice {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .route-choice-card {
        border-radius: 22px;
        padding: 18px;
    }

    .route-choice-card h2 {
        font-size: 22px;
    }

    .route-choice-number {
        width: 46px;
        height: 46px;
        border-radius: 16px;
        font-size: 22px;
    }
}

/* ==========================================================================
   LOGIN (login.php) — duas colunas: marca à esquerda, formulário à direita.
   Tinha :root e paleta próprios num <style> inline de 178 linhas; agora usa
   os tokens do design system como todas as demais.
   ========================================================================== */

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.login-shell .brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    padding: 48px clamp(28px, 4vw, 64px);
    background: linear-gradient(150deg, #16307a 0%, var(--brand) 52%, #2f6fe4 100%);
    color: #fff;
}
:root[data-theme="dark"] .login-shell .brand {
    background: linear-gradient(150deg, #0d1c3f 0%, #143a86 52%, #1c4ba8 100%);
}
.login-shell .brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(160deg, #000 10%, transparent 70%);
    -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 70%);
}
.login-shell .brand > * { position: relative; z-index: 1; }
.login-shell .brand h1 {
    margin: 22px 0 10px;
    font-size: clamp(26px, 2.6vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}
.login-shell .brand p { margin: 0; max-width: 46ch; color: rgba(255, 255, 255, 0.84); line-height: 1.6; }
.login-shell .brand small { color: rgba(255, 255, 255, 0.66); font-size: 12px; }

.logo-mark {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    padding: 10px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }

.login-shell .form-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 48px clamp(24px, 4vw, 60px);
    background: var(--surface);
}
.login-shell .form-area h2 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }
.login-shell .form-area > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-shell form { display: grid; gap: 15px; }
.login-shell .field { display: flex; flex-direction: column; gap: 6px; }
.login-shell .field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.login-shell .field input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.login-shell .field input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring);
}
.login-shell form button {
    position: relative;
    overflow: hidden;
    margin-top: 6px;
    padding: 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    font: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--brand-glow);
    transition: transform var(--transition), box-shadow var(--transition);
}
:root[data-theme="dark"] .login-shell form button { color: #08111f; }
.login-shell form button:hover { transform: translateY(-2px); box-shadow: 0 10px 28px var(--brand-glow); }

.login-shell .error {
    padding: 12px 15px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid currentColor;
    background: var(--erro-bg);
    color: var(--erro-fg);
    font-size: 13.5px;
    font-weight: 600;
}
.login-shell .hint { margin-top: 20px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; min-height: 0; }
    .login-shell .brand { padding: 34px 24px; }
    .login-shell .brand h1 { margin-top: 14px; font-size: 24px; }
    .login-shell .brand small { display: none; }
    .logo-mark { width: 64px; height: 64px; border-radius: 17px; }
    .login-shell .form-area { padding: 32px 24px 48px; }
}
