/* ============================================
   SUKLAI DRIVING SCHOOL - Main Stylesheet
   Modern, Clean, Professional Design
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0891b2;
    --dark: #1e293b;
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    font-size: 14px;
    color: #334155;
}

/* ---- Sidebar ---- */
.sidebar {
    height: 100vh;
    max-height: 100vh;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    display: flex;
    flex-direction: column;
}
.sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 30px;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

.sidebar.toggled { margin-left: calc(var(--sidebar-width) * -1); }

.sidebar-nav .list-group-item {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 0 !important;
    transition: all 0.2s;
    opacity: 0.8;
}

.sidebar-nav .list-group-item:hover,
.sidebar-nav .list-group-item.active {
    background: rgba(255,255,255,0.1) !important;
    opacity: 1;
    border-left: 3px solid var(--warning) !important;
}

.sidebar-nav .list-group-item.active { 
    background: rgba(255,255,255,0.15) !important; 
    font-weight: 600;
}

.sidebar-section-title {
    padding: 15px 20px 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    font-weight: 600;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
}

#page-content-wrapper.full-width { margin-left: 0; }

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.stat-card {
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 500;
}

/* Gradient stat cards */
.stat-card-blue { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.stat-card-blue .stat-icon { background: #2563eb; color: #fff; }
.stat-card-blue .stat-value { color: #1e40af; }

.stat-card-green { background: linear-gradient(135deg, #dcfce7, #f0fdf4); }
.stat-card-green .stat-icon { background: #16a34a; color: #fff; }
.stat-card-green .stat-value { color: #15803d; }

.stat-card-yellow { background: linear-gradient(135deg, #fef3c7, #fffbeb); }
.stat-card-yellow .stat-icon { background: #f59e0b; color: #fff; }
.stat-card-yellow .stat-value { color: #b45309; }

.stat-card-red { background: linear-gradient(135deg, #fee2e2, #fef2f2); }
.stat-card-red .stat-icon { background: #dc2626; color: #fff; }
.stat-card-red .stat-value { color: #b91c1c; }

.stat-card-purple { background: linear-gradient(135deg, #ede9fe, #f5f3ff); }
.stat-card-purple .stat-icon { background: #7c3aed; color: #fff; }
.stat-card-purple .stat-value { color: #6d28d9; }

.stat-card-cyan { background: linear-gradient(135deg, #cffafe, #ecfeff); }
.stat-card-cyan .stat-icon { background: #0891b2; color: #fff; }
.stat-card-cyan .stat-value { color: #0e7490; }

/* ---- Tables ---- */
.table { font-size: 13px; }
.table thead th {
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px;
    white-space: nowrap;
}
.table tbody td { 
    padding: 12px; 
    vertical-align: middle; 
}
.table-hover tbody tr:hover { background: #f1f5f9; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-label { 
    font-weight: 500; 
    font-size: 13px; 
    color: #475569;
    margin-bottom: 4px;
}

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-size: 13px; font-weight: 500; padding: 8px 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- Badges ---- */
.badge { font-weight: 500; font-size: 11px; padding: 5px 10px; border-radius: 6px; }

/* ---- Login Page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 30px;
    text-align: center;
}

/* ---- Notification Badge ---- */
.notification-badge { font-size: 9px; padding: 3px 5px; }

/* ---- Progress Bar Custom ---- */
.progress { border-radius: 10px; height: 8px; }
.progress-bar { border-radius: 10px; }

/* ---- Quick Actions ---- */
.quick-action {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.quick-action i { font-size: 28px; display: block; margin-bottom: 8px; }
.quick-action span { font-size: 12px; font-weight: 500; color: #475569; }

/* ---- Print Styles ---- */
@media print {
    .sidebar, .navbar, .btn, .no-print { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    .sidebar.toggled { margin-left: 0; }
    #page-content-wrapper { margin-left: 0; }
    .stat-card .stat-value { font-size: 22px; }
    .container-fluid { padding: 15px !important; }
}

/* ---- Certificate ---- */
.certificate-border {
    border: 3px double #d97706;
    padding: 40px;
    margin: 20px;
    position: relative;
    background: #fffbeb;
}
.certificate-border::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px solid #d97706;
    pointer-events: none;
}

/* ---- ID Card ---- */
.id-card {
    width: 340px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 12px;
}
.id-card-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    padding: 15px;
    text-align: center;
}
.id-card-body { padding: 15px; background: #fff; }
.id-card-footer {
    background: #f59e0b;
    padding: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
}

/* ---- Scrollbar global ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Animation ---- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }
