:root {
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --sidebar-width: 260px;
    --status-valid: #16a34a;
    --status-expiring-90: #06b6d4;
    --status-expiring-60: #eab308;
    --status-expiring-30: #f97316;
    --status-expired: #ef4444;
    --status-none: #94a3b8;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,.1);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
    font-family: system-ui, -apple-system, sans-serif;
}

.main-content {
    flex: 1;
    padding-bottom: 72px;
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: 0;
        margin-left: var(--sidebar-width);
    }
}

/* Sidebar */
.sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1040;
    overflow-y: auto;
    background: var(--sidebar-bg);
}

@media (min-width: 992px) {
    .sidebar {
        display: flex !important;
        flex-direction: column;
    }
}

.sidebar .nav-link {
    color: rgba(255,255,255,.7);
    border-radius: .5rem;
    margin-bottom: 2px;
    padding: .6rem 1rem;
    transition: all .15s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(99,102,241,.4);
    font-weight: 600;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    padding: 1.25rem 1rem;
    letter-spacing: -0.02em;
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: 68px;
    background: var(--sidebar-bg);
    border-top: 1px solid rgba(255,255,255,.1);
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

.bottom-nav .nav-link {
    font-size: 0.7rem;
    padding: 0.4rem 0;
    min-width: 56px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    transition: color .15s;
}

.bottom-nav .nav-link:hover,
.bottom-nav .nav-link.active {
    color: #fff;
}

.bottom-nav .nav-link i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

/* Cards */
.card {
    border: none;
    border-radius: .75rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow .2s;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,.06);
    padding: 1rem 1.25rem;
}

/* Status badges */
.badge-status {
    font-size: .75rem;
    font-weight: 600;
    padding: .35em .65em;
    border-radius: 50rem;
    letter-spacing: .02em;
}

.badge-valid { background-color: #dcfce7; color: #166534; }
.badge-expiring-90 { background-color: #cffafe; color: #155e75; }
.badge-expiring-60 { background-color: #fef9c3; color: #854d0e; }
.badge-expiring-30 { background-color: #ffedd5; color: #9a3412; }
.badge-expired { background-color: #fee2e2; color: #991b1b; }
.badge-none { background-color: #f1f5f9; color: #475569; }

/* Status text colors */
.status-valid { color: var(--status-valid); }
.status-expiring-90 { color: var(--status-expiring-90); }
.status-expiring-60 { color: var(--status-expiring-60); }
.status-expiring-30 { color: var(--status-expiring-30); }
.status-expired { color: var(--status-expired); }
.status-none { color: var(--status-none); }

/* Tables */
.table {
    --bs-table-striped-bg: rgba(0,0,0,.02);
}

.table th {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* Profile card */
.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

.profile-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    border: 3px solid #e2e8f0;
}

/* Driver card for training selection */
.driver-card {
    cursor: pointer;
    min-height: 48px;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
    border-radius: .5rem !important;
}

.driver-card:hover {
    border-color: var(--bs-primary) !important;
}

.driver-card:active,
.driver-card.selected {
    background-color: #eef2ff !important;
    border-color: #6366f1 !important;
}

/* Sticky elements for training */
.sticky-search {
    position: sticky;
    top: 0;
    z-index: 10;
}

.sticky-footer {
    position: fixed;
    bottom: 68px;
    left: 0;
    right: 0;
    z-index: 1030;
}

@media (min-width: 992px) {
    .sticky-footer {
        bottom: 0;
        left: var(--sidebar-width);
    }
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
}

/* Page header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
}

/* Stat number */
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

/* Alert cards on dashboard */
.alert {
    border: none;
    border-radius: .75rem;
}

/* Filter bar */
.filter-bar {
    background: #fff;
    border-radius: .75rem;
    padding: 1rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

/* Mobile cards clickable */
.driver-list-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.driver-list-card:hover {
    color: inherit;
}

.driver-list-card .card {
    transition: transform .1s, box-shadow .2s;
}

.driver-list-card:active .card {
    transform: scale(.98);
}

/* Login page */
.login-card {
    border-radius: 1rem;
    overflow: hidden;
}

.login-header {
    background: var(--sidebar-bg);
    padding: 2rem;
    text-align: center;
    color: #fff;
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: .5rem;
    font-size: .875rem;
}
