:root {
    --grelha-estados: repeat(5, minmax(0, 1fr));
    --letra-base-min: 14px;
    --letra-min: 11px;
    --letra-pequena: max(var(--letra-min), 0.6875rem);

    --tec-0: var(--blue-200);
    --tec-1: var(--green-200);
    --tec-2: var(--purple-300);
    --tec-3: var(--pink-300);
    --tec-4: var(--orange-300);
    --tec-5: var(--brown-300);
    --tec-6: var(--blue-100);
    --tec-7: var(--green-100);
    --tec-8: var(--purple-100);
    --tec-9: var(--pink-100);
    --tec-10: var(--orange-100);
    --tec-11: var(--brown-100);
}

html {
    font-size: max(var(--letra-base-min), min(calc(100vw / 120), calc(100vh / 67.5)));
    color-scheme: dark;
}

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

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: var(--fonte);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--acento);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.espaco {
    flex: 1;
}

.icone {
    display: block;
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
}

.icone--pequeno {
    width: 0.8125rem;
    height: 0.8125rem;
    stroke-width: 1.8;
}

.icone--grande {
    width: 1.25rem;
    height: 1.25rem;
}

.cartao {
    background: var(--superficie);
    border: 1px solid var(--linha);
    border-radius: var(--raio);
    box-shadow: var(--sombra-cartao);
}

.painel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    height: 100vh;
    padding: 0.875rem;
    overflow: hidden;
}

.topo {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    flex: 0 0 4rem;
    min-width: 0;
    padding: 0 1.125rem;
    background: var(--navbar-background);
    border-color: var(--navbar-border);
}

.marca {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.3125rem 0.625rem;
    background: var(--grey-75);
    border-radius: var(--raio-input);
}

.marca__logo {
    display: block;
    height: 1.75rem;
    width: auto;
}

.topo__sep {
    flex: 0 0 auto;
    width: 1px;
    height: 2rem;
    background: var(--navbar-divider);
}

.topo__titulo {
    margin: 0;
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.seg {
    display: flex;
    flex: 0 0 auto;
    gap: 0.1875rem;
    padding: 0.1875rem;
    background: var(--blue-900);
    border: 1px solid var(--navbar-divider);
    border-radius: var(--raio);
}

.seg__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.875rem;
    min-width: 5rem;
    padding: 0 1.125rem;
    border: 0;
    border-radius: 0.375rem;
    font: 700 0.8125rem/1 var(--fonte);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: transparent;
    color: var(--blue-100);
    cursor: pointer;
}

.seg__btn:hover {
    color: var(--texto);
}

.seg__btn[aria-pressed="true"] {
    background: var(--acento);
    color: var(--acento-contraste);
}

.campo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    background: var(--blue-900);
    border: 1px solid var(--navbar-divider);
    border-radius: var(--raio);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--texto);
    white-space: nowrap;
}

.campo .icone {
    width: 1rem;
    height: 1rem;
    color: var(--blue-100);
}

.relogio {
    flex: 0 0 auto;
    min-width: 6.5rem;
    text-align: right;
    font: 600 1.5rem/1 var(--fonte-numerica);
    white-space: nowrap;
}

.relogio__seg {
    font-size: 0.875rem;
    color: var(--blue-100);
}

.avisos {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aviso {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.75rem;
    border: 1px solid;
    border-radius: var(--raio-input);
    font-size: 0.8125rem;
}

.aviso--erro {
    color: var(--red-200);
    border-color: color-mix(in srgb, var(--danger-color) 45%, transparent);
    background: color-mix(in srgb, var(--danger-color) 12%, transparent);
}

.aviso--info {
    color: var(--blue-100);
    border-color: color-mix(in srgb, var(--acento) 45%, transparent);
    background: color-mix(in srgb, var(--acento) 12%, transparent);
}

.producao {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
    min-height: 0;
}

.kpis {
    display: grid;
    grid-template-columns: var(--grelha-estados);
    column-gap: 0.75rem;
    flex: 0 0 auto;
    padding: 0.875rem 0;
}

.kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
    padding: 0 0.875rem;
}

.kpi + .kpi::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -0.375rem;
    width: 1px;
    background: var(--linha);
}

.kpi--perigo {
    --cor: var(--tom-perigo);
}

.kpi--ativo {
    --cor: var(--tom-ativo);
}

.kpi--bloqueado {
    --cor: var(--tom-bloqueado);
}

.kpi--concluido {
    --cor: var(--tom-concluido);
}

.kpi--autorizacao {
    --cor: var(--tom-autorizacao);
}

.kpi__icone {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--cor, var(--acento)) 14%, transparent);
    color: var(--cor, var(--acento));
}

.kpi__icone .icone {
    width: 1.5rem;
    height: 1.5rem;
}

.kpi__texto {
    min-width: 0;
}

.kpi__valor {
    font-size: 2.375rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.kpi__valor--perigo {
    color: var(--tom-perigo);
}

.kpi__valor--bloqueado {
    color: var(--tom-bloqueado);
}

.kpi__valor--autorizacao {
    color: var(--tom-autorizacao);
}

.kpi__label {
    margin-top: 0.375rem;
    font-size: var(--letra-pequena);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texto-3);
    line-height: 1.25;
}

.estados {
    display: grid;
    grid-template-columns: var(--grelha-estados);
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

.estado {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 0.625rem 0.875rem;
    border-color: color-mix(in srgb, var(--tom) 30%, var(--linha));
}

.estado--perigo {
    --tom: var(--tom-perigo);
}

.estado--ativo {
    --tom: var(--tom-ativo);
}

.estado--bloqueado {
    --tom: var(--tom-bloqueado);
}

.estado--concluido {
    --tom: var(--tom-concluido);
}

.estado--autorizacao {
    --tom: var(--tom-autorizacao);
}

.estado__cab {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
    min-height: 1.75rem;
}

.estado__cab .icone {
    color: var(--tom);
}

.estado__titulo {
    margin: 0;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tom);
}

.ajuda__botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--raio-pill);
    background: none;
    color: var(--texto-3);
    cursor: pointer;
}

.ajuda__botao:hover,
.ajuda__botao[aria-expanded="true"] {
    color: var(--texto);
    background: color-mix(in srgb, var(--tom) 18%, transparent);
}

.estado__cab .ajuda__botao .icone,
.lista-st__cab .ajuda__botao .icone {
    width: 1rem;
    height: 1rem;
    color: inherit;
}

.ajuda {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    right: 0;
    z-index: 5;
    padding: 0.75rem 0.875rem;
    background: var(--grey-500);
    border: 1px solid color-mix(in srgb, var(--tom) 45%, var(--linha));
    border-radius: var(--raio);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
    font-size: max(var(--letra-min), 0.8125rem);
    line-height: 1.45;
    color: var(--texto-2);
}

.ajuda p {
    margin: 0;
}

.ajuda p + p {
    margin-top: 0.5rem;
}

.ajuda__nota {
    color: var(--texto-3);
}

.lista-st .ajuda {
    right: auto;
    width: min(28rem, 100%);
}

.estado__conta {
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tom);
    font-variant-numeric: tabular-nums;
}

.estado__lista {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-top: 0.375rem;
    overflow: hidden;
}

.estado__vazio {
    margin: 0;
    padding-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--texto-3);
}

.estado__mais {
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 0.4375rem 0 0;
    border: 0;
    border-top: 1px solid var(--linha-suave);
    background: none;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    color: var(--texto-3);
    cursor: pointer;
}

.estado__mais:hover {
    color: var(--blue-200);
}

.viatura {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.125rem;
    padding: 0.25rem 0;
    border-top: 1px solid var(--linha-suave);
    color: inherit;
}

a.viatura {
    border-radius: var(--raio-input);
}

a.viatura:hover .matricula,
a.matricula:hover {
    box-shadow: 0 0 0 1px var(--blue-200);
}

a.viatura:focus-visible {
    outline-offset: -2px;
}

.viatura__l1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.viatura__l2 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.25;
}

.matricula {
    flex: 0 0 auto;
    padding: 0.0625rem 0.4375rem;
    border-radius: var(--raio-input);
    font: 600 0.875rem/1.35 var(--fonte-numerica);
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: color-mix(in srgb, var(--tom) 16%, transparent);
    color: color-mix(in srgb, var(--tom) 70%, var(--grey-50));
}

.viatura--atrasada .matricula {
    --tom: var(--tom-perigo);
}

.modelo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--texto-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.papel {
    display: flex;
    flex: 0 0 auto;
    color: var(--texto-3);
}

.papel--tecnico {
    color: var(--cor);
}

.gestor,
.tecnico {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gestor {
    color: var(--texto-3);
}

.tecnico {
    font-weight: 500;
    color: var(--cor, var(--texto-3));
}

.tecnico--vazio {
    font-weight: 400;
}

.tec-0 { --cor: var(--tec-0); }
.tec-1 { --cor: var(--tec-1); }
.tec-2 { --cor: var(--tec-2); }
.tec-3 { --cor: var(--tec-3); }
.tec-4 { --cor: var(--tec-4); }
.tec-5 { --cor: var(--tec-5); }
.tec-6 { --cor: var(--tec-6); }
.tec-7 { --cor: var(--tec-7); }
.tec-8 { --cor: var(--tec-8); }
.tec-9 { --cor: var(--tec-9); }
.tec-10 { --cor: var(--tec-10); }
.tec-11 { --cor: var(--tec-11); }

.pill {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.0625rem 0.5rem;
    border: 1px solid;
    border-radius: var(--raio-pill);
    font-family: var(--fonte);
    font-size: var(--letra-pequena);
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pill--perigo {
    color: var(--red-200);
    border-color: color-mix(in srgb, var(--danger-color) 45%, transparent);
    background: color-mix(in srgb, var(--danger-color) 14%, transparent);
}

.pill--aviso {
    color: var(--orange-100);
    border-color: color-mix(in srgb, var(--warning-color) 45%, transparent);
    background: color-mix(in srgb, var(--warning-color) 14%, transparent);
}

.pill--neutro {
    color: var(--texto-2);
    border-color: var(--linha);
    background: color-mix(in srgb, var(--tom-neutro) 10%, transparent);
}

.viatura--esqueleto {
    gap: 0.375rem;
    padding: 0.5rem 0;
}

.esqueleto {
    display: block;
    height: 0.8125rem;
    width: 60%;
    border-radius: var(--raio-input);
    background: var(--grey-500);
}

.esqueleto--l2 {
    width: 80%;
    height: 0.625rem;
    background: var(--grey-600);
}

@media (prefers-reduced-motion: no-preference) {
    .esqueleto {
        animation: esqueleto-pulsar 1.6s ease-in-out infinite;
    }
}

@keyframes esqueleto-pulsar {
    50% {
        opacity: 0.45;
    }
}

.lista-st {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
    min-height: 0;
    padding: 0.75rem 1rem;
    border-color: color-mix(in srgb, var(--tom) 30%, var(--linha));
}

.lista-st__cab {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.lista-st__cab .icone {
    color: var(--tom);
}

.lista-st__cab h2 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--texto-2);
}

.lista-st__meta {
    font-size: 0.8125rem;
    color: var(--texto-3);
}

.lista-st__voltar {
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: var(--raio-input);
    background: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--texto-3);
    cursor: pointer;
}

.lista-st__voltar:hover {
    color: var(--blue-200);
}

.lista-st__corpo {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.lista-st__tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.lista-st__tabela th {
    position: sticky;
    top: 0;
    padding: 0 1rem 0.375rem 0;
    border-bottom: 1px solid var(--linha);
    background: var(--superficie);
    font-size: var(--letra-pequena);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--texto-3);
    white-space: nowrap;
}

.lista-st__tabela td {
    padding: 0.5rem 1rem 0.5rem 0;
    border-bottom: 1px solid var(--linha-suave);
    font-family: var(--fonte-numerica);
    vertical-align: middle;
}

.lista-st__tabela th:last-child,
.lista-st__tabela td:last-child {
    padding-right: 0;
}

.lista-st__tabela .lista-st__texto {
    font-family: var(--fonte);
}

.lista-st__tabela th.lista-st__num,
.lista-st__tabela td.lista-st__num {
    text-align: right;
}

.lista-st__linha--ligacao {
    cursor: pointer;
}

.lista-st__linha--ligacao:hover td {
    background: color-mix(in srgb, var(--tom) 8%, transparent);
}

.lista-st__linha--ligacao:hover .matricula {
    box-shadow: 0 0 0 1px var(--blue-200);
}

.v-nulo {
    color: var(--texto-3);
}

.v-aviso {
    color: var(--warning-color);
    font-weight: 700;
}

.painel-estado {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.painel-estado .icone--estado {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--danger-color);
}

.painel-estado h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.painel-estado p {
    max-width: 36rem;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--texto-3);
}

html.pagina-login {
    font-size: 16px;
}

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login__caixa {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 20rem;
    padding: 2rem 1.75rem;
    text-align: center;
}

.login__caixa .marca {
    padding: 0.5rem 0.875rem;
}

.login__caixa .marca__logo {
    height: 2.25rem;
}

.login__titulo {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--texto-3);
}

.login__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.login__form input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--linha);
    border-radius: var(--raio-input);
    background: var(--poco);
    color: var(--texto);
    font: 600 1rem var(--fonte);
    text-align: center;
}

.login__form input::placeholder {
    color: var(--texto-3);
    font-weight: 400;
}

.login__form input:hover {
    border-color: var(--border-hover-color);
}

.login__form input:focus-visible {
    outline-offset: 1px;
}

.login__form button {
    padding: 0.625rem;
    border: 0;
    border-radius: var(--raio-input);
    background: var(--acento);
    color: var(--acento-contraste);
    font: 700 0.9375rem var(--fonte);
    letter-spacing: 0.04em;
    cursor: pointer;
}

.login__form button:hover {
    background: var(--blue-200);
}

.login__caixa .aviso {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1200px), (orientation: portrait) {
    html {
        font-size: 15px;
    }

    .painel {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .topo {
        flex: 0 0 auto;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .topo__titulo {
        flex: 1 1 auto;
        font-size: 1rem;
    }

    .topo .espaco {
        display: none;
    }

    .kpis,
    .estados {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpis {
        row-gap: 1rem;
    }

    .kpi + .kpi::before {
        display: none;
    }

    .estado {
        min-height: 20rem;
    }
}

@media (max-width: 720px) {
    .kpis,
    .estados {
        grid-template-columns: minmax(0, 1fr);
    }

    .topo__sep {
        display: none;
    }

    .lista-st__corpo {
        overflow-x: auto;
    }
}
