/* ============================================================
   ABC Driving School - Custom Styles
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 60px;
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #1a1a2e;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.3s;
}

/* ============================================================
   Global Styles
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color var(--transition-speed);
}

a:hover {
    color: #2176bd;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.login-header {
    background: var(--primary-color);
    padding: 30px;
    text-align: center;
    color: #fff;
}

.login-header .logo-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.login-header p {
    font-size: 14px;
    opacity: 0.8;
    margin: 5px 0 0 0;
}

.login-body {
    padding: 30px;
}

.login-body .form-control {
    height: 45px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    font-size: 15px;
    transition: border-color var(--transition-speed);
}

.login-body .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: none;
}

.login-body .input-group-text {
    background: transparent;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #6c757d;
}

.login-body .input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.login-body .btn-login {
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    width: 100%;
}

.login-body .btn-login:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.login-footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
    border-top: 1px solid #e9ecef;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: #fff;
    z-index: 1000;
    transition: transform var(--transition-speed);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.sidebar-brand small {
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu .menu-label {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
    font-weight: 600;
}

.sidebar-menu .nav-item {
    display: block;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent-color);
}

.sidebar-menu .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-left-color: var(--accent-color);
}

.sidebar-menu .nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 18px;
    text-align: center;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

.topbar {
    background: #fff;
    height: var(--topbar-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px;
    display: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-right .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.topbar-right .user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
}

.topbar-right .user-role {
    font-size: 12px;
    color: #6c757d;
    text-transform: capitalize;
}

.page-content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 5px 0 0 0;
    margin: 0;
    font-size: 13px;
}

/* ============================================================
   Dashboard Cards
   ============================================================ */
.dashboard-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    border: none;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.dashboard-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.dashboard-card .card-icon.blue {
    background: #e8f4fd;
    color: var(--accent-color);
}

.dashboard-card .card-icon.green {
    background: #e8f8f0;
    color: var(--success-color);
}

.dashboard-card .card-icon.orange {
    background: #fef5e7;
    color: var(--warning-color);
}

.dashboard-card .card-icon.red {
    background: #fde8e8;
    color: var(--danger-color);
}

.dashboard-card .card-icon.purple {
    background: #f0e6ff;
    color: #8e44ad;
}

.dashboard-card .card-icon.teal {
    background: #e6faff;
    color: #1abc9c;
}

.dashboard-card .card-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1.2;
}

.dashboard-card .card-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.dashboard-card .card-footer-link {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 12px;
    color: var(--accent-color);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.dashboard-card:hover .card-footer-link {
    opacity: 1;
}

/* ============================================================
   Content Cards
   ============================================================ */
.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.content-card .card-header {
    padding: 20px 25px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.content-card .card-header h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.content-card .card-body {
    padding: 25px;
}

/* ============================================================
   Tables
   ============================================================ */
.table-custom {
    width: 100%;
    margin-bottom: 0;
}

.table-custom thead th {
    background: var(--light-bg);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.table-custom tbody tr:hover {
    background: #f8f9ff;
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

.table-custom .action-btns {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

.table-custom .action-btns .btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* ============================================================
   Forms
   ============================================================ */
.form-custom .form-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.form-custom .form-control,
.form-custom .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    font-size: 14px;
    transition: border-color var(--transition-speed);
}

.form-custom .form-control:focus,
.form-custom .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: none;
}

.form-custom textarea.form-control {
    min-height: 100px;
}

.form-custom .form-control-plaintext {
    padding: 10px 0;
    font-weight: 500;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-custom {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-speed);
    border: none;
}

.btn-custom-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-custom-primary:hover {
    background: #2980b9;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-custom-success {
    background: var(--success-color);
    color: #fff;
}

.btn-custom-success:hover {
    background: #219a52;
    color: #fff;
}

.btn-custom-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-custom-danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn-custom-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-custom-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-custom-lg {
    padding: 12px 30px;
    font-size: 16px;
}

/* ============================================================
   Stats Cards (Minimal)
   ============================================================ */
.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.stat-box .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-box .stat-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

/* ============================================================
   Modal Customization
   ============================================================ */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: var(--primary-color);
    color: #fff;
    border-radius: 12px 12px 0 0;
    padding: 20px 25px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
}

/* ============================================================
   Search Box
   ============================================================ */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-right: 40px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    height: 42px;
    font-size: 14px;
}

.search-box .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: none;
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-results.show {
    display: block;
}

.search-results .result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-results .result-item:hover {
    background: var(--light-bg);
}

.search-results .result-item:last-child {
    border-bottom: none;
}

/* ============================================================
   Receipt / Print
   ============================================================ */
.receipt-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #dee2e6;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.receipt-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.receipt-table {
    width: 100%;
}

.receipt-table td {
    padding: 8px 12px;
    font-size: 14px;
}

.receipt-table td:first-child {
    font-weight: 600;
    color: #495057;
    width: 150px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .page-content {
        padding: 20px 15px;
    }
    
    .topbar {
        padding: 0 15px;
    }
    
    .dashboard-card .card-number {
        font-size: 22px;
    }
    
    .content-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-right .user-name,
    .topbar-right .user-role {
        display: none;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 15px 10px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .dashboard-card .card-number {
        font-size: 20px;
    }
    
    .content-card .card-body {
        padding: 15px;
    }
    
    .table-custom {
        font-size: 13px;
    }
    
    .table-custom thead th,
    .table-custom tbody td {
        padding: 8px 10px;
    }
    
    .login-card {
        margin: 15px;
    }
    
    .receipt-container {
        padding: 20px;
    }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6;
    }
}

/* ============================================================
   Utilities
   ============================================================ */
.text-primary-custom { color: var(--primary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.bg-light-custom { background: var(--light-bg) !important; }

.cursor-pointer { cursor: pointer; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 60px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h5 {
    color: #6c757d;
    font-size: 18px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-bar .form-select,
.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

/* Summary cards */
.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
    height: 100%;
}

.summary-card .summary-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-card .summary-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}
