* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; background: #f0f2f5; }

/* ─── Login ─── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2196F3 0%, #7B42F6 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: #fff; border-radius: 16px; padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 24px; color: #2196F3; }
.login-header p { color: #666; margin-top: 5px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: #333; }
.login-form input {
    width: 100%; padding: 12px 16px; border: 1.5px solid #ddd;
    border-radius: 8px; font-size: 15px; transition: .2s;
}
.login-form input:focus { outline: none; border-color: #2196F3; box-shadow: 0 0 0 3px rgba(33,150,243,.15); }
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 20px;
    font-size: 14px;
}
.alert-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn {
    display: inline-block; padding: 12px 24px; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600; cursor: pointer; transition: .2s;
}
.btn-primary { background: #2196F3; color: #fff; }
.btn-primary:hover { background: #1976D2; }
.btn-block { width: 100%; }

/* ─── Admin Layout ─── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px; background: #1e293b; color: #fff;
    overflow-y: auto; transition: width .3s; flex-shrink: 0;
}
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h2 { font-size: 20px; color: #2196F3; }
.sidebar-header p { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; color: #cbd5e1; text-decoration: none;
    font-size: 14px; transition: .2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-nav hr { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 16px; }
.nav-section {
    padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase;
    color: #64748b; font-weight: 700; letter-spacing: .5px;
}
.sub-link { padding-left: 52px !important; font-size: 13px !important; }

/* Main */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Top bar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.toggle-btn {
    background: none; border: none; font-size: 22px; cursor: pointer; color: #333; padding: 4px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.dropdown { position: relative; }
.dropdown-btn {
    background: none; border: none; font-size: 28px; cursor: pointer; color: #555;
}
.dropdown-content {
    display: none; position: absolute; right: 0; top: 100%; min-width: 240px;
    background: #fff; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.12);
    padding: 16px; z-index: 100; margin-top: 8px;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-name { font-weight: 600; color: #333; }
.dropdown-name i { color: #22c55e; font-size: 10px; vertical-align: middle; }
.dropdown-email { color: #666; font-size: 13px; margin-top: 4px; }
.dropdown-content hr { margin: 12px 0; }
.logout-btn {
    display: flex; align-items: center; gap: 8px;
    color: #dc2626; text-decoration: none; font-weight: 500; font-size: 14px;
}

/* Content */
.content { padding: 24px; flex: 1; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card {
    display: flex; align-items: center; gap: 16px;
    background: #fff; border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat-icon {
    width: 56px; height: 56px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.stat-blue .stat-icon { background: #2196F3; }
.stat-green .stat-icon { background: #10b981; }
.stat-orange .stat-icon { background: #f59e0b; }
.stat-purple .stat-icon { background: #8b5cf6; }
.stat-info p { color: #666; font-size: 13px; margin-bottom: 4px; }
.stat-info h3 { font-size: 22px; color: #333; }

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.chart-header { padding: 16px 20px; border-bottom: 1px solid #eee; }
.chart-header h4 { color: #386ca7; font-size: 16px; }
.chart-body { padding: 20px; max-height: 300px; }

/* Tables */
.tables-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.table-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.table-header { padding: 12px 16px; font-weight: 600; color: #fff; font-size: 14px; }
.bg-success { background: #10b981; }
.bg-primary { background: #2196F3; }
.bg-warning { background: #f59e0b; }
.table-body { padding: 12px; overflow-x: auto; }
.table-body table { width: 100%; border-collapse: collapse; }
.table-body th, .table-body td { padding: 8px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.table-body th { font-weight: 600; color: #555; }
.table-body tr:last-child td { border-bottom: none; }

/* Footer */
.footer {
    text-align: right; padding: 16px 24px; color: #888;
    font-size: 13px; border-top: 1px solid #eee;
}
.footer .text-danger { color: #dc2626; }

/* Responsive */
@media (max-width: 992px) {
    .charts-row, .tables-row { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1000; }
    .sidebar.collapsed { transform: translateX(-100%); width: 260px; }
}

/* ─── Breadcrumb ─── */
.breadcrumb-nav {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; font-size: 14px; color: #666;
}
.breadcrumb-nav a { color: #386ca7; text-decoration: none; }
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-nav i.fa-chevron-right { font-size: 12px; color: #999; }

/* ─── Card ─── */
.card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid #eee;
}
.card-header h4 { color: #386ca7; font-size: 16px; margin: 0; }
.card-body { padding: 20px; }

/* ─── DataTable ─── */
.table-responsive { overflow-x: auto; }
table.dataTable { margin: 0 !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #2196F3 !important; color: #fff !important; border-color: #2196F3 !important;
    border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e3f2fd !important; border-radius: 6px;
}
table.dataTable thead th {
    background: #f8f9fa; color: #333; font-weight: 600; font-size: 13px;
    border-bottom: 2px solid #dee2e6 !important;
}
table.dataTable tbody td {
    font-size: 13px; vertical-align: middle;
}

/* ─── Action buttons ─── */
.action-cell { white-space: nowrap; text-align: center; }
.action-cell .btn {
    padding: 4px 10px; font-size: 13px; margin: 0 2px;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; border: none; cursor: pointer; }
.btn-success { background: #10b981; color: #fff; }
.btn-primary { background: #2196F3; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-info { background: #0dcaf0; color: #000; }
.btn-success:hover { background: #059669; }
.btn-primary:hover { background: #1976D2; }
.btn-danger:hover { background: #b91c1c; }
.btn-info:hover { background: #31d2f2; }
.btn-secondary:hover { background: #5c636a; }

/* Form select small */
.form-select-sm {
    font-size: 13px; padding: 2px 24px 2px 8px; border-radius: 6px;
    border: 1.5px solid #ddd; cursor: pointer;
}
.form-select-sm:focus { outline: none; border-color: #2196F3; box-shadow: 0 0 0 3px rgba(33,150,243,.1); }

/* Status dropdown colours */
.val-pending { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.val-approved { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.val-active { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.val-inactive { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.bg-success { background: #10b981; color: #fff; }
.bg-warning { background: #f59e0b; color: #fff; }

/* ─── Modals ─── */
.modal-content { border-radius: 12px; border: none; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; }
.modal-header .modal-title { color: #386ca7; font-size: 18px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #eee; }
.modal-body label { font-weight: 600; font-size: 13px; color: #555; margin-bottom: 4px; display: block; }
.modal-body .form-control {
    width: 100%; padding: 8px 12px; border: 1.5px solid #ddd;
    border-radius: 6px; font-size: 14px;
}
.modal-body .form-control:focus {
    outline: none; border-color: #2196F3; box-shadow: 0 0 0 3px rgba(33,150,243,.1);
}
.modal-body select.form-control { appearance: auto; }
.btn-close {
    background: none; border: none; font-size: 22px; cursor: pointer; color: #999;
}
