/* Estilos globais do Gestão de Segurança - complementares ao Bootstrap 5. */

body {
    min-height: 100vh;
}

.gs-login-body {
    background: linear-gradient(135deg, #1f2f57 0%, #14213d 100%);
}

.gs-login-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
}

.gs-login-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .25);
    padding: 2rem 1.75rem;
}

.gs-login-logo {
    display: block;
    max-width: 160px;
    margin: 0 auto 1.25rem;
}

.gs-login-titulo {
    color: #14213d;
    font-weight: 700;
}

.gs-login-card label {
    color: #14213d;
    font-weight: 600;
}

.gs-login-card .form-control {
    border-radius: .6rem;
    border-color: #dde1ea;
    padding: .65rem .9rem;
}

.gs-login-card .form-control:focus {
    border-color: #4d7cff;
    box-shadow: 0 0 0 .2rem rgba(77, 124, 255, .18);
}

.gs-btn-entrar {
    background: #14213d;
    border-color: #14213d;
    font-weight: 600;
    padding: .75rem 1rem;
    border-radius: .6rem;
}

.gs-btn-entrar:hover,
.gs-btn-entrar:focus {
    background: #0d1730;
    border-color: #0d1730;
}

/* Dashboard */
.gs-dash-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.gs-dash-mascote {
    width: 200px;
    flex: 0 0 auto;
}

.gs-dash-conteudo {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .gs-dash-top { flex-direction: column; align-items: center; text-align: center; }
    .gs-dash-mascote { width: 150px; }
}

.gs-stat-card {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    height: 100%;
}

/* Todo card clicável do app usa esse padrão: some link, mantém a cor do
   texto (não vira azul de link) e ganha sombra/realce no hover. */
a.gs-stat-card, a.gs-kpi-card, a.gs-filial-mini {
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, transform .1s ease;
    cursor: pointer;
}

a.gs-stat-card:hover, a.gs-kpi-card:hover, a.gs-filial-mini:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .1);
    color: inherit;
}

.gs-stat-icone {
    width: 3rem;
    height: 3rem;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.gs-section-card {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 1.25rem 1.35rem;
    height: 100%;
    transition: box-shadow .15s ease;
}

.gs-section-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.gs-section-icone {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .6rem;
    background: #eff6ff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: .75rem;
}

.gs-section-card a.gs-item-link {
    color: #475569;
    text-decoration: none;
}

.gs-section-card a.gs-item-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Badges "soft" — fundo claro, texto colorido, borda fina, formato pill.
   Substitui o badge sólido padrão do Bootstrap nas telas de DTO/Plano de
   Ação, pra um visual mais executivo/corporativo. */
.gs-soft-success, .gs-soft-warning, .gs-soft-danger, .gs-soft-info, .gs-soft-neutral {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.3;
}

.gs-soft-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.gs-soft-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.gs-soft-danger  { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.gs-soft-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.gs-soft-neutral { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* Texto colorido (não badge) com contraste bom em fundo branco — evita o
   amarelo claro padrão do Bootstrap (.text-warning), ilegível. */
.gs-text-success { color: #15803d; }
.gs-text-warning { color: #b45309; }
.gs-text-danger  { color: #be123c; }
.gs-text-neutral { color: #64748b; }

/* Topo com efeito de vidro (glass) — branco translúcido + blur */
.gs-topbar-glass {
    background: rgba(255, 255, 255, .92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* DTO */
.gs-dto-tabs .nav-link {
    color: #475569;
    font-weight: 700;
    font-size: .85rem;
    border-radius: 999px;
    padding: .4rem 1.1rem;
    border: 1px solid transparent;
}

.gs-dto-tabs .nav-link:not(.active):hover {
    background: #f1f5f9;
}

.gs-dto-tabs .nav-link.active {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}

.gs-dto-card {
    background: #fff;
    border-radius: .85rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 1.1rem;
    height: 100%;
    display: flex;
    gap: .85rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, border-color .15s ease;
}

a.gs-dto-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .1);
    border-color: #cbd5e1;
    color: inherit;
}

.gs-dto-card-icone {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .6rem;
    background: #eff6ff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

/* Sem isso, o texto do card (título/label) não quebra linha — flex item sem
   min-width:0 usa a largura do conteúdo sem quebra como mínimo, estourando
   o card pra fora da coluna em títulos longos (ex.: "Carregamento/
   descarregamento/controle de chaves"). */
.gs-dto-card > .flex-grow-1 {
    min-width: 0;
}

.gs-dto-card-grupo {
    border-radius: 1rem;
}

.gs-dto-card-grupo .gs-dto-card-icone {
    background: #fffbeb;
    color: #b45309;
}

.gs-dto-subitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem 0;
    text-decoration: none;
    color: #475569;
    font-size: .85rem;
    font-weight: 600;
    border-top: 1px solid #f1f5f9;
}

.gs-dto-subitem:first-of-type { border-top: 0; }

.gs-dto-subitem:hover { color: #1d4ed8; }

.gs-valor-forte {
    font-weight: 800;
    color: #1e293b;
}

/* Cards de KPI compactos (dashboard do DTO) — fundo e borda tingidos por
   tom, chip de ícone translúcido, valor grande em negrito. */
.gs-kpi-card {
    display: flex;
    flex-direction: column;
    border-radius: .75rem;
    border: 1px solid;
    padding: .85rem 1rem;
    height: 100%;
}

.gs-kpi-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: rgba(255, 255, 255, .65);
    font-size: 1rem;
}

.gs-kpi-valor {
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: .4rem;
    line-height: 1.1;
}

.gs-kpi-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    opacity: .85;
}

.gs-kpi-sub {
    font-size: .76rem;
    font-weight: 600;
    margin-top: .15rem;
    opacity: .85;
}

.gs-kpi-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.gs-kpi-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.gs-kpi-danger  { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.gs-kpi-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.gs-kpi-neutral { background: #f8fafc; border-color: #e2e8f0; color: #475569; }

/* Alertas nomeados da Home (Blitz de Trajeto / GSDPQ / Telemetria) — mais
   chamativos que o gs-kpi-card comum, de propósito: são os 3 únicos
   módulos com farol por pessoa, o que precisa de ação imediata. */
a.gs-alerta-card {
    display: block;
    border-radius: .9rem;
    border: 1px solid;
    padding: 1rem 1.15rem;
    height: 100%;
    text-decoration: none;
    transition: transform .1s ease;
}

a.gs-alerta-card:hover {
    transform: translateY(-2px);
}

.gs-alerta-numero {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    margin-top: .3rem;
}

.gs-alerta-texto {
    font-size: .8rem;
    font-weight: 600;
    opacity: .85;
}

.gs-alerta-critico {
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid rgba(0, 0, 0, .08);
    font-size: .78rem;
    font-weight: 700;
}

.gs-alerta-danger { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.gs-alerta-ok     { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* Tira de filiais compacta (dentro do card, não mais um bloco por filial) */
.gs-filial-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: .6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
}

.gs-filial-mini .gs-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

.gs-dot-success { background: #22c55e; }
.gs-dot-warning { background: #f59e0b; }
.gs-dot-danger  { background: #ef4444; }

/* Histórico condensado — lista enxuta, não tabela */
.gs-historico-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: .75rem;
    padding: .55rem .4rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
    color: inherit;
    border-radius: .4rem;
    margin: 0 -.4rem;
}

a.gs-historico-item:hover {
    background: #f8fafc;
    color: inherit;
}

/* Achados críticos — os 3 piores de cada checklist (ver achado_icone() em
   app/Helpers/helpers.php), sempre em card vermelho cheio pra chamar
   atenção; o resto dos achados fica numa lista simples abaixo. */
.gs-achado-critico {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: .6rem;
    padding: .85rem 1rem;
    margin-bottom: .6rem;
}

.gs-achado-icone {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.gs-achado-critico .gs-achado-titulo {
    color: #7f1d1d;
    font-weight: 700;
}

.gs-achado-lista-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

/* Card/linha do achado inteiro clicável (menos o botão "Criar ação", que
   fica fora do link) — leva pro detalhe: quem reprovou, quando, evolução. */
.gs-achado-link {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.gs-achado-link:hover .gs-achado-titulo,
.gs-achado-link:hover { color: #1d4ed8; }

.gs-achado-lista-item .gs-achado-link { align-items: center; }

.gs-achado-lista-item:last-child { border-bottom: 0; }

.gs-historico-item:last-child { border-bottom: 0; }

/* Lista ranqueada simples (sem barra) — pior pro melhor, número + nome +
   valor — usada no dashboard da Telemetria. */
.gs-rank-linha {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .82rem;
}

.gs-rank-linha:last-child { border-bottom: 0; }

.gs-rank-linha-dupla { align-items: flex-start; }

.gs-rank-numero {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: .72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gs-rank-rotulo {
    flex: 1 1 auto;
    min-width: 0;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-rank-valor {
    flex: 0 0 auto;
    font-weight: 700;
}

/* Régua de tratativa (Prontuário do condutor) — tira informativa, cor por
   degrau (verde -> amarelo -> laranja -> vermelho -> preto), sem ligação
   com dado nenhum ainda (só referência visual pra reunião). */
.gs-regua {
    display: flex;
    flex-wrap: nowrap;
    border-radius: .5rem;
    overflow-x: auto;
}

.gs-regua-item {
    flex: 1 1 0;
    min-width: 5.5rem;
    padding: .8rem .4rem;
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Revisão geral de usabilidade/responsividade (2026-09-25, pré-deploy) ===== */

/* Grupo de resultado do checklist (Conforme/Ponto de atenção/Não conforme)
   — botões grandes pra toque com uma mão, feito pra quem preenche em campo
   pelo celular. Usa o btn-check nativo do Bootstrap (o <label class="btn">
   ao lado de um <input type="radio" class="btn-check"> vira botão cheio
   sozinho, sem JS nenhum) — só ajusta tamanho/alinhamento aqui. */
.gs-resultado-grupo {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.gs-resultado-grupo .btn {
    flex: 1 1 110px;
    min-height: 48px;
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .6rem .5rem;
}

@media (max-width: 575.98px) {
    .gs-resultado-grupo .btn {
        flex: 1 1 30%;
        font-size: .76rem;
        padding: .55rem .25rem;
    }
}

/* Botão de salvar em formulário longo (checklist/DTO/Gabarito) — grande e
   full-width no celular, fácil de encontrar depois de rolar a tela toda. */
@media (max-width: 767.98px) {
    .gs-btn-salvar-form {
        width: 100%;
        min-height: 52px;
        font-size: 1.05rem;
    }
}

/* Estado vazio compacto — 1 linha, não um card enorme parado no meio da
   tela ("Nenhuma não conformidade em aberto" e afins). */
.gs-vazio-compacto {
    font-size: .82rem;
    color: #94a3b8;
    padding: .5rem 0;
    margin: 0;
}

/* Texto longo truncado com reticências — resumo em 1-2 linhas, título
   completo disponível via atributo title="" (tooltip nativo). */
.gs-texto-resumo {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gs-texto-resumo-1l {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Igual gs-texto-resumo-1l, mas sem display:block — pra usar direto num
   <td>, que precisa continuar sendo table-cell (display:block num <td>
   tira a célula do modelo de tabela e bagunça a altura da linha). */
.gs-td-truncado {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================================
   Padrão visual único + modo claro/escuro (2026-09-29)
   Tokens em :root (claro) e [data-bs-theme="dark"] (escuro). O Bootstrap
   5.3 já troca os próprios componentes pelo data-bs-theme no <html>; aqui
   ficam os tokens do app e os componentes gs-* (inclusive os que têm
   <style> próprio dentro das views — sobrescritos no escuro com seletor
   mais específico, sem mexer em cada tela).
   ===================================================================== */
:root {
    --gs-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --gs-bg: #f4f6fa;
    --gs-surface: #ffffff;
    --gs-surface-2: #f8fafc;
    --gs-border: #e5e9f2;
    --gs-border-strong: #cbd5e1;
    --gs-text: #1e293b;
    --gs-text-2: #334155;
    --gs-muted: #64748b;
    --gs-hover: #f1f5f9;
    --gs-track: #eef1f6;
    --gs-primary: #2563eb;
    --gs-radius: .7rem;
    --gs-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    --gs-shadow-hover: 0 6px 16px rgba(15, 23, 42, .09);
}

[data-bs-theme="dark"] {
    --gs-bg: #0b1220;
    --gs-surface: #111a2e;
    --gs-surface-2: #0f172a;
    --gs-border: #1f2b44;
    --gs-border-strong: #334155;
    --gs-text: #e2e8f0;
    --gs-text-2: #cbd5e1;
    --gs-muted: #94a3b8;
    --gs-hover: #17233d;
    --gs-track: #1e293b;
    --gs-primary: #60a5fa;
    --gs-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --gs-shadow-hover: 0 6px 16px rgba(0, 0, 0, .5);
    --bs-body-bg: #0b1220;
    --bs-body-color: #e2e8f0;
    color-scheme: dark;
}

body { font-family: var(--gs-font); background: var(--gs-bg) !important; color: var(--gs-text); font-size: .92rem; -webkit-font-smoothing: antialiased; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { color: var(--gs-text); letter-spacing: -.01em; }
h1.h4, .h4 { font-size: 1.2rem; font-weight: 700; }
.h6, h6 { font-weight: 700; }

/* Cabeçalho de página padrão */
.gs-page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.gs-page-title { font-size: 1.2rem; font-weight: 800; margin: 0; color: var(--gs-text); letter-spacing: -.01em; }
.gs-back { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: .5rem; border: 1px solid var(--gs-border); color: var(--gs-muted); text-decoration: none; background: var(--gs-surface); }
.gs-back:hover { color: var(--gs-primary); border-color: var(--gs-border-strong); }

/* Superfícies */
.gs-section-card { background: var(--gs-surface); border-color: var(--gs-border); border-radius: var(--gs-radius); box-shadow: var(--gs-shadow); padding: 1rem 1.1rem; color: var(--gs-text); }
.gs-section-card:hover { box-shadow: var(--gs-shadow); }
.gs-card-title { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--gs-muted); margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.gs-card-foot { font-size: .74rem; color: var(--gs-muted); margin-top: .35rem; }
a.gs-card-link { color: inherit; transition: box-shadow .15s ease, border-color .15s ease; }
a.gs-card-link:hover { box-shadow: var(--gs-shadow-hover); border-color: var(--gs-border-strong); }
.gs-card-link-titulo { color: var(--gs-text); }

/* Faixa de KPIs (mesma altura, números operacionais) */
.gs-kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .55rem; }
.gs-kpi-card { padding: .65rem .8rem; border-radius: var(--gs-radius); }
.gs-kpi-strip .gs-kpi-card { justify-content: center; }
.gs-kpi-valor { font-size: 1.35rem; margin-top: 0; letter-spacing: -.01em; }
.gs-kpi-valor small { font-size: .62em; font-weight: 700; opacity: .7; }
.gs-kpi-valor-sm { font-size: .88rem; line-height: 1.25; }
.gs-kpi-label { font-size: .66rem; letter-spacing: .04em; margin-top: .15rem; }
.gs-resumo-de { font-size: .6em; font-weight: 700; opacity: .7; }

/* Listas de nomes (farol) */
.gs-lista-titulo { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; display: flex; align-items: center; gap: .3rem; }
.gs-lista-contagem { margin-left: auto; background: var(--gs-hover); color: var(--gs-text-2); border-radius: 999px; padding: 0 .45rem; font-size: .7rem; }
.gs-lista-nomes { max-height: 12rem; overflow-y: auto; font-size: .78rem; }
.gs-lista-nomes a { display: flex; justify-content: space-between; gap: .4rem; padding: .15rem .25rem; border-radius: .3rem; color: var(--gs-text-2); text-decoration: none; }
.gs-lista-nomes a:hover { background: var(--gs-hover); color: var(--gs-primary); }
.gs-lista-meta { flex: 0 0 auto; color: var(--gs-muted); font-weight: 700; font-size: .72rem; }

/* Ranking compacto (NOK, perguntas) */
.gs-rank-lista { display: flex; flex-direction: column; }
.gs-rank-item { display: flex; align-items: center; gap: .55rem; padding: .38rem .3rem; border-bottom: 1px solid var(--gs-border); text-decoration: none; color: var(--gs-text); font-size: .8rem; }
.gs-rank-item:last-child { border-bottom: 0; }
.gs-rank-item:hover { background: var(--gs-hover); color: var(--gs-text); }
.gs-rank-pos { flex: 0 0 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--gs-hover); color: var(--gs-muted); font-size: .68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.gs-rank-texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gs-rank-num { flex: 0 0 auto; font-weight: 800; font-size: .76rem; }
.gs-rank-barra { flex: 0 0 60px; height: 5px; background: #fecaca; border-radius: 3px; overflow: hidden; }
.gs-rank-barra span { display: block; height: 100%; background: #22c55e; }
.gs-pill { font-size: .64rem !important; padding: .12rem .45rem !important; text-transform: uppercase; }
.gs-links-detalhe { display: flex; flex-wrap: wrap; gap: .5rem; }
.gs-links-detalhe a { font-size: .78rem; font-weight: 700; padding: .35rem .7rem; border-radius: .5rem; border: 1px solid var(--gs-border); background: var(--gs-surface); color: var(--gs-text-2); text-decoration: none; }
.gs-links-detalhe a:hover { border-color: var(--gs-border-strong); color: var(--gs-primary); }
.gs-mini-numeros { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; text-align: center; }
.gs-mini-numeros strong { display: block; font-size: 1.1rem; color: var(--gs-text); }
.gs-mini-numeros span { font-size: .64rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gs-muted); font-weight: 700; }

/* Tabelas */
.table { --bs-table-bg: transparent; color: var(--gs-text); }
.table > thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gs-muted); font-weight: 800; border-bottom-color: var(--gs-border); }
.table > :not(caption) > * > * { border-bottom-color: var(--gs-border); }
.gs-tabela-compacta td, .gs-tabela-compacta th { font-size: .8rem; padding: .35rem .45rem; }

/* Régua de pontuação do condutor (Crítico → Atenção → Bom) */
.gs-rpts-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; font-size: .9rem; color: var(--gs-text); }
.gs-rpts-trilho { position: relative; display: flex; height: 12px; border-radius: 6px; overflow: visible; }
.gs-rpts-compacta .gs-rpts-trilho { height: 6px; border-radius: 3px; }
.gs-rpts-z { display: block; height: 100%; }
.gs-rpts-z:first-child { border-radius: 6px 0 0 6px; }
.gs-rpts-z-critico { background: #ef4444; }
.gs-rpts-z-atencao { background: #f59e0b; }
.gs-rpts-z-bom { background: #22c55e; border-radius: 0 6px 6px 0; }
.gs-rpts-marcador { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--gs-surface); border: 3px solid var(--gs-text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.gs-rpts-compacta .gs-rpts-marcador { width: 10px; height: 10px; border-width: 2px; }
.gs-rpts-escala { position: relative; height: 1.1rem; margin-top: .3rem; font-size: .68rem; color: var(--gs-muted); font-weight: 700; }
.gs-rpts-escala span { position: absolute; transform: translateX(-50%); }
.gs-rpts-escala span:first-child { transform: none; }
.gs-rpts-escala span:last-child { transform: translateX(-100%); }

/* Botão de tema */
.gs-tema-btn .gs-icone-escuro { display: none; }
[data-bs-theme="dark"] .gs-tema-btn .gs-icone-claro { display: none; }
[data-bs-theme="dark"] .gs-tema-btn .gs-icone-escuro { display: inline; }

/* ---------- Modo escuro: componentes antigos com cor fixa ---------- */
[data-bs-theme="dark"] .gs-topbar-glass { background: rgba(11, 18, 32, .9) !important; border-color: var(--gs-border) !important; }
[data-bs-theme="dark"] .gs-stat-card,
[data-bs-theme="dark"] .gs-dto-card,
[data-bs-theme="dark"] .gs-capa-executiva,
[data-bs-theme="dark"] .gs-cap-subcard,
[data-bs-theme="dark"] .gs-cap-filial-card,
[data-bs-theme="dark"] .gs-farol-card,
[data-bs-theme="dark"] .gs-resumo-card,
[data-bs-theme="dark"] .gs-hero-aderencia,
[data-bs-theme="dark"] .gs-mini-card,
[data-bs-theme="dark"] .gs-piramide-card,
[data-bs-theme="dark"] .gs-comportamento-card,
[data-bs-theme="dark"] .gs-grafico-mensal,
[data-bs-theme="dark"] .gs-destaque-positivo-item,
[data-bs-theme="dark"] .gs-qlp-nivel,
[data-bs-theme="dark"] .gs-home-alerta,
[data-bs-theme="dark"] .gs-home-mod,
[data-bs-theme="dark"] .gs-duplicata-card,
[data-bs-theme="dark"] .gs-linha-follow,
[data-bs-theme="dark"] .gs-filial-mini,
[data-bs-theme="dark"] .gs-faixa-card { background: var(--gs-surface) !important; border-color: var(--gs-border) !important; box-shadow: 0 0 0 1px var(--gs-border) !important; color: var(--gs-text); }
[data-bs-theme="dark"] .gs-capa-executiva { background: var(--gs-surface-2) !important; }
[data-bs-theme="dark"] .gs-destaque-positivo-card { background: #0f2a1c !important; box-shadow: 0 0 0 1px #14532d !important; }
[data-bs-theme="dark"] .gs-qlp-setor,
[data-bs-theme="dark"] .gs-desvio-item,
[data-bs-theme="dark"] .gs-agenda-cabecalho,
[data-bs-theme="dark"] .gs-agenda-dia-fora { background: var(--gs-surface-2) !important; }
[data-bs-theme="dark"] .gs-agenda-dia-hoje { background: #13254a !important; }
[data-bs-theme="dark"] .gs-agenda-grade,
[data-bs-theme="dark"] .gs-agenda-dia { border-color: var(--gs-border) !important; }
[data-bs-theme="dark"] .gs-desvio-item:hover,
[data-bs-theme="dark"] a.gs-historico-item:hover { background: var(--gs-hover) !important; }
[data-bs-theme="dark"] .gs-historico-item,
[data-bs-theme="dark"] .gs-achado-lista-item,
[data-bs-theme="dark"] .gs-rank-linha,
[data-bs-theme="dark"] .gs-dto-subitem { border-color: var(--gs-border) !important; }
[data-bs-theme="dark"] .gs-dto-card-icone,
[data-bs-theme="dark"] .gs-section-icone { background: #13254a; color: #93c5fd; }
[data-bs-theme="dark"] .gs-rank-numero { background: var(--gs-hover); color: var(--gs-muted); }
[data-bs-theme="dark"] .gs-rank-rotulo,
[data-bs-theme="dark"] .gs-dto-subitem,
[data-bs-theme="dark"] .gs-valor-forte,
[data-bs-theme="dark"] .gs-farol-filial,
[data-bs-theme="dark"] .gs-desvio-titulo,
[data-bs-theme="dark"] .gs-hero-sub,
[data-bs-theme="dark"] .gs-home-mod-nome,
[data-bs-theme="dark"] .gs-piramide-legenda-label,
[data-bs-theme="dark"] .gs-cap-filial-nome { color: var(--gs-text) !important; }
[data-bs-theme="dark"] .gs-achado-critico { background: #2a1116; border-color: #5b1a24; }
[data-bs-theme="dark"] .gs-achado-critico .gs-achado-titulo { color: #fecaca; }
[data-bs-theme="dark"] .gs-badge-semana { background: #13254a; color: #93c5fd; }

/* Cores "soft" no escuro — fundo translúcido, texto claro */
[data-bs-theme="dark"] .gs-soft-success, [data-bs-theme="dark"] .gs-kpi-success { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); color: #86efac; }
[data-bs-theme="dark"] .gs-soft-warning, [data-bs-theme="dark"] .gs-kpi-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
[data-bs-theme="dark"] .gs-soft-danger,  [data-bs-theme="dark"] .gs-kpi-danger  { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
[data-bs-theme="dark"] .gs-soft-info,    [data-bs-theme="dark"] .gs-kpi-info    { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); color: #93c5fd; }
[data-bs-theme="dark"] .gs-soft-neutral, [data-bs-theme="dark"] .gs-kpi-neutral { background: rgba(148, 163, 184, .08); border-color: var(--gs-border); color: var(--gs-text-2); }
[data-bs-theme="dark"] .gs-kpi-icone { background: rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] .gs-text-success { color: #86efac; }
[data-bs-theme="dark"] .gs-text-warning { color: #fcd34d; }
[data-bs-theme="dark"] .gs-text-danger { color: #fca5a5; }
[data-bs-theme="dark"] .gs-matriz-cel-success { background: rgba(34, 197, 94, .15); color: #86efac; }
[data-bs-theme="dark"] .gs-matriz-cel-danger { background: rgba(239, 68, 68, .15); color: #fca5a5; }

/* Cor de texto fixa escrita inline nas views (style="color:#1e293b") */
[data-bs-theme="dark"] [style*="color:#1e293b"],
[data-bs-theme="dark"] [style*="color: #1e293b"],
[data-bs-theme="dark"] [style*="color:#334155"],
[data-bs-theme="dark"] [style*="color:#475569"] { color: var(--gs-text) !important; }
[data-bs-theme="dark"] .bg-white { background: var(--gs-surface) !important; }
[data-bs-theme="dark"] svg text[fill="#475569"] { fill: #cbd5e1; }
[data-bs-theme="dark"] svg text[fill="#94a3b8"] { fill: #64748b; }

/* Régua do Prontuário do Condutor — faixas Verde → Preta (regra 01/10/2026) */
.gs-pront-trilho { position: relative; display: flex; gap: 2px; }
.gs-pront-seg { flex: 1 1 0; text-align: center; font-size: .68rem; font-weight: 800; padding: .3rem .2rem; opacity: .55; }
.gs-pront-seg:first-child { border-radius: 6px 0 0 6px; }
.gs-pront-seg:last-of-type { border-radius: 0 6px 6px 0; }
.gs-pront-seg-atual { opacity: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.gs-pront-marcador { position: absolute; top: 100%; width: 0; height: 0; transform: translateX(-50%); border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid var(--gs-text); margin-top: 1px; }
.gs-pront-escala { display: flex; gap: 2px; margin-top: .75rem; }
.gs-pront-escala span { flex: 1 1 0; text-align: center; font-size: .64rem; color: var(--gs-muted); line-height: 1.2; }
.gs-pront-escala strong { display: block; color: var(--gs-text); font-size: .66rem; text-transform: uppercase; letter-spacing: .03em; }
.gs-pront-compacta { min-width: 110px; padding-bottom: 6px; }
.gs-pront-compacta .gs-pront-seg { padding: 0; height: 6px; }
.gs-pront-compacta .gs-pront-marcador { border-left-width: 5px; border-right-width: 5px; border-bottom-width: 6px; }
.gs-pront-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.gs-pront-fluxo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.gs-pront-fluxo > div { border-radius: .45rem; padding: .45rem .5rem; font-size: .7rem; line-height: 1.25; border-top: 4px solid; background: var(--gs-surface); }
.gs-pront-fluxo strong { display: block; font-size: .72rem; margin-bottom: .15rem; }
.gs-pront-fluxo .gs-pront-fluxo-atual { box-shadow: 0 0 0 2px var(--gs-text); }
@media (max-width: 767px) { .gs-pront-fluxo { grid-template-columns: 1fr 1fr; } }
.gs-pront-legenda .gs-pront-seg { opacity: 1; }
.gs-pront-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: .5rem; }
.gs-pront-kpis .gs-kpi-card { padding: .55rem .7rem; }
.gs-pront-kpis .gs-kpi-valor { font-size: 1.3rem; }
