﻿/* =========================================================
   Cubic — tema visual
   Cores da marca: turquesa do logo + tinta escura.
   ========================================================= */

:root {
    --app-primary: #0f766e;
    --app-primary-hover: #115e59;
    --app-primary-soft: #e6f4f2;
    --app-accent: #2dd4bf;
    --app-ink: #0f172a;
    --app-text: #1e293b;
    --app-muted: #64748b;
    --app-bg: #f4f6f9;
    --app-surface: #ffffff;
    --app-border: #e2e8f0;
    --app-radius: 12px;
    --app-radius-sm: 8px;
    --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
    --app-header-h: 64px;

    --bs-primary: var(--app-primary);
    --bs-primary-rgb: 15, 118, 110;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-font-sans-serif: var(--bs-body-font-family);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: var(--app-bg);
    color: var(--app-text);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--app-primary);
}

    a:hover {
        color: var(--app-primary-hover);
    }

h1, h2, h3, h4, h5, h6 {
    color: var(--app-ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

/* ---------- Layout ---------- */

.app-container {
    max-width: 1440px;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .app-container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.main-container {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 24px;
}

/* Várias páginas trazem o próprio .container; dentro do layout ele não deve estreitar nem somar padding. */
.main-container main > .container,
.main-container main > .container-fluid {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--app-border);
}

    .app-header .navbar {
        min-height: var(--app-header-h);
        padding-top: 8px;
        padding-bottom: 8px;
    }

/* O PNG do logo é quadrado com muita margem: recorta só a faixa do logotipo. */
.brand-logo {
    display: block;
    width: 132px;
    height: 30px;
    object-fit: cover;
    object-position: center;
}

.app-header .navbar-toggler {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    padding: 4px 10px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--app-ink);
}

    .app-header .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(15, 118, 110, .2);
    }

.app-header .nav-link {
    color: var(--app-muted);
    font-weight: 500;
    border-radius: var(--app-radius-sm);
    padding: 8px 12px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color .15s, color .15s;
}

    .app-header .nav-link:hover,
    .app-header .nav-link:focus {
        color: var(--app-ink);
        background-color: #f1f5f9;
    }

    .app-header .nav-link.active {
        color: var(--app-primary);
        background-color: var(--app-primary-soft);
    }

@media (min-width: 1200px) {
    .app-header .navbar-nav {
        gap: 2px;
    }

    .app-header .navbar-brand {
        margin-right: 24px;
    }
}

@media (max-width: 1199.98px) {
    .app-header .navbar-collapse {
        padding: 8px 0 12px;
    }

    .app-header .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 12px;
        background: transparent;
    }
}

.user-menu .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
}

.user-menu .user-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .1);
    padding: 6px;
}

.dropdown-item {
    border-radius: var(--app-radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .dropdown-item:active {
        background-color: var(--app-primary);
    }

.app-footer {
    border-top: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-muted);
    font-size: .85rem;
    padding: 16px 0;
    margin-top: auto;
    text-align: center;
}

/* ---------- Cabeçalho de página ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.6rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .page-title > i {
        color: var(--app-primary);
        font-size: .9em;
    }

.page-subtitle {
    color: var(--app-muted);
    margin: 4px 0 0;
}

.count-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    padding: 6px 14px;
    color: var(--app-muted);
    font-size: .9rem;
}

    .count-pill strong {
        color: var(--app-ink);
    }

.breadcrumb {
    font-size: .85rem;
}

/* ---------- Cards ---------- */

.card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    background: var(--app-surface);
}

    .card.border-0 {
        border: 1px solid var(--app-border) !important;
    }

.card-header {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: 14px 20px;
}

    .card-header:first-child {
        border-radius: calc(var(--app-radius) - 1px) calc(var(--app-radius) - 1px) 0 0;
    }

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8fafc;
    border-top: 1px solid var(--app-border);
}

.card > .card-body.p-0 > .table-responsive:last-child,
.card > .table-responsive:last-child {
    border-radius: 0 0 var(--app-radius) var(--app-radius);
}

.stat-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    padding: 16px 20px;
    height: 100%;
}

.stat-label {
    color: var(--app-muted);
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--app-ink);
    margin-top: 4px;
}

.stat-value-sm {
    font-size: 1.05rem;
}

/* ---------- Botões ---------- */

.btn {
    border-radius: var(--app-radius-sm);
    font-weight: 500;
}

.btn-lg {
    border-radius: 10px;
}

.btn-primary,
.btn-primary:focus {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
}

    .btn-primary:hover,
    .btn-primary:active,
    .btn-check:checked + .btn-primary,
    .show > .btn-primary.dropdown-toggle {
        background-color: var(--app-primary-hover);
        border-color: var(--app-primary-hover);
        color: #fff;
    }

.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--app-primary);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:active,
    .btn-check:checked + .btn-outline-primary {
        background-color: var(--app-primary);
        border-color: var(--app-primary);
        color: #fff;
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .2);
}

.btn-dark-custom {
    background-color: #2c3136;
    color: #ffffff;
    border: none;
    letter-spacing: 0.5px;
}

    .btn-dark-custom:hover {
        background-color: #1a1e21;
        color: #ffffff;
    }

/* ---------- Cor primária (Bootstrap 5.1 usa cores fixas) ---------- */

.text-primary {
    color: var(--app-primary) !important;
}

.bg-primary {
    background-color: var(--app-primary) !important;
}

.border-primary {
    border-color: var(--app-primary) !important;
}

.link-primary {
    color: var(--app-primary) !important;
}

.form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #5eada6;
}

.page-link {
    color: var(--app-primary);
    border-radius: var(--app-radius-sm);
}

.page-item.active .page-link {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.nav-pills .nav-link.active {
    background-color: var(--app-primary);
}

.nav-tabs .nav-link.active {
    color: var(--app-primary);
}

.progress-bar {
    background-color: var(--app-primary);
}

/* Equivalentes das classes "-subtle" do Bootstrap 5.3 */
.bg-primary-subtle {
    background-color: var(--app-primary-soft) !important;
    color: var(--app-primary) !important;
}

.bg-secondary-subtle {
    background-color: #f1f5f9 !important;
    color: var(--app-muted) !important;
}

.bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.border-secondary-subtle {
    border-color: var(--app-border) !important;
}

.text-info-emphasis {
    color: #055160 !important;
}

/* ---------- Formulários ---------- */

.form-control, .form-select, .input-group-text {
    border-color: #d5dde7;
    border-radius: var(--app-radius-sm);
}

.form-label {
    font-weight: 500;
}

/* ---------- Tabelas ---------- */

.table {
    --bs-table-hover-bg: rgba(15, 118, 110, .045);
    color: var(--app-text);
    margin-bottom: 0;
}

    .table > thead th {
        background-color: #f8fafc;
        color: var(--app-muted);
        font-size: .75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        border-bottom: 1px solid var(--app-border);
        white-space: nowrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .table > thead.table-dark th,
    .table > thead.table-light th {
        background-color: #f8fafc;
        color: var(--app-muted);
        border-color: var(--app-border);
    }

    .table > :not(:first-child) {
        border-top: 0;
    }

    .table td {
        border-color: #eef2f6;
    }

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

    .table-responsive.rounded,
    .card-body > .table-responsive:only-child {
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius) !important;
        background: var(--app-surface);
    }

.card .card-body.p-0 > .table-responsive:only-child {
    border: 0;
}

/* ---------- Badges e alertas ---------- */

.badge {
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: .01em;
}

    .badge.rounded-pill {
        border-radius: 999px;
    }

.alert {
    border-radius: var(--app-radius);
    border-width: 1px;
}

/* ---------- Legenda de cores ---------- */

.legend-card .card-body {
    padding: 12px 20px;
}

.legend-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--app-muted);
    margin-bottom: 8px;
}

.color-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: .85rem;
    color: var(--app-muted);
}

    .color-legend li {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

.color-legend-stacked {
    flex-direction: column;
    gap: 12px;
}

    .color-legend-stacked li {
        align-items: flex-start;
        gap: 10px;
    }

        .color-legend-stacked li .badge {
            min-width: 110px;
        }

.legend-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, .12);
    flex-shrink: 0;
}

.legend-swatch-success {
    background: #d1e7dd;
}

.legend-swatch-warning {
    background: #fff3cd;
}

.legend-swatch-secondary {
    background: #e2e3e5;
}

.legend-swatch-info {
    background: #cff4fc;
}

.legend-swatch-danger {
    background: #f8d7da;
}

/* ---------- Página de carros ---------- */

.bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.bulk-actions-label {
    color: var(--app-muted);
    font-size: .85rem;
    font-weight: 500;
    margin-right: auto;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 12px 16px;
}

/* ---------- Balanço de massa ---------- */

.material-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 16px;
    height: 100%;
    background: #fbfcfd;
}

.material-card-title {
    font-weight: 700;
    color: var(--app-ink);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .material-card-title i {
        color: var(--app-primary);
    }

.material-card-results {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--app-border);
}

.result-label {
    font-size: .75rem;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* ---------- Login ---------- */

.custom-field-wrapper {
    background-color: #eef1f4;
    border-radius: 10px;
    padding: 6px 0;
}

    .custom-field-wrapper input:focus {
        background-color: transparent !important;
    }

    .custom-field-wrapper input::placeholder {
        color: #9ea3a9;
        font-weight: 600;
    }

    .custom-field-wrapper .input-group-text,
    .custom-field-wrapper .btn {
        color: #8c9094 !important;
    }

    .custom-field-wrapper input:-webkit-autofill,
    .custom-field-wrapper input:-webkit-autofill:hover,
    .custom-field-wrapper input:-webkit-autofill:focus,
    .custom-field-wrapper input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 30px #eef1f4 inset !important;
        -webkit-text-fill-color: #6c757d !important;
        font-weight: 700 !important;
        border: none !important;
    }

/* ---------- Celular ---------- */

@media (max-width: 767.98px) {
    .main-container {
        padding-top: 16px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    h1, .h1 {
        font-size: 1.5rem;
    }

    h2, .h2 {
        font-size: 1.3rem;
    }

    h3, .h3 {
        font-size: 1.15rem;
    }

    .display-4, .display-5, .display-6 {
        font-size: 2rem;
    }

    .card-body {
        padding: 14px;
    }

    .card-header {
        padding: 12px 14px;
    }

    /* Cabeçalhos com título + botões quebram linha em vez de estourar a tela. */
    main .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 8px;
    }

    main .btn-group {
        flex-wrap: wrap;
    }

    .bulk-actions .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .bulk-actions-label {
        flex-basis: 100%;
    }

    .filter-actions {
        flex: 1;
    }

        .filter-actions .btn {
            flex: 1;
        }

    .pager {
        justify-content: center;
        text-align: center;
    }

    .table {
        font-size: .9rem;
    }

    .alert {
        font-size: .9rem;
    }

    /* Tabela vira lista de cartões no celular (usa data-label em cada td). */
    .table-stack thead {
        display: none;
    }

    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

        .table-stack tr {
            border-bottom: 1px solid var(--app-border);
            padding: 8px 14px;
        }

        .table-stack td {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            border: 0;
            padding: 4px 0 !important;
            text-align: right !important;
        }

            .table-stack td[data-label]::before {
                content: attr(data-label);
                color: var(--app-muted);
                font-weight: 500;
                text-align: left;
            }

            .table-stack td[colspan] {
                justify-content: center;
                text-align: center !important;
            }
}

/* ---------- Modal de confirmação ---------- */

.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.app-confirm-modal .modal-dialog {
    max-width: 420px;
}

.app-confirm-modal .modal-body {
    text-align: center;
    padding: 28px 28px 8px;
}

.app-confirm-modal .modal-footer {
    border-top: 0;
    padding: 12px 28px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .app-confirm-modal .modal-footer.single-action {
        grid-template-columns: 1fr;
    }

    .app-confirm-modal .modal-footer .btn {
        margin: 0;
        padding-top: 10px;
        padding-bottom: 10px;
    }

.app-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 14px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.app-confirm-icon-danger {
    background: #fee2e2;
    color: #dc2626;
}

.app-confirm-icon-warning {
    background: #fef3c7;
    color: #d97706;
}

.app-confirm-icon-success {
    background: #dcfce7;
    color: #16a34a;
}

.app-confirm-title {
    margin-bottom: 8px;
}

.app-confirm-message {
    color: var(--app-muted);
    margin-bottom: 0;
}

/* ---------- Toasts ---------- */

.app-toast-container {
    position: fixed;
    top: calc(var(--app-header-h) + 12px);
    right: 16px;
    left: auto;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 32px));
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--app-radius);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-left-width: 4px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .15);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s;
}

    .app-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

    .app-toast > i {
        font-size: 1.15rem;
        line-height: 1.3;
    }

    .app-toast > span {
        flex: 1;
    }

.app-toast-success { border-left-color: #16a34a; }
.app-toast-success > i { color: #16a34a; }
.app-toast-danger { border-left-color: #dc2626; }
.app-toast-danger > i { color: #dc2626; }
.app-toast-warning { border-left-color: #d97706; }
.app-toast-warning > i { color: #d97706; }
.app-toast-info { border-left-color: var(--app-primary); }
.app-toast-info > i { color: var(--app-primary); }

.app-toast-close {
    border: 0;
    background: transparent;
    color: var(--app-muted);
    padding: 0;
    line-height: 1;
    font-size: 1.2rem;
}

@media (max-width: 575.98px) {
    .app-toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ---------- Enviar fotos (captura) ---------- */

.capture-page {
    max-width: 640px;
    margin: 0 auto;
}

.capture-step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--app-ink);
    margin-bottom: 12px;
}

    .capture-step-label span {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--app-primary);
        color: #fff;
        font-size: .8rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

.plate-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-align: center;
    text-transform: uppercase;
    padding: 10px;
}

.plate-status {
    font-size: .875rem;
    margin-top: 8px;
    min-height: 1.3em;
}

.text-warning-emphasis {
    color: #92400e !important;
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 576px) {
    .stage-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stage-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding: 12px 8px;
    border: 2px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    color: var(--app-muted);
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.2;
    text-align: center;
    transition: border-color .15s, background-color .15s, color .15s;
}

    .stage-option > i {
        font-size: 1.4rem;
    }

    .stage-option:hover {
        border-color: #b6c6d6;
    }

    .stage-option.selected {
        border-color: var(--app-primary);
        background: var(--app-primary-soft);
        color: var(--app-primary);
    }

    .stage-option .stage-done {
        display: none;
        position: absolute;
        top: 6px;
        right: 8px;
        color: #16a34a;
    }

    .stage-option.done .stage-done {
        display: block;
    }

.camera-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #0b1220;
    border-radius: var(--app-radius);
    overflow: hidden;
}

    .camera-frame video,
    .camera-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.camera-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: #cbd5e1;
}

    .camera-message i {
        font-size: 2.2rem;
    }

.capture-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

    .capture-actions > .btn {
        flex: 1;
    }

    .capture-actions > #btnCapture,
    .capture-actions > #btnRetake {
        flex: 2;
    }

/* ---------- Página inicial ---------- */

.home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 28px 28px;
    margin-bottom: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(45, 212, 191, .45), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
}

    .home-hero::after {
        content: "";
        position: absolute;
        right: -40px;
        bottom: -60px;
        width: 220px;
        height: 220px;
        border: 3px solid rgba(45, 212, 191, .35);
        border-radius: 28px;
        transform: rotate(18deg);
    }

.home-eyebrow {
    text-transform: capitalize;
    color: #99f6e4;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.home-title {
    color: #fff;
    font-size: 1.9rem;
    margin-bottom: 4px;
}

.home-subtitle {
    color: #cbd5e1;
    margin: 0;
}

.home-section-title {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--app-muted);
    margin-bottom: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: 100%;
    padding: 20px;
    text-align: left;
    text-decoration: none;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

    .quick-action:hover {
        color: var(--app-text);
        transform: translateY(-2px);
        border-color: #b6d9d5;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
    }

.quick-action-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.quick-action-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-action-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--app-ink);
}

.quick-action-text {
    color: var(--app-muted);
    font-size: .9rem;
}

.quick-action-arrow {
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--app-muted);
    transition: transform .15s;
}

.quick-action:hover .quick-action-arrow {
    transform: translateX(3px);
    color: var(--app-primary);
}

.quick-action-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

    .quick-action-primary .quick-action-icon {
        background: rgba(255, 255, 255, .15);
        color: #fff;
    }

    .quick-action-primary .quick-action-title,
    .quick-action-primary .quick-action-arrow {
        color: #fff;
    }

    .quick-action-primary .quick-action-text {
        color: #ccfbf1;
    }

    .quick-action-primary:hover {
        border-color: var(--app-primary-hover);
        background: var(--app-primary-hover);
    }

        .quick-action-primary:hover .quick-action-arrow {
            color: #fff;
        }

.module-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 18px;
    text-decoration: none;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

    .module-card:hover {
        transform: translateY(-2px);
        border-color: #cbd5e1;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
    }

.module-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.module-icon-teal { background: #ccfbf1; color: #0f766e; }
.module-icon-blue { background: #dbeafe; color: #1d4ed8; }
.module-icon-slate { background: #e2e8f0; color: #334155; }
.module-icon-indigo { background: #e0e7ff; color: #4338ca; }
.module-icon-green { background: #dcfce7; color: #15803d; }
.module-icon-rose { background: #ffe4e6; color: #be123c; }
.module-icon-amber { background: #fef3c7; color: #b45309; }
.module-icon-cyan { background: #cffafe; color: #0e7490; }

.module-title {
    font-weight: 700;
    color: var(--app-ink);
}

.module-text {
    color: var(--app-muted);
    font-size: .875rem;
}

.upload-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    text-decoration: none;
    color: var(--app-text);
    transition: border-color .15s, background-color .15s;
}

    .upload-option:hover {
        color: var(--app-text);
        border-color: var(--app-primary);
        background: var(--app-primary-soft);
    }

    .upload-option .module-icon {
        margin-bottom: 0;
    }

.upload-option-title {
    display: block;
    font-weight: 600;
    color: var(--app-ink);
}

.upload-option-text {
    display: block;
    font-size: .85rem;
    color: var(--app-muted);
}

@media (max-width: 575.98px) {
    .home-hero {
        padding: 22px 20px;
    }

    .home-title {
        font-size: 1.5rem;
    }

    .quick-action {
        padding: 16px;
    }
}

/* ---------- Navbar (itens em uma linha só) ---------- */

.app-header .nav-link,
.app-header .dropdown-item,
.app-header .nav-cta {
    white-space: nowrap;
}

.app-header .navbar-actions {
    align-items: center;
    gap: 8px;
}

.app-header .nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 600;
}

.app-header .dropdown-header {
    padding: 6px 12px 4px;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .app-header .navbar-actions .nav-item + .nav-item {
        margin-left: 4px;
        padding-left: 12px;
        border-left: 1px solid var(--app-border);
    }
}

@media (max-width: 1199.98px) {
    .app-header .navbar-actions {
        align-items: stretch;
        border-top: 1px solid var(--app-border);
        margin-top: 8px;
        padding-top: 10px;
    }

    .app-header .nav-cta {
        justify-content: center;
        width: 100%;
        padding: 10px 14px;
    }
}

/* ---------- Uso de APIs ---------- */

.segmented {
    display: inline-flex;
    padding: 3px;
    background: #eef2f6;
    border-radius: 10px;
    gap: 2px;
}

    .segmented a {
        padding: 6px 14px;
        border-radius: 8px;
        color: var(--app-muted);
        font-weight: 500;
        text-decoration: none;
        white-space: nowrap;
    }

        .segmented a:hover {
            color: var(--app-ink);
        }

        .segmented a.active {
            background: var(--app-surface);
            color: var(--app-ink);
            box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
        }

.stat-hint {
    color: var(--app-muted);
    font-size: .78rem;
    margin-top: 2px;
}

.usage-progress {
    height: 8px;
    border-radius: 999px;
    background: #eef2f6;
}

    .usage-progress .progress-bar {
        border-radius: 999px;
    }

    .usage-progress .progress-bar.bg-success {
        background-color: #16a34a !important;
    }

.api-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
}

.api-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

    .api-card-head .module-icon {
        margin-bottom: 0;
    }

.min-w-0 {
    min-width: 0;
}

.api-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 0;
}

    .api-stats div {
        background: #f8fafc;
        border-radius: 10px;
        padding: 8px 10px;
    }

    .api-stats dt {
        font-size: .72rem;
        font-weight: 500;
        color: var(--app-muted);
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .api-stats dd {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--app-ink);
    }

.api-alert {
    margin-top: 10px;
    font-size: .85rem;
    color: #92400e;
    background: #fef3c7;
    border-radius: 8px;
    padding: 6px 10px;
}

.api-card-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    font-size: .8rem;
    color: var(--app-muted);
}

.chart-wrap {
    position: relative;
}

.usage-chart-svg {
    display: block;
    max-width: 100%;
}

.chart-grid {
    stroke: #eef2f6;
    stroke-width: 1;
}

.chart-baseline {
    stroke: #cbd5e1;
}

.chart-axis {
    fill: var(--app-muted);
    font-size: 11px;
    font-family: var(--bs-body-font-family);
}

.chart-bar {
    fill: var(--app-primary);
}

.chart-hit {
    fill: transparent;
    cursor: default;
}

    .chart-hit.hover {
        fill: rgba(15, 118, 110, .07);
    }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--app-ink);
    color: #fff;
    font-size: .8rem;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 5;
}

    .chart-tooltip .text-danger {
        color: #fca5a5 !important;
    }

.error-message {
    max-width: 420px;
    word-break: break-word;
}

.config-sample {
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .8rem;
    color: var(--app-text);
}

@media (max-width: 767.98px) {
    .page-header .segmented {
        width: 100%;
    }

        .page-header .segmented a {
            flex: 1;
            text-align: center;
        }
}

.api-cost {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 0 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #eef2ff;
    color: #3730a3;
    font-size: .85rem;
}

    .api-cost strong {
        font-size: 1.05rem;
    }

    .api-cost small {
        grid-column: 1 / -1;
        color: #6366f1;
    }

.stage-hint {
    font-size: .85rem;
    color: var(--app-muted);
    margin-top: 8px;
}

.stage-grid.stage-missing .stage-option {
    border-color: #f87171;
    background: #fef2f2;
}

.stage-grid.stage-missing {
    animation: stage-shake .35s ease-in-out;
}

@keyframes stage-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .stage-grid.stage-missing {
        animation: none;
    }
}

/* ---------- Documentos do veículo ---------- */

.doc-group {
    height: 100%;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 14px;
    background: #fbfcfd;
}

.doc-group-missing {
    border-color: #fecaca;
    background: #fffafa;
}

.doc-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .doc-group-head .module-icon {
        margin-bottom: 0;
    }

.doc-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .doc-list li {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 8px;
    }

.doc-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .875rem;
}

td.doc-name {
    max-width: 320px;
}

.upload-doc-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

    .upload-doc-types span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 12px;
        border-radius: 999px;
        background: var(--app-primary-soft);
        color: var(--app-primary);
        font-size: .85rem;
        font-weight: 500;
    }

/* ---------- Peças do veículo (ficha de inspeção) ---------- */

.sheet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

@media (min-width: 992px) {
    .sheet-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    }
}

.sheet-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border-radius: 6px;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

    .sheet-table th,
    .sheet-table td {
        border: 1px solid #cbd5e1;
        padding: 4px 8px;
        vertical-align: middle;
    }

    .sheet-table thead th {
        background: #f8fafc;
        text-align: center;
        font-weight: 600;
        white-space: nowrap;
    }

.sheet-report th {
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .02em;
    white-space: nowrap;
    width: 1%;
}

.sheet-report td {
    font-family: var(--bs-font-monospace);
    min-width: 90px;
}

.sheet-components {
    min-width: 620px;
}

.sheet-mark {
    text-align: center;
    font-weight: 700;
    width: 12%;
    white-space: nowrap;
}

.sheet-checklist .sheet-mark {
    width: 52px;
}

.sheet-component {
    white-space: nowrap;
}

.sheet-level-0 { padding-left: 8px !important; }
.sheet-level-1 { padding-left: 22px !important; }
.sheet-level-2 { padding-left: 40px !important; }

.sheet-group-accepted { color: #15803d; }
.sheet-group-rejected { color: #be123c; }

.sheet-cell-accepted { background: #dcfce7; color: #15803d; }
.sheet-cell-rejected { background: #ffe4e6; color: #be123c; }
.sheet-cell-na { background: #f1f5f9; color: var(--app-muted); }

.part-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.part-status-accepted { background: #dcfce7; color: #15803d; }
.part-status-rejected { background: #ffe4e6; color: #be123c; }
.part-status-na { background: #e2e8f0; color: #334155; }
.part-status-none { background: transparent; color: var(--app-muted); font-weight: 500; }

.sheet-notes {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    min-height: 64px;
    white-space: pre-line;
}

.sheet-notes-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
