/* DLC ABU ID Card System v2 Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Roboto:wght@400;500;700;900&display=swap');

:root {
    /* Primary Emerald Palette */
    --primary-green: #0b6623;
    --primary-green-dark: #054717;
    --primary-green-light: #10b981;
    --primary-mint: #059669;
    
    /* Backgrounds & Tints */
    --bg-tint: #f4fbf7;
    --bg-subtle: #edf7f2;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    
    /* Neutral Shades */
    --text-dark: #0f291e;
    --text-muted: #526e60;
    --border-light: #d1fae5;
    --border-subtle: #e2e8f0;
    
    /* Accent & Status */
    --status-success-bg: #dcfce7;
    --status-success-text: #15803d;
    --status-pending-bg: #fef3c7;
    --status-pending-text: #b45309;
    --status-digital-bg: #e0e7ff;
    --status-digital-text: #3730a3;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    
    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(11, 102, 35, 0.05);
    --shadow-md: 0 10px 25px rgba(11, 102, 35, 0.08);
    --shadow-lg: 0 20px 40px rgba(11, 102, 35, 0.12);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-tint);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-green-dark);
}

/* Header & Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
    color: var(--primary-green);
}

.navbar-brand img {
    height: 45px;
    width: auto;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-green);
    background-color: var(--bg-subtle);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-green);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(11, 102, 35, 0.2);
}

.btn-secondary {
    background-color: var(--bg-subtle);
    color: var(--primary-green);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: var(--border-light);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.btn-danger:hover {
    background-color: #fca5a5;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* Cards & Layout Containers */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    margin-bottom: 25px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(11, 102, 35, 0.15);
}

/* Flash Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
}

.alert-success {
    background-color: var(--status-success-bg);
    color: var(--status-success-text);
    border: 1px solid #bbf7d0;
}

.alert-error, .alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #fecaca;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: var(--status-success-bg); color: var(--status-success-text); }
.badge-pending { background: var(--status-pending-bg); color: var(--status-pending-text); }
.badge-digital { background: var(--status-digital-bg); color: var(--status-digital-text); }

/* Table Design */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
}

.table th {
    background-color: var(--bg-subtle);
    color: var(--primary-green-dark);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-light);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

.table tr:hover {
    background-color: var(--bg-tint);
}

/* ================================================================
   ADMIN LAYOUT — Sidebar, Toggle, Overlay, Responsive
   ================================================================ */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-light);
    padding-top: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 24px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-menu a:hover {
    color: var(--primary-green);
    background: var(--bg-subtle);
}

.sidebar-menu a.active {
    color: var(--primary-green);
    background: var(--bg-subtle);
    border-left-color: var(--primary-green);
    font-weight: 700;
}

.sidebar-menu .logout-link:hover {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.menu-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.menu-label {
    white-space: nowrap;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 28px 32px;
    background-color: var(--bg-tint);
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* --- Top Header Bar --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 21px;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1.2;
    margin: 0;
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.user-badge-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.user-name {
    font-weight: 700;
    color: var(--primary-green);
}

/* --- Hamburger Button --- */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--primary-green);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: var(--bg-subtle);
    box-shadow: var(--shadow-sm);
}

/* Animate hamburger to X when open */
body.nav-open .hamburger-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger-btn span:nth-child(2) {
    opacity: 0;
}
body.nav-open .hamburger-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Sidebar Overlay --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-subtle);
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 41, 30, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Printable ID Card Design */
.id-card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding: 20px 0;
}

.id-card-frame {
    width: 500px;
    height: 315px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 6px solid var(--primary-green);
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

.id-card-front {
    padding: 12px 18px;
    height: 100%;
    position: relative;
    background-color: #ffffff;
}

.id-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.id-card-logo {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.id-card-title {
    flex: 1;
    text-align: center;
}

.id-card-title h2 {
    color: var(--primary-green);
    font-size: 22px;
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
}

.id-card-title p {
    color: var(--primary-green);
    font-size: 20px;
    font-weight: 900;
    margin: 0;
}

.id-card-sublabel {
    color: #c53030;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.id-card-body {
    display: flex;
    justify-content: space-between;
}

.id-card-details {
    flex: 1;
    font-size: 12px;
}

.id-card-row {
    display: flex;
    margin-bottom: 3px;
}

.id-card-row .label {
    font-weight: 700;
    color: #1a202c;
    width: 110px;
}

.id-card-row .val {
    font-weight: 900;
    color: #000;
}

.id-card-photo-box {
    width: 110px;
    text-align: center;
}

.id-card-photo {
    width: 100px;
    height: 115px;
    object-fit: cover;
    border: 2px solid var(--primary-green);
    border-radius: 4px;
}

.id-card-signature {
    width: 90px;
    height: 35px;
    object-fit: contain;
    margin-top: 4px;
}

.id-card-barcode-box {
    position: absolute;
    bottom: 8px;
    left: 18px;
    right: 18px;
    height: 32px;
}

/* Watermark */
.id-card-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-green);
    opacity: 0.12;
    white-space: nowrap;
    pointer-events: none;
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* --- Desktop (>= 992px) --- */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }

    /* Toggle hides sidebar on desktop */
    body.nav-open .sidebar {
        transform: translateX(-260px);
    }

    body.nav-open .main-content {
        margin-left: 0;
    }

    /* No overlay on desktop */
    .sidebar-overlay { display: none !important; }
}

/* --- Tablet & Mobile (< 992px) --- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-260px);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    /* Toggle shows sidebar on mobile */
    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    body.nav-open .sidebar-overlay {
        display: block;
    }
}

/* --- Responsive Grid Helpers --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.filter-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    align-items: flex-end;
}

.profile-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 25px;
    align-items: start;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: 14px;
}

/* --- Small Screens (< 768px) --- */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .filter-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 12px 15px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .navbar-menu {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        padding: 0 12px;
        margin: 15px auto;
    }

    .card {
        padding: 18px;
        margin-bottom: 18px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-badge-box {
        align-self: flex-end;
    }

    .modal-card {
        width: 95%;
        padding: 20px 15px;
        border-radius: var(--radius-md);
    }

    .page-title {
        font-size: 18px;
    }
}

/* --- Extra Small (< 540px) --- */
@media (max-width: 540px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .id-card-frame, .id-card {
        max-width: 100%;
        height: auto;
        min-height: 315px;
    }

    .main-content {
        padding: 16px 12px;
    }
}

/* --- Print --- */
@media print {
    body { background: white; padding: 0; }
    .navbar, .sidebar, .hamburger-btn, .sidebar-overlay, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0; padding: 0; background: white; }
    .id-card-frame { page-break-inside: avoid; box-shadow: none; }
}

/* GALENDESK OVERRIDES */

/* Theme Variables */
:root {
    --bg-tint: #f5f7fa;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-light: #e5e7eb;
    --active-bg: #111827;
    --active-text: #ffffff;
    
    --card-1-bg: #d1fae5; --card-1-text: #065f46;
    --card-2-bg: #dcfce7; --card-2-text: #14532d;
    --card-3-bg: #fef3c7; --card-3-text: #92400e;
    --card-4-bg: #ffe4e6; --card-4-text: #be123c;
    --card-5-bg: #e0e7ff; --card-5-text: #3730a3;
}

[data-theme="dark"] {
    --bg-tint: #0d1117;
    --card-bg: #161b22;
    --sidebar-bg: #161b22;
    --text-dark: #e5e7eb;
    --text-muted: #9ca3af;
    --border-light: #30363d;
    --active-bg: #ffffff;
    --active-text: #0d1117;
    
    --card-1-bg: #064e3b; --card-1-text: #d1fae5;
    --card-2-bg: #14532d; --card-2-text: #dcfce7;
    --card-3-bg: #713f12; --card-3-text: #fef3c7;
    --card-4-bg: #831843; --card-4-text: #ffe4e6;
    --card-5-bg: #312e81; --card-5-text: #e0e7ff;
    
    --primary-green: #374151;
    --status-success-bg: #064e3b;
    --status-success-text: #d1fae5;
}

body { background-color: var(--bg-tint); color: var(--text-dark); transition: background-color 0.3s, color 0.3s; }
.card { background: var(--card-bg); border-color: var(--border-light); color: var(--text-dark); border-radius: 20px; transition: background-color 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.sidebar { background: var(--sidebar-bg); border-right-color: var(--border-light); transition: background-color 0.3s; border-radius: 0 24px 24px 0; margin-right: 20px; }
.sidebar-menu a { color: var(--text-muted); padding: 12px 20px; border-radius: 12px; margin: 4px 16px; transition: all 0.2s; }
.sidebar-menu a:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }
.sidebar-menu a.active { background: var(--active-bg); color: var(--active-text); }
[data-theme="dark"] .sidebar-menu a:hover { background: rgba(255,255,255,0.05); }

/* Top Header */
.admin-header { background: transparent; border-bottom: none; display: flex; justify-content: space-between; padding: 20px 35px; align-items: center; }
.admin-header-right { display: flex; align-items: center; gap: 16px; }
.theme-toggle { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-dark); }
.search-bar { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 20px; padding: 10px 20px; width: 300px; display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.search-bar input { border: none; background: transparent; outline: none; width: 100%; color: var(--text-dark); }
.profile-pill { background: var(--card-bg); border: 1px solid var(--border-light); padding: 6px 12px 6px 6px; border-radius: 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.profile-avatar { background: var(--text-dark); color: var(--active-text); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; }
.profile-info { display: flex; flex-direction: column; line-height: 1.2; }
.profile-name { font-weight: 600; font-size: 14px; color: var(--text-dark); }
.profile-role { font-size: 11px; color: var(--text-muted); }

/* Dashboard Stat Cards */
.stat-cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card-galen { padding: 20px; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.stat-card-galen .stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.3); font-size: 16px; }
.stat-card-galen .stat-label { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.stat-card-galen .stat-value { font-size: 24px; font-weight: 800; line-height: 1; }
.stat-card-galen .stat-subtitle { font-size: 11px; opacity: 0.8; }
.stat-card-galen .stat-chart { position: absolute; right: 10px; bottom: 15px; display: flex; align-items: flex-end; gap: 3px; height: 30px; opacity: 0.4; }
.stat-card-galen .stat-chart span { width: 6px; background: currentColor; border-radius: 2px; }

/* Remove previous background colors on layout components */
.main-content { margin-left: 260px; padding: 0 10px; background: var(--bg-tint); min-height: 100vh; }
.table { color: var(--text-dark); }
.table th { color: var(--text-muted); border-bottom-color: var(--border-light); }
.table td { border-bottom-color: var(--border-light); }
.form-control, .form-select { background: var(--card-bg); border-color: var(--border-light); color: var(--text-dark); }
.form-control:focus, .form-select:focus { background: var(--card-bg); color: var(--text-dark); border-color: var(--active-bg); }
@media (max-width: 1200px) {
    .stat-cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .stat-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { margin-left: 0; }
    .sidebar { border-radius: 0; margin-right: 0; }
}
@media (max-width: 480px) {
    .stat-cards-grid { grid-template-columns: 1fr; }
}
