:root {
    --brand-primary: #1f4b99;
    --brand-secondary: #2f6fdd;
    --brand-dark: #17305d;
    --page-bg: #f4f7fb;
    --card-bg: #ffffff;
    --border-soft: #dbe5f1;
    --text-muted-custom: #64748b;
    --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 26px 60px rgba(15, 23, 42, 0.12);
    --success-soft: #eaf7ef;
    --warning-soft: #fff4db;
    --danger-soft: #fdecec;
    --info-soft: #eef4ff;
}

body.app-shell {
    background:
        radial-gradient(circle at top left, rgba(47, 111, 221, 0.10), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--page-bg) 100%);
    color: #1e293b;
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(219, 229, 241, 0.8);
    position: relative;
    z-index: 1030;
    overflow: visible;
}

.topbar .navbar-brand {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--brand-dark);
}

.nav-pills-shell {
    background: #eef4ff;
    border-radius: 999px;
    padding: 0.35rem;
    display: inline-flex;
    gap: 0.35rem;
    overflow: visible;
}

.nav-pills-shell .nav-link {
    color: var(--brand-dark);
    border-radius: 999px;
    font-weight: 700;
    padding: 0.65rem 1.1rem;
}

.nav-pills-shell .nav-link.active,
.nav-pills-shell .nav-link:hover {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
}

.nav-dropdown-shell {
    position: relative;
    overflow: visible;
}

.nav-dropdown-shell .dropdown-toggle {
    border: 0;
    background: transparent;
}

.nav-dropdown-shell .dropdown-toggle::after {
    margin-left: 0.55rem;
}

.nav-dropdown-shell .dropdown-toggle.active,
.nav-dropdown-shell .dropdown-toggle:hover,
.nav-dropdown-shell .dropdown-toggle:focus {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
}

.nav-dropdown-shell .dropdown-menu {
    border: 0;
    border-radius: 18px;
    padding: 0.45rem;
    box-shadow: var(--shadow-soft);
    z-index: 2000;
}

.nav-dropdown-shell .dropdown-item {
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
}

.page-main {
    padding: 1.75rem 0 3rem;
}

.kiosk-page {
    min-height: 100vh;
}

.kiosk-page .page-main {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.kiosk-hero {
    box-shadow: var(--shadow-strong);
}

.kiosk-hero .page-subtitle {
    max-width: 760px;
}

.kiosk-sticky {
    position: sticky;
    top: 1.5rem;
}

.admin-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1050;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: rgba(23, 48, 93, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
    font-size: 0.92rem;
}

.admin-fab:hover {
    background: rgba(31, 75, 153, 0.96);
    color: #fff;
}

.admin-modal .modal-content {
    border-radius: 24px;
    border: 1px solid rgba(219, 229, 241, 0.9);
    box-shadow: var(--shadow-strong);
}

.admin-modal .modal-header,
.admin-modal .modal-footer {
    border: none;
}

.hero-card,
.content-card,
.filters-card,
.table-card,
.pagination-card,
.summary-card,
.field-card,
.camera-card,
.info-panel {
    background: var(--card-bg);
    border: 1px solid rgba(219, 229, 241, 0.9);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.hero-card {
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--brand-primary), #4f8cff, #7aa7ff);
}

.hero-icon,
.summary-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--brand-secondary);
    font-weight: 800;
}

.page-title {
    font-size: clamp(1.9rem, 2.4vw, 2.8rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.page-subtitle,
.section-subtitle,
.helper-text,
.empty-text {
    color: var(--text-muted-custom);
}

.section-title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.summary-card,
.info-panel {
    padding: 1.1rem 1.2rem;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.destino-counter-card {
    overflow: hidden;
    position: relative;
}

.destino-counter-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), #4f8cff, #7aa7ff);
}

.destino-counter-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    padding: 0;
    text-decoration: none;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1;
    font-weight: 800;
    color: var(--brand-primary);
}

.destino-counter-link:hover,
.destino-counter-link:focus {
    color: var(--brand-dark);
    text-decoration: underline;
}

.summary-label,
.info-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted-custom);
    font-weight: 700;
}

.summary-value,
.info-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--brand-dark);
    line-height: 1.1;
}

.form-label {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.45rem;
}

.required-mark {
    color: #c2410c;
    font-weight: 800;
    margin-left: 0.1rem;
}

.required-label {
    color: #334155;
}

.form-control,
.form-select,
.form-check-input {
    border-color: #cfd8e3;
}

.form-control,
.form-select {
    border-radius: 14px;
    padding: 0.8rem 0.95rem;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(47, 111, 221, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(47, 111, 221, 0.12);
}

.field-card {
    background: #fbfdff;
    border: 1px solid #e6edf5;
    padding: 1rem;
    height: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1.3rem;
    font-weight: 700;
    box-shadow: 0 14px 24px rgba(47, 111, 221, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #173f86, #255ec0);
}

.btn-soft {
    background: #eef4ff;
    color: var(--brand-primary);
    border: 1px solid #d5e3ff;
    border-radius: 14px;
    font-weight: 700;
}

.btn-soft:hover {
    background: #e2ecff;
    color: var(--brand-dark);
}

.btn-soft.active,
.btn-soft:active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-color: transparent;
    color: #fff;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.badge-info {
    background: #e8f0ff;
    color: var(--brand-primary);
}

.badge-success {
    background: var(--success-soft);
    color: #206a3c;
}

.badge-warning {
    background: var(--warning-soft);
    color: #8a5b00;
}

.badge-danger {
    background: var(--danger-soft);
    color: #8e2c2c;
}

.table-shell {
    overflow-x: auto;
    overflow-y: hidden;
}

.table-card {
    overflow: visible;
}

.records-table {
    width: 100%;
    min-width: 0;
    font-size: 0.82rem;
    table-layout: auto;
}

.condutores-table {
    width: 100%;
    min-width: 0;
    font-size: 0.86rem;
    table-layout: auto;
}

.table thead th {
    background: #eef4ff;
    color: var(--brand-dark);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
    white-space: nowrap;
    padding: 0.7rem 0.55rem;
}

.table tbody td {
    padding: 0.7rem 0.55rem;
    vertical-align: middle;
    border-color: #edf2f7;
}

.records-table td,
.records-table th {
    white-space: normal;
}

.records-table .col-destino,
.records-table .col-observacao {
    min-width: 0;
    max-width: 180px;
}

.records-table .col-lacres {
    min-width: 0;
    max-width: 170px;
}

.records-table .col-imagem {
    min-width: 0;
    max-width: 90px;
}

.records-table .col-acoes {
    min-width: 0;
}

.records-table .col-validacao {
    min-width: 0;
}

.records-table .col-timeline {
    min-width: 0;
    max-width: 210px;
}

.timeline-box {
    display: grid;
    gap: 0.55rem;
}

.timeline-item {
    display: grid;
    gap: 0.1rem;
}

.timeline-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted-custom);
}

.timeline-value {
    font-weight: 700;
    color: #0f172a;
}

.timeline-action {
    border: 0;
    cursor: pointer;
    text-align: left;
}

.timeline-divider {
    height: 1px;
    background: #e2e8f0;
}

.condutores-table td,
.condutores-table th {
    white-space: normal;
    overflow-wrap: anywhere;
}

.condutores-table thead th {
    padding: 0.75rem 0.6rem;
}

.condutores-table tbody td {
    padding: 0.78rem 0.6rem;
}

.condutores-table tbody tr {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.condutores-table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.condutores-table .fw-bold {
    letter-spacing: 0.01em;
}

.condutores-table .col-acoes {
    min-width: 0;
    max-width: 110px;
}

.condutores-table .col-motorista {
    min-width: 0;
    max-width: 180px;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.registro-row-clickable {
    cursor: pointer;
}

.registro-row-clickable:hover .timeline-value,
.registro-row-clickable:hover .fw-bold.text-dark {
    color: var(--brand-primary);
}

.timeline-action:hover {
    filter: brightness(0.98);
}

.table .stacked-lines {
    line-height: 1.45;
    color: #4f6177;
}

.compact-block {
    min-width: 0;
    max-width: 110px;
}

.compact-lines {
    display: grid;
    gap: 0.1rem;
    line-height: 1.15;
    color: #4f6177;
    font-variant-numeric: tabular-nums;
}

.compact-lines span {
    white-space: nowrap;
}

.footer {
    color: #64748b;
    padding: 18px 0 30px;
    text-align: center;
}

.alert-panel {
    border-radius: 18px;
    border: 1px solid transparent;
    padding: 1rem 1.1rem;
    font-weight: 600;
}

.alert-panel-success {
    background: #edf8f1;
    border-color: #cfe9d8;
    color: #1f6a3a;
}

.alert-panel-error {
    background: #fff1f1;
    border-color: #f2d0d0;
    color: #9d2a2a;
}

.camera-frame {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #0f172a;
    min-height: 280px;
    display: grid;
    place-items: center;
}

.camera-frame video {
    width: 100%;
    display: block;
}

.camera-help {
    background: #f8fbff;
    border: 1px dashed #cfd8e3;
    border-radius: 18px;
    padding: 1rem;
}

.choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: #f8fbff;
    border: 1px solid #dfe8f4;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    color: #334155;
}

.choice-chip .form-check-input {
    margin-top: 0;
}

.mono-input {
    font-family: "Consolas", "Courier New", monospace;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.image-preview {
    max-width: 72px;
    max-height: 54px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 8px 20px rgba(15, 35, 64, 0.08);
}

.page-link {
    border-radius: 10px;
    margin: 0 0.15rem;
    border-color: rgba(36, 52, 71, 0.12);
    color: var(--brand-primary);
    font-weight: 700;
}

.page-item.disabled .page-link {
    background: #f6f8fc;
    color: #6f8098;
}

@media (max-width: 991.98px) {
    .nav-pills-shell {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

@media (max-width: 767.98px) {
    .hero-card,
    .content-card,
    .filters-card,
    .table-card,
    .pagination-card,
    .summary-card,
    .field-card,
    .camera-card,
    .info-panel {
        border-radius: 20px;
    }

    .page-main {
        padding-top: 1.25rem;
    }

    .records-table {
        min-width: 0;
    }

    .condutores-table {
        min-width: 0;
    }

    .kiosk-page .page-main {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }

    .kiosk-sticky {
        position: static;
    }
}
