:root {
    --brand-navy: #172554;
    --brand-blue: #1e3a8a;
    --brand-orange: #ea580c;
    --surface: #f4f7fb;
}

body {
    color: #1e293b;
    background: var(--surface);
}

.admin-body {
    min-height: 100vh;
}

.app-navbar {
    background: linear-gradient(115deg, var(--brand-navy), var(--brand-blue));
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
}

.navbar-brand-mark {
    width: 28px !important;
    height: 35px !important;
    max-width: 28px;
    max-height: 35px;
    flex: 0 0 28px;
    object-fit: contain;
}

.navbar-brand {
    letter-spacing: .02em;
    gap: .35rem !important;
}

.brand-rbs {
    color: #f7aa2b;
    font-weight: 800;
}

.brand-express {
    color: #ef3f45;
    font-weight: 800;
}

.card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

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

.metric-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    right: -30px;
    top: -35px;
    background: rgba(255, 255, 255, .14);
}

.metric-card .metric-number {
    font-size: 2rem;
    font-weight: 800;
}

.metric-total { background: linear-gradient(135deg, #172554, #1e40af); color: white; }
.metric-today { background: linear-gradient(135deg, #0f766e, #14b8a6); color: white; }
.metric-pending { background: linear-gradient(135deg, #b45309, #f59e0b); color: white; }
.metric-delivered-today { background: linear-gradient(135deg, #047857, #10b981); color: white; }
.metric-delivered { background: linear-gradient(135deg, #166534, #22c55e); color: white; }

.quick-card {
    display: flex;
    height: 100%;
    min-height: 104px;
    padding: 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    align-items: center;
    gap: .9rem;
    color: #1e293b;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.quick-card:hover {
    border-color: #f7aa2b;
    color: var(--brand-navy);
    box-shadow: 0 14px 34px rgba(30, 58, 138, .12);
    transform: translateY(-2px);
}

.quick-icon {
    display: grid;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    place-items: center;
    flex: 0 0 44px;
    color: #fff;
    background: linear-gradient(135deg, #f7aa2b, #ef3f45);
    font-weight: 900;
}

.quick-card strong,
.quick-card small {
    display: block;
}

.quick-card small {
    margin-top: .15rem;
    color: #64748b;
}

.history-year {
    color: var(--brand-navy);
    font-size: 1.35rem;
    font-weight: 800;
}

.history-folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.history-folder {
    position: relative;
    display: flex;
    min-height: 132px;
    padding: 1.25rem;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    align-items: center;
    gap: 1rem;
    color: #334155;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.history-folder::before {
    position: absolute;
    top: -8px;
    left: 18px;
    width: 78px;
    height: 18px;
    border: 1px solid #dba716;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: #f8c84d;
    content: "";
}

.history-folder:hover,
.history-folder.active {
    border-color: #e4ad18;
    color: var(--brand-navy);
    box-shadow: 0 14px 34px rgba(180, 125, 9, .16);
    transform: translateY(-3px);
}

.history-folder.active {
    background: #fffaf0;
    box-shadow: 0 0 0 3px rgba(248, 200, 77, .28), 0 14px 34px rgba(180, 125, 9, .14);
}

.history-folder-icon {
    position: relative;
    width: 54px;
    height: 43px;
    border-radius: 7px;
    flex: 0 0 54px;
    background: linear-gradient(145deg, #ffd86f, #f4b728);
    box-shadow: inset 0 -5px 8px rgba(180, 125, 9, .12);
}

.history-folder-icon::before {
    position: absolute;
    top: -8px;
    left: 5px;
    width: 24px;
    height: 10px;
    border-radius: 5px 5px 0 0;
    background: #f4b728;
    content: "";
}

.history-folder-content {
    display: grid;
    min-width: 0;
}

.history-folder-content strong {
    color: var(--brand-navy);
    font-size: 1.08rem;
}

.history-folder-content span {
    color: #475569;
    font-size: .9rem;
}

.history-folder-content small {
    margin-top: .2rem;
    color: #64748b;
    line-height: 1.35;
}

.history-empty-icon {
    color: #e4ad18;
    font-size: 3rem;
    line-height: 1;
}

.page-heading {
    font-weight: 800;
    color: var(--brand-navy);
}

.table thead th {
    color: #475569;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.form-label {
    font-weight: 650;
    color: #334155;
}

.form-control,
.form-select {
    border-color: #dbe3ef;
    border-radius: 10px;
    padding: .65rem .8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .13);
}

.section-title {
    color: var(--brand-navy);
    font-size: 1rem;
    font-weight: 800;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgba(234, 88, 12, .16), transparent 25%),
        linear-gradient(140deg, #0f172a, #172554 55%, #1e3a8a);
}

.login-card {
    width: min(430px, calc(100% - 2rem));
}

.login-logo {
    width: 290px;
    max-width: 100%;
    height: auto;
}

.login-logo-wrap {
    display: flex;
    min-height: 105px;
    align-items: center;
    justify-content: center;
    padding: .25rem;
    background: #fff;
}

.detail-label {
    color: #64748b;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-value {
    font-weight: 650;
}

.occurrence-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.occurrence-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.public-header {
    background: linear-gradient(120deg, var(--brand-navy), var(--brand-blue));
    color: white;
}

.public-logo {
    width: 260px;
    max-width: 58vw;
    height: auto;
}

.public-logo-wrap {
    display: inline-flex;
    align-items: center;
    padding: .65rem .85rem;
    border-radius: 12px;
    background: #fff;
}

.scanner-box {
    padding: 1rem;
    border: 1px dashed #93c5fd;
    border-radius: 14px;
    background: #f8fbff;
}

.scanner-video {
    width: 100%;
    max-height: 320px;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: #0f172a;
    object-fit: cover;
}

.scanner-divider {
    display: flex;
    margin: .85rem 0;
    align-items: center;
    gap: .75rem;
    color: #64748b;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.scanner-divider::before,
.scanner-divider::after {
    height: 1px;
    flex: 1;
    background: #dbe3ef;
    content: "";
}

.driver-body {
    min-height: 100vh;
    background: #eef4fb;
}

.driver-header {
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}

.driver-minuta-list {
    display: grid;
    gap: 1rem;
}

.driver-minuta-card {
    border-radius: 18px;
}

.driver-chip {
    padding: .75rem;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
}

.driver-chip span,
.driver-chip strong {
    display: block;
}

.driver-chip span {
    color: #64748b;
    font-size: .76rem;
    text-transform: uppercase;
}

.driver-chip strong {
    color: var(--brand-navy);
}

.driver-occurrence {
    padding: .9rem;
    border: 1px dashed #f59e0b;
    border-radius: 12px;
    background: #fffbeb;
}

.driver-occurrence summary {
    color: #92400e;
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 767px) {
    .table-responsive .btn {
        margin-bottom: .25rem;
    }

    .history-folders {
        grid-template-columns: 1fr;
    }

    .history-folder {
        min-height: 112px;
    }

    .navbar-brand {
        max-width: 210px;
    }

    .quick-card {
        min-height: 92px;
    }
}
