:root {
    --ds-navy: #0b1425;
    --ds-navy-soft: #111e35;
    --ds-primary: #2563eb;
    --ds-primary-dark: #1d4ed8;
    --ds-primary-soft: #eff5ff;
    --ds-accent: #f59e0b;
    --ds-cyan: #06b6d4;
    --ds-success: #10b981;
    --ds-danger: #ef4444;
    --ds-text: #1e293b;
    --ds-muted: #64748b;
    --ds-line: #e6ecf5;
    --ds-body: #f3f6fb;
    --ds-sidebar-width: 268px;
    --ds-radius: 16px;
    --ds-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--ds-body);
    color: var(--ds-text);
    font-size: .9rem;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -.015em; color: #0f172a; }

a { text-decoration: none; }

/* ---------- Shell ---------- */
.ds-shell { display: flex; min-height: 100vh; }

.ds-sidebar {
    width: var(--ds-sidebar-width);
    background: linear-gradient(180deg, var(--ds-navy) 0%, #0d1830 100%);
    color: #cbd5e1;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
    border-right: 1px solid rgba(148, 163, 184, .08);
}

.ds-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.35rem 1.4rem 1.1rem;
    color: #fff;
}

.ds-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #0b1425;
    box-shadow: 0 8px 18px rgba(245, 158, 11, .28);
    flex: 0 0 auto;
}

.ds-brand-name { font-weight: 750; font-size: 1.02rem; line-height: 1.15; color: #fff; }
.ds-brand-sub { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #7c8aa5; }

.ds-sidebar__scroll {
    overflow-y: auto;
    padding: .35rem .8rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.3) transparent;
}
.ds-sidebar__scroll::-webkit-scrollbar { width: 5px; }
.ds-sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 4px; }

.ds-nav-label {
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #64748b;
    padding: 1rem .65rem .4rem;
    font-weight: 600;
}

.ds-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem .7rem;
    border-radius: 10px;
    color: #aebbd0;
    font-weight: 500;
    font-size: .855rem;
    margin-bottom: 2px;
    position: relative;
    transition: background .15s ease, color .15s ease;
}

.ds-nav-link i { font-size: 1.03rem; width: 20px; text-align: center; color: #7f90ab; transition: color .15s; }
.ds-nav-link:hover { background: rgba(148, 163, 184, .09); color: #fff; }
.ds-nav-link:hover i { color: #e2e8f0; }

.ds-nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .08));
    color: #fff;
}
.ds-nav-link.active i { color: #93c5fd; }
.ds-nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.8rem;
    top: 20%;
    height: 60%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #60a5fa;
}

.ds-nav-badge {
    margin-left: auto;
    font-size: .64rem;
    background: #ef4444;
    color: #fff;
    border-radius: 20px;
    padding: .12rem .42rem;
    font-weight: 600;
}

.ds-sidebar__footer {
    margin-top: auto;
    padding: .9rem 1.2rem 1.1rem;
    border-top: 1px solid rgba(148, 163, 184, .08);
    font-size: .72rem;
    color: #64748b;
}

.ds-main { margin-left: var(--ds-sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ds-topbar {
    height: 70px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ds-line);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.ds-topbar__title { font-size: 1.02rem; font-weight: 650; margin: 0; }
.ds-topbar__sub { font-size: .73rem; color: var(--ds-muted); }

.ds-search {
    position: relative;
    max-width: 360px;
    width: 100%;
    margin-left: auto;
}
.ds-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .9rem; }
.ds-search input {
    padding-left: 2.3rem;
    height: 40px;
    border-radius: 11px;
    background: #f4f7fb;
    border: 1px solid #e8eef7;
    font-size: .82rem;
}
.ds-search input:focus { background: #fff; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .1); border-color: #bfd3f7; }

.ds-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--ds-line);
    background: #fff;
    display: grid;
    place-items: center;
    color: #475569;
    position: relative;
    transition: all .15s;
}
.ds-icon-btn:hover { background: var(--ds-primary-soft); color: var(--ds-primary); border-color: #cfdef8; }
.ds-icon-btn .dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
}

.ds-user-btn {
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--ds-line);
    background: #fff;
    border-radius: 12px;
    padding: .3rem .6rem .3rem .35rem;
    color: var(--ds-text);
}
.ds-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-weight: 650;
    font-size: .78rem;
    flex: 0 0 auto;
}
.ds-avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: .7rem; }
.ds-avatar--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.2rem; }

.ds-content { padding: 1.6rem 1.75rem 2.5rem; flex: 1; }

/* ---------- Components ---------- */
.ds-card {
    background: #fff;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
}

.ds-card__header {
    padding: 1.05rem 1.25rem .9rem;
    border-bottom: 1px solid #eef2f9;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.ds-card__title { font-size: .95rem; font-weight: 650; margin: 0; }
.ds-card__desc { font-size: .75rem; color: var(--ds-muted); margin: .15rem 0 0; }
.ds-card__body { padding: 1.15rem 1.25rem; }

.ds-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; flex-wrap: wrap; }
.ds-page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.ds-page-head p { margin: .25rem 0 0; color: var(--ds-muted); font-size: .82rem; }
.ds-page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.ds-stat {
    background: #fff;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--ds-shadow);
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    height: 100%;
}
.ds-stat__icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}
.ds-stat__label { font-size: .71rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ds-muted); }
.ds-stat__value { font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: #0f172a; }
.ds-stat__hint { font-size: .72rem; color: var(--ds-muted); }

.tone-blue { background: #eff6ff; color: #2563eb; }
.tone-green { background: #ecfdf5; color: #059669; }
.tone-amber { background: #fffbeb; color: #d97706; }
.tone-red { background: #fef2f2; color: #dc2626; }
.tone-violet { background: #f5f3ff; color: #7c3aed; }
.tone-cyan { background: #ecfeff; color: #0891b2; }
.tone-slate { background: #f1f5f9; color: #475569; }

.btn { border-radius: 10px; font-weight: 550; font-size: .82rem; padding: .5rem .95rem; }
.btn-sm { padding: .34rem .65rem; font-size: .76rem; border-radius: 9px; }
.btn-primary { background: var(--ds-primary); border-color: var(--ds-primary); }
.btn-primary:hover { background: var(--ds-primary-dark); border-color: var(--ds-primary-dark); }
.btn-outline-primary { color: var(--ds-primary); border-color: #c7d9f8; }
.btn-outline-primary:hover { background: var(--ds-primary); border-color: var(--ds-primary); }
.btn-light { background: #f4f7fb; border-color: #e8eef7; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }

.form-label { font-size: .78rem; font-weight: 600; color: #475569; margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: 10px;
    border-color: #dfe7f2;
    font-size: .84rem;
    padding: .52rem .8rem;
    color: var(--ds-text);
}
.form-control:focus, .form-select:focus { border-color: #93b4f5; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .1); }
.form-text { font-size: .72rem; color: var(--ds-muted); }
.input-group-text { border-radius: 10px; background: #f4f7fb; border-color: #dfe7f2; font-size: .82rem; color: var(--ds-muted); }

.ds-table { margin: 0; font-size: .82rem; }
.ds-table thead th {
    background: #f8fafd;
    border-bottom: 1px solid #e9eff8;
    color: #7b8aa3;
    font-size: .68rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: .72rem 1rem;
    white-space: nowrap;
}
.ds-table tbody td { padding: .78rem 1rem; border-color: #eef2f8; vertical-align: middle; }
.ds-table tbody tr:hover { background: #f8fbff; }

.badge-soft { font-weight: 600; font-size: .7rem; padding: .32rem .55rem; border-radius: 7px; }
.badge-soft.success { background: #ecfdf5; color: #047857; }
.badge-soft.warning { background: #fffbeb; color: #b45309; }
.badge-soft.danger { background: #fef2f2; color: #b91c1c; }
.badge-soft.info { background: #eff6ff; color: #1d4ed8; }
.badge-soft.secondary { background: #f1f5f9; color: #475569; }
.badge-soft.primary { background: #eef2ff; color: #4338ca; }

.ds-empty { text-align: center; padding: 2.6rem 1rem; color: var(--ds-muted); }
.ds-empty i { font-size: 2rem; color: #c3cfdf; display: block; margin-bottom: .6rem; }
.ds-empty h6 { color: #475569; font-size: .88rem; margin-bottom: .25rem; }
.ds-empty p { font-size: .78rem; margin: 0; }

.ds-progress { height: 7px; background: #eef2f9; border-radius: 20px; overflow: hidden; }
.ds-progress > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.ds-progress.green > span { background: linear-gradient(90deg, #10b981, #34d399); }
.ds-progress.amber > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.ds-list { list-style: none; margin: 0; padding: 0; }
.ds-list li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed #edf1f8; }
.ds-list li:last-child { border-bottom: 0; }
.ds-list .meta { min-width: 0; }
.ds-list .meta strong { display: block; font-size: .82rem; font-weight: 600; color: #1e293b; }
.ds-list .meta span { font-size: .72rem; color: var(--ds-muted); }

.ds-soft-icon {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center; flex: 0 0 auto; font-size: 1rem;
}

.ds-timetable { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ds-timetable th { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: #7b8aa3; text-align: left; padding: .6rem .5rem; border-bottom: 1px solid #e9eff8; }
.ds-timetable td { vertical-align: top; padding: .4rem; border-bottom: 1px solid #f1f5fb; border-right: 1px solid #f5f8fd; height: 108px; }
.ds-timetable td:last-child { border-right: 0; }
.ds-slot {
    background: #eff6ff; border: 1px solid #dbeafe; border-left: 3px solid #2563eb;
    border-radius: 8px; padding: .4rem .45rem; font-size: .68rem; margin-bottom: .3rem; color: #1e3a8a;
}
.ds-slot .time { font-weight: 700; font-size: .64rem; color: #2563eb; }
.ds-slot .who { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-slot .veh { color: #64748b; font-size: .62rem; }
.ds-slot.completed { background: #f0fdf4; border-color: #dcfce7; border-left-color: #16a34a; color: #14532d; }
.ds-slot.completed .time { color: #16a34a; }
.ds-slot.cancelled { background: #f8fafc; border-color: #e2e8f0; border-left-color: #94a3b8; color: #475569; opacity: .8; }
.ds-slot.pending { background: #fffbeb; border-color: #fef3c7; border-left-color: #f59e0b; color: #78350f; }
.ds-slot.pending .time { color: #d97706; }

.ds-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.ds-auth__visual {
    position: relative;
    background: linear-gradient(150deg, rgba(9, 20, 40, .94), rgba(11, 34, 64, .78)),
        url('/images/login-hero.png') center/cover;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
}
.ds-auth__visual h2 { color: #fff; font-size: 2.1rem; line-height: 1.2; max-width: 460px; }
.ds-auth__visual p { color: #c8d4e5; max-width: 430px; }
.ds-auth__stats { display: flex; gap: 2rem; }
.ds-auth__stats strong { display: block; font-size: 1.4rem; color: #fff; }
.ds-auth__stats span { font-size: .72rem; color: #9fb2ca; text-transform: uppercase; letter-spacing: .08em; }
.ds-auth__form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.ds-auth__form-inner { width: 100%; max-width: 400px; }

.ds-login-chip {
    display: flex; align-items: center; gap: .5rem; border: 1px solid var(--ds-line);
    border-radius: 10px; padding: .45rem .6rem; font-size: .72rem; color: #475569;
    background: #f8fafd; cursor: pointer; transition: all .15s; text-align: left; width: 100%;
}
.ds-login-chip:hover { border-color: #bfd3f7; background: #eff6ff; }
.ds-login-chip strong { font-size: .74rem; color: #1e293b; }
.ds-login-chip span { font-size: .66rem; color: #8494ab; }

.ds-modal .modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .18); }
.ds-modal .modal-header { border-bottom: 1px solid #eef2f9; }
.ds-modal .modal-footer { border-top: 1px solid #eef2f9; }

.ds-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; color: #64748b;
    font-size: .82rem; font-weight: 600; padding: .65rem .9rem;
}
.ds-tabs .nav-link.active { color: var(--ds-primary); border-bottom-color: var(--ds-primary); background: transparent; }

.ds-hero-strip {
    background: linear-gradient(110deg, #0f2547, #1e3a8a 55%, #0e7490);
    border-radius: var(--ds-radius);
    color: #fff;
    padding: 1.5rem 1.6rem;
    position: relative;
    overflow: hidden;
}
.ds-hero-strip::after {
    content: '';
    position: absolute; right: -60px; top: -80px; width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, .35), transparent 65%);
}
.ds-hero-strip h2 { color: #fff; font-size: 1.3rem; margin-bottom: .3rem; }
.ds-hero-strip p { color: #c9d9f0; font-size: .82rem; margin-bottom: 0; }

.ds-mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; text-align: center; }
.ds-mini-calendar .day-name { font-size: .62rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; padding-bottom: .2rem; }
.ds-mini-calendar .day {
    border-radius: 8px; padding: .35rem 0; font-size: .74rem; color: #475569;
    border: 1px solid transparent; position: relative;
}
.ds-mini-calendar .day.today { background: var(--ds-primary); color: #fff; font-weight: 600; }
.ds-mini-calendar .day.has-event::after {
    content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--ds-accent);
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
}
.ds-mini-calendar .day.today.has-event::after { background: #fff; }

.ds-doc { display: flex; align-items: center; gap: .65rem; padding: .6rem; border: 1px solid #edf2f9; border-radius: 10px; }
.ds-doc i { font-size: 1.1rem; color: #2563eb; }

.ds-alert { border: 0; border-radius: 12px; font-size: .82rem; display: flex; align-items: center; gap: .6rem; }
.ds-alert.alert-success { background: #ecfdf5; color: #065f46; }
.ds-alert.alert-danger { background: #fef2f2; color: #991b1b; }
.ds-alert.alert-warning { background: #fffbeb; color: #92400e; }
.ds-alert.alert-info { background: #eff6ff; color: #1e40af; }

.ds-auth .invalid-feedback { font-size: .74rem; }

.ds-chart-wrap { position: relative; width: 100%; }
.ds-chart-wrap canvas { max-height: 280px; }

.ds-sticky-actions { position: sticky; bottom: 1rem; }

@media (max-width: 991.98px) {
    .ds-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    .ds-sidebar.open { transform: translateX(0); }
    .ds-main { margin-left: 0; }
    .ds-topbar { padding: 0 1rem; }
    .ds-content { padding: 1.1rem 1rem 2rem; }
    .ds-auth { grid-template-columns: 1fr; }
    .ds-auth__visual { display: none; }
    .ds-search { max-width: 220px; }
    .ds-sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035;
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .ds-sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

@media (max-width: 575.98px) {
    .ds-search { display: none; }
    .ds-topbar { height: 62px; }
    .ds-auth__form { padding: 1.5rem 1rem; }
}

@media print {
    .ds-sidebar, .ds-topbar, .ds-page-actions, .no-print { display: none !important; }
    .ds-main { margin-left: 0; }
    body { background: #fff; }
    .ds-content { padding: 0; }
    .ds-card { box-shadow: none; border: 0; }
}
