:root {
    --azul-escuro: #14243a;
    --azul: #2563eb;
    --verde: #10a981;
    --laranja: #f59e0b;
    --vermelho: #ef4444;
    --fundo: #f3f6fa;
    --texto: #263449;
    --branco: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: Arial, Helvetica, sans-serif;
}

.botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    color: var(--branco);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.botao:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.botao-azul {
    background: var(--azul);
}

.botao-verde {
    background: var(--verde);
}

.botao-laranja {
    background: var(--laranja);
}

.botao-vermelho {
    background: var(--vermelho);
}

.painel {
    padding: 22px;
    border: 1px solid #e7edf4;
    border-radius: 16px;
    background: var(--branco);
    box-shadow: 0 5px 18px rgb(20 36 58 / 6%);
}

@media (max-width: 600px) {
    .botao {
        width: 100%;
    }

    .painel {
        padding: 16px;
        border-radius: 12px;
    }
}

.pagina-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, #dbeafe 0, transparent 35%),
        linear-gradient(135deg, #eef4fb, #f8fafc);
}

.login-card {
    width: min(100%, 420px);
    padding: 38px;
    border: 1px solid #e2eaf3;
    border-radius: 22px;
    background: var(--branco);
    box-shadow: 0 20px 55px rgb(20 36 58 / 12%);
}

.marca-mantruck {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 17px;
    background: linear-gradient(135deg, #2563eb, #10a981);
    color: white;
    font-size: 20px;
    font-weight: 800;
}

.login-card h1 {
    margin: 0;
    color: var(--azul-escuro);
    text-align: center;
    font-size: 30px;
}

.login-subtitulo {
    margin: 8px 0 28px;
    color: #718096;
    text-align: center;
}

.login-card label {
    display: block;
    margin: 16px 0 7px;
    font-size: 14px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid #d7e0eb;
    border-radius: 10px;
    outline: none;
    font-size: 15px;
}

.login-card input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}

.botao-login {
    width: 100%;
    margin-top: 24px;
    min-height: 48px;
}

.login-card footer {
    margin-top: 26px;
    color: #8793a3;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 22px;
        border-radius: 18px;
    }
}

.pagina-dashboard {
    min-height: 100vh;
}

.topo-dashboard {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 5%;
    background: var(--azul-escuro);
    color: white;
}

.topo-dashboard strong {
    display: block;
    font-size: 20px;
}

.topo-dashboard span {
    color: #cbd5e1;
    font-size: 12px;
}

.usuario-dashboard {
    font-size: 14px;
}

.conteudo-dashboard {
    width: min(1200px, 92%);
    margin: 36px auto;
}

.titulo-dashboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.titulo-dashboard h1 {
    margin: 0;
    color: var(--azul-escuro);
}

.titulo-dashboard p {
    margin: 7px 0 0;
    color: #718096;
}

.grade-indicadores {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.indicador {
    padding: 22px;
    border: 1px solid #e7edf4;
    border-top: 4px solid #64748b;
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 18px rgb(20 36 58 / 5%);
}

.indicador span,
.indicador small {
    display: block;
    color: #718096;
}

.indicador strong {
    display: block;
    margin: 12px 0 8px;
    color: var(--azul-escuro);
    font-size: 32px;
}

.indicador-verde {
    border-top-color: var(--verde);
}

.indicador-laranja {
    border-top-color: var(--laranja);
}

.indicador-azul {
    border-top-color: var(--azul);
}

.indicador-vermelho {
    border-top-color: var(--vermelho);
}

@media (max-width: 760px) {
    .grade-indicadores {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .topo-dashboard {
        padding: 14px 4%;
    }

    .conteudo-dashboard {
        margin: 24px auto;
    }

    .titulo-dashboard {
        align-items: stretch;
        flex-direction: column;
    }

    .grade-indicadores {
        grid-template-columns: 1fr;
    }
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--fundo);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    background: var(--azul-escuro);
    color: white;
    transition: width 0.25s, transform 0.25s;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #10a981);
    font-weight: 800;
}

.sidebar-brand-text strong,
.sidebar-brand-text span {
    display: block;
}

.sidebar-brand-text span {
    margin-top: 4px;
    color: #b9c6d8;
    font-size: 11px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.sidebar-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 12px;
    border-radius: 10px;
    color: #d7e0ec;
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.ativo {
    background: #263b57;
    color: white;
}

.sidebar-link.ativo {
    box-shadow: inset 3px 0 #10a981;
}

.sidebar-icone {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    font-size: 19px;
}

.sidebar-usuario {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding: 16px 8px 4px;
    border-top: 1px solid rgb(255 255 255 / 12%);
    color: #d7e0ec;
    font-size: 13px;
}

.botao-sair {
    min-height: 38px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 9px;
    background: transparent;
    color: white;
    cursor: pointer;
}

.botao-sair:hover {
    background: #263b57;
}

.area-principal {
    width: calc(100% - 250px);
    min-height: 100vh;
    margin-left: 250px;
    transition: width 0.25s, margin-left 0.25s;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 26px;
    background: white;
    border-bottom: 1px solid #e7edf4;
}

.botao-menu {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #eef3f9;
    color: var(--azul-escuro);
    font-size: 20px;
    cursor: pointer;
}

.topbar-titulo {
    font-weight: 700;
    color: var(--azul-escuro);
}

.conteudo-principal {
    width: min(1200px, 94%);
    margin: 30px auto;
}

.sidebar-overlay {
    display: none;
}

.sidebar-recolhida .sidebar {
    width: 76px;
}

.sidebar-recolhida .sidebar-brand-text,
.sidebar-recolhida .sidebar-label {
    display: none;
}

.sidebar-recolhida .sidebar-brand {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.sidebar-recolhida .sidebar-link {
    justify-content: center;
    padding: 0;
}

.sidebar-recolhida .sidebar-usuario {
    justify-items: center;
}

.sidebar-recolhida .botao-sair {
    width: 42px;
    overflow: hidden;
    font-size: 0;
}

.sidebar-recolhida .botao-sair::after {
    content: "↪";
    font-size: 18px;
}

.sidebar-recolhida .area-principal {
    width: calc(100% - 76px);
    margin-left: 76px;
}

@media (max-width: 760px) {
    .sidebar {
        width: 270px;
        transform: translateX(-100%);
    }

    .sidebar-aberta .sidebar {
        transform: translateX(0);
    }

    .sidebar-aberta .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 15;
        display: block;
        background: rgb(15 23 42 / 45%);
    }

    .area-principal,
    .sidebar-recolhida .area-principal {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-recolhida .sidebar {
        width: 270px;
    }

    .sidebar-recolhida .sidebar-brand-text,
    .sidebar-recolhida .sidebar-label {
        display: initial;
    }

    .sidebar-recolhida .sidebar-link {
        justify-content: flex-start;
        padding: 0 12px;
    }

    .sidebar-recolhida .sidebar-usuario {
        justify-items: stretch;
    }

    .sidebar-recolhida .botao-sair {
        width: auto;
        font-size: 14px;
    }

    .sidebar-recolhida .botao-sair::after {
        content: none;
    }

    .topbar {
        padding: 0 16px;
    }

    .conteudo-principal {
        width: 92%;
        margin: 22px auto;
    }
}

.painel-veiculos {
    margin-bottom: 22px;
}

.painel-veiculos h2 {
    margin: 0 0 8px;
    color: var(--azul-escuro);
    font-size: 19px;
}

.form-veiculo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.form-veiculo-grid label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-veiculo-grid input,
.form-veiculo-grid select,
.form-veiculo-grid textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d7e0eb;
    border-radius: 9px;
    background: white;
    color: var(--texto);
    font: inherit;
}

.form-veiculo-grid textarea {
    resize: vertical;
}

.form-veiculo-grid input:focus,
.form-veiculo-grid select:focus,
.form-veiculo-grid textarea:focus {
    border-color: var(--azul);
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

.campo-completo {
    grid-column: 1 / -1;
}

.cabecalho-lista-veiculos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.cabecalho-lista-veiculos p {
    margin: 6px 0 0;
    color: #718096;
}

.tabela-veiculos-wrap {
    overflow-x: auto;
}

.tabela-veiculos {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.tabela-veiculos th,
.tabela-veiculos td {
    padding: 13px 12px;
    border-bottom: 1px solid #e7edf4;
    text-align: left;
    font-size: 14px;
}

.tabela-veiculos th {
    color: #718096;
    font-weight: 600;
}

.status-veiculo {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-ativo {
    background: #dcfce7;
    color: #15803d;
}

.status-inativo {
    background: #fee2e2;
    color: #b91c1c;
}

.estado-vazio {
    padding: 22px;
    border-radius: 10px;
    background: #f8fafc;
    color: #718096;
    text-align: center;
}

.mensagem-form {
    min-height: 20px;
    margin: 14px 0;
    font-size: 14px;
}

.mensagem-sucesso {
    color: #0b8f68;
}

.mensagem-erro {
    color: #dc2626;
}

@media (max-width: 600px) {
    .form-veiculo-grid {
        grid-template-columns: 1fr;
    }

    .campo-completo {
        grid-column: auto;
    }

    .cabecalho-lista-veiculos {
        align-items: stretch;
        flex-direction: column;
    }

    .cabecalho-lista-veiculos .botao {
        width: 100%;
    }
}

.painel-ordens {
    margin-bottom: 22px;
}

.painel-ordens h2 {
    margin: 0 0 8px;
    color: var(--azul-escuro);
    font-size: 19px;
}

.tabela-ordens {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.tabela-ordens th,
.tabela-ordens td {
    padding: 12px;
    border-bottom: 1px solid #e7edf4;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.tabela-ordens th {
    color: #718096;
    font-weight: 600;
}

.status-os {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.status-aberta {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-aguardando {
    background: #fef3c7;
    color: #b45309;
}

.status-em_andamento {
    background: #dcfce7;
    color: #15803d;
}

.status-concluida {
    background: #ccfbf1;
    color: #0f766e;
}

.status-cancelada {
    background: #fee2e2;
    color: #b91c1c;
}

.acoes-ordem {
    display: flex;
    gap: 6px;
}

.botao-pequeno {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 12px;
}

@media (max-width: 600px) {
    .acoes-ordem {
        flex-direction: column;
    }
}

.painel-programacoes {
    margin-bottom: 22px;
}

.painel-programacoes h2 {
    margin: 0 0 8px;
    color: var(--azul-escuro);
    font-size: 19px;
}

.texto-apoio {
    margin: 6px 0 18px;
    color: #718096;
}

.tabela-programacoes {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.tabela-programacoes th,
.tabela-programacoes td {
    padding: 12px;
    border-bottom: 1px solid #e7edf4;
    text-align: left;
    font-size: 13px;
}

.tabela-programacoes th {
    color: #718096;
    font-weight: 600;
}

.grade-alertas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.cartao-alerta {
    padding: 16px;
    border: 1px solid #e7edf4;
    border-left: 4px solid var(--laranja);
    border-radius: 12px;
    background: #fff;
}

.alerta-atrasado {
    border-left-color: var(--vermelho);
}

.alerta-proximo {
    border-left-color: var(--laranja);
}

.alerta-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.alerta-cabecalho span {
    color: #9a6700;
    font-size: 12px;
    font-weight: 700;
}

.alerta-atrasado .alerta-cabecalho span {
    color: #b91c1c;
}

.cartao-alerta p {
    margin: 10px 0 6px;
    color: var(--texto);
    font-size: 14px;
}

.cartao-alerta small {
    color: #718096;
}

@media (max-width: 650px) {
    .grade-alertas {
        grid-template-columns: 1fr;
    }
}

.modal-itens {
    width: min(760px, calc(100% - 28px));
    max-height: 90vh;
    padding: 24px;
    border: 0;
    border-radius: 18px;
    color: var(--texto);
    box-shadow: 0 24px 80px rgb(15 23 42 / 25%);
}

.modal-itens::backdrop {
    background: rgb(15 23 42 / 55%);
}

.modal-itens-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-itens-cabecalho h2,
.lista-itens-modal h3 {
    margin: 0;
    color: var(--azul-escuro);
}

.modal-itens-cabecalho p {
    margin: 6px 0 0;
    color: #718096;
}

.botao-fechar-modal {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #eef3f9;
    color: var(--azul-escuro);
    font-size: 25px;
    cursor: pointer;
}

.lista-itens-modal {
    margin-top: 26px;
}

.lista-itens-modal h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.tabela-itens {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.tabela-itens th,
.tabela-itens td {
    padding: 10px;
    border-bottom: 1px solid #e7edf4;
    text-align: left;
    font-size: 13px;
}

.tabela-itens th {
    color: #718096;
}

@media (max-width: 600px) {
    .modal-itens {
        padding: 18px;
    }

    .modal-itens .form-veiculo-grid {
        grid-template-columns: 1fr;
    }
}

#form-odometro > label {
    display: block;
    margin: 14px 0 7px;
    font-size: 14px;
    font-weight: 600;
}

#form-odometro > input,
#form-odometro > textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d7e0eb;
    border-radius: 9px;
    font: inherit;
}

#form-odometro > input:focus,
#form-odometro > textarea:focus {
    border-color: var(--azul);
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

.acoes-veiculo {
    white-space: nowrap;
}

.conteudo-principal {
    display: block;
}

.painel-ordens {
    display: block;
    width: 100%;
    max-width: none;
}

#form-ordem {
    display: block;
    width: 100%;
}

#form-ordem .form-veiculo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

#campo-programacao[hidden] {
    display: none !important;
}

#form-ordem > button[type="submit"] {
    width: auto;
    height: auto;
    min-height: 42px;
}

@media (max-width: 650px) {
    #form-ordem .form-veiculo-grid {
        grid-template-columns: 1fr;
    }
}

.grade-resumo-alertas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.painel-alertas {
    width: 100%;
}

.alerta-clicavel {
    display: block;
    width: 100%;
    color: var(--texto);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.alerta-clicavel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(20 36 58 / 10%);
}

.alerta-clicavel:focus-visible {
    outline: 3px solid rgb(37 99 235 / 35%);
}

.alerta-cabecalho,
.alerta-veiculo,
.alerta-clicavel small,
.alerta-abrir {
    display: block;
}

.alerta-veiculo {
    margin: 10px 0 6px;
    font-size: 14px;
}

.alerta-abrir {
    margin-top: 10px;
    color: var(--azul);
    font-size: 12px;
    font-weight: 600;
}

.detalhes-alerta p {
    margin: 12px 0;
}

.motivo-alerta {
    padding: 12px;
    border-radius: 9px;
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 600px) {
    .grade-resumo-alertas {
        grid-template-columns: 1fr;
    }
}