/* ============================================
   CSC SOCIETY ASSAM — World-Class Admin v4.0
   Lightweight · Glassmorphism · Performant
   ============================================ */

:root {
    --primary: #0f172a;
    --primary-light: #1e3a5f;
    --primary-dark: #020617;
    --primary-rgb: 15,23,42;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-rgb: 99,102,241;
    --secondary: #f59e0b;
    --secondary-light: #fbbf24;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --light: #f8fafc;
    --dark: #0f172a;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    --sidebar-width: 264px;
    --sidebar-collapsed: 72px;
    --header-height: 60px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --glass: rgba(255,255,255,0.72);
    --glass-border: rgba(255,255,255,0.18);
}

html { scroll-behavior: smooth; }

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

body {
    font-family: var(--font);
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

a { text-decoration: none; color: inherit; }

::selection { background: rgba(99,102,241,0.18); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-left {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.login-left .tagline {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.5;
}

.demo-credentials {
    margin-top: 20px;
}

.demo-credentials h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.9;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 8px;
}

.demo-card {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-card:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(5px);
}

.demo-card .demo-role {
    font-weight: 600;
    font-size: 0.9rem;
}

.demo-card .demo-info {
    font-size: 0.78rem;
    opacity: 0.85;
}

.demo-card .demo-arrow {
    font-size: 1.2rem;
    opacity: 0.7;
}

.login-right {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-right p {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: var(--white);
    box-shadow: 0 1px 2px rgba(99,102,241,0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}

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

.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover { background: #059669; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }

.btn-warning {
    background: var(--warning);
    color: var(--white);
}
.btn-warning:hover { background: #d97706; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-light);
    color: var(--dark);
}
.btn-outline:hover { background: var(--light); border-color: var(--accent); color: var(--accent); }

.btn-sm {
    padding: 6px 13px;
    font-size: 0.78rem;
    border-radius: 7px;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 0.85rem;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: var(--danger-light);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-light);
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: var(--warning-light);
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #2563eb;
    border: 1px solid #93c5fd;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard { display: flex; min-height: 100vh; }

/* ============================================
   SIDEBAR — Modern, Lightweight
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-header {
    padding: 18px 18px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    color: #fff;
}

.sidebar-brand { flex: 1; min-width: 0; }
.sidebar-brand h2 {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    color: #fff;
}
.sidebar-brand .role-badge {
    display: inline-block;
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 700;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(99,102,241,0.25);
}

.sidebar-menu {
    padding: 10px 0 12px;
    list-style: none;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }

.menu-group-title {
    padding: 10px 22px 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: rgba(255,255,255,0.32);
    margin-top: 4px;
    user-select: none;
}

.sidebar-menu li { margin: 1px 10px; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: rgba(255,255,255,0.62);
    font-size: 0.83rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    position: relative;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.95);
    transform: translateX(2px);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(99,102,241,0.04));
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.2);
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(99,102,241,0.6);
}

.sidebar-menu a .icon {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
    transition: var(--transition);
}
.sidebar-menu a:hover .icon { opacity: 1; transform: scale(1.08); }
.sidebar-menu a.active .icon { opacity: 1; color: var(--accent-light); }

.sidebar-menu a .menu-badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

.sidebar-menu .menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 6px 14px;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}

.sidebar-footer .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 10px;
    transition: var(--transition);
}
.sidebar-footer .sidebar-user:hover { background: rgba(255,255,255,0.04); }

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.sidebar-user-info .role {
    font-size: 0.67rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: var(--transition-slow);
}

/* ============================================
   TOP HEADER — Glass, Slim
   ============================================ */
.top-header {
    background: rgba(255,255,255,0.78);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid rgba(226,232,240,0.6);
    position: sticky;
    top: 0;
    z-index: 999;
}

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

#menuToggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--gray-light);
    background: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--dark);
    transition: var(--transition);
}
#menuToggle:hover { background: var(--gray-lighter); border-color: var(--accent); color: var(--accent); }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 1px;
}
.breadcrumb a { color: var(--gray); transition: var(--transition); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .separator { font-size: 0.62rem; color: #cbd5e1; }
.breadcrumb .current { color: var(--dark); font-weight: 600; }

.page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.header-right { display: flex; align-items: center; gap: 6px; }

.header-search { position: relative; }
.header-search input {
    width: 240px;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    font-size: 0.8rem;
    background: var(--gray-lighter);
    outline: none;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--dark);
}
.header-search input:focus {
    border-color: var(--accent);
    background: var(--white);
    width: 300px;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.header-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.78rem;
    pointer-events: none;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
    color: var(--gray);
    font-size: 1rem;
    position: relative;
}
.header-icon-btn:hover {
    background: var(--gray-lighter);
    color: var(--accent);
    border-color: var(--gray-light);
}

.notification-badge {
    position: relative;
    cursor: pointer;
}

.notification-badge .count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.58rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--white);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    margin-left: 4px;
}
.header-user:hover { background: var(--gray-lighter); border-color: var(--gray-light); }

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

.header-user .user-name { font-weight: 600; font-size: 0.8rem; color: var(--dark); line-height: 1.2; }
.header-user .user-role { font-size: 0.67rem; color: var(--gray); line-height: 1.2; }

/* User dropdown menu */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-light);
    min-width: 200px;
    z-index: 1001;
    padding: 6px;
    animation: dropIn 0.2s ease;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--dark);
    border-radius: 6px;
    transition: var(--transition);
}
.user-dropdown a:hover { background: var(--light); }
.user-dropdown a i { width: 18px; text-align: center; color: var(--gray); font-size: 0.9rem; }
.user-dropdown .dropdown-divider { height: 1px; background: var(--gray-light); margin: 4px 0; }
.user-dropdown a.text-danger { color: var(--danger); }
.user-dropdown a.text-danger i { color: var(--danger); }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- CONTENT AREA --- */
.content-area {
    padding: 28px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ============================================
   STAT CARDS — Modern, Smart
   ============================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    border: 1px solid var(--gray-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--card-color, var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--card-color, var(--accent));
    opacity: 0.06;
    transition: var(--transition);
}

a.stat-card { text-decoration: none; color: inherit; cursor: pointer; }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--card-color, var(--accent));
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover::after { opacity: 0.12; transform: scale(1.1); }

.stat-card.blue { --card-color: #3b82f6; }
.stat-card.orange { --card-color: #f59e0b; }
.stat-card.green { --card-color: #10b981; }
.stat-card.red { --card-color: #ef4444; }
.stat-card.purple { --card-color: #8b5cf6; }
.stat-card.teal { --card-color: #14b8a6; }
.stat-card.indigo { --card-color: #6366f1; }
.stat-card.pink { --card-color: #ec4899; }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.stat-card.blue .stat-icon { background: linear-gradient(135deg, #dbeafe, #eff6ff); color: #2563eb; }
.stat-card.orange .stat-icon { background: linear-gradient(135deg, #fed7aa, #fffbeb); color: #d97706; }
.stat-card.green .stat-icon { background: linear-gradient(135deg, #a7f3d0, #ecfdf5); color: #059669; }
.stat-card.red .stat-icon { background: linear-gradient(135deg, #fecaca, #fef2f2); color: #dc2626; }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, #ddd6fe, #f5f3ff); color: #7c3aed; }
.stat-card.teal .stat-icon { background: linear-gradient(135deg, #99f6e4, #f0fdfa); color: #0d9488; }
.stat-card.indigo .stat-icon { background: linear-gradient(135deg, #c7d2fe, #eef2ff); color: #4f46e5; }
.stat-card.pink .stat-icon { background: linear-gradient(135deg, #fbcfe8, #fdf2f8); color: #db2777; }

.stat-info { position: relative; z-index: 1; min-width: 0; }
.stat-info h3 {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 1px;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--dark);
}
.stat-info p {
    font-size: 0.76rem;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 5px;
}
.stat-trend.up { background: var(--success-light); color: #059669; }
.stat-trend.down { background: var(--danger-light); color: #dc2626; }

/* ============================================
   CARDS & PANELS — Elevated
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--gray-light);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    gap: 10px;
    flex-wrap: wrap;
}

.card-header h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}
.card-header h3 i {
    color: var(--accent);
    font-size: 0.88rem;
    width: 28px;
    height: 28px;
    background: rgba(99,102,241,0.1);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-body { padding: 20px; }

.card-footer {
    padding: 12px 20px;
    background: var(--gray-lighter);
    border-top: 1px solid var(--gray-light);
}

/* ============================================
   TABLES — Refined
   ============================================ */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: var(--gray-lighter);
    color: var(--gray);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
    border-bottom: 1px solid var(--gray-light);
}

table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.84rem;
    color: var(--dark);
    vertical-align: middle;
}

table tbody tr { transition: background 0.15s ease; }
table tbody tr:hover { background: rgba(99,102,241,0.04); }
table tbody tr:last-child td { border-bottom: none; }

/* Compact table variant */
table.table-compact thead th { padding: 9px 14px; font-size: 0.66rem; }
table.table-compact tbody td { padding: 9px 14px; font-size: 0.8rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active { background: var(--success-light); color: #059669; }
.badge-inactive { background: var(--danger-light); color: #dc2626; }
.badge-pending { background: var(--warning-light); color: #d97706; }
.badge-suspended { background: #fce7f3; color: #be185d; }
.badge-completed { background: #ccfbf1; color: #0d9488; }
.badge-pass { background: var(--success-light); color: #059669; }
.badge-fail { background: var(--danger-light); color: #dc2626; }
.badge-issued { background: var(--info-light); color: #2563eb; }

/* ============================================
   FORMS
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-lighter);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--gray-lighter);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray); }
.text-sm { font-size: 0.82rem; }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--dark);
    transition: var(--transition);
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ============================================
   WELCOME BANNER — Premium Gradient
   ============================================ */
.welcome-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 35%, #4338ca 70%, #6366f1 100%);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    color: var(--white);
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(67,56,202,0.18);
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -50px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-banner > * { position: relative; z-index: 1; }
.welcome-banner h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.015em;
}
.welcome-banner p { font-size: 0.86rem; opacity: 0.88; }
.welcome-banner .welcome-meta {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.welcome-banner .welcome-meta span {
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 7px;
    backdrop-filter: blur(8px);
}

/* ============================================
   QUICK ACTIONS — Smart Pills
   ============================================ */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    font-size: 0.81rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font);
}
.quick-action-btn:hover {
    border-color: var(--accent);
    background: rgba(99,102,241,0.08);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.quick-action-btn i { font-size: 0.9rem; }
.quick-action-btn .qa-badge {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .header-search { display: none; }
    .header-user .user-name, .header-user .user-role { display: none; }
}

@media (max-width: 768px) {
    .login-container { grid-template-columns: 1fr; }
    .login-left { padding: 30px 20px; }
    .login-right { padding: 30px 20px; }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open ~ .sidebar-overlay { display: block; }

    .main-content { margin-left: 0; }

    #menuToggle { display: flex; }

    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .top-header { padding: 0 16px; }
    .welcome-banner { padding: 20px; }
    .welcome-banner h2 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 14px; }
    .stat-info h3 { font-size: 1.2rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --primary: #1e293b;
    --primary-light: #334155;
    --primary-dark: #020617;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --secondary: #fbbf24;
    --success: #34d399;
    --success-light: #064e3b;
    --danger: #f87171;
    --danger-light: #450a0a;
    --warning: #fbbf24;
    --warning-light: #451a03;
    --info: #818cf8;
    --info-light: #312e81;
    --light: #0f172a;
    --dark: #e2e8f0;
    --gray: #94a3b8;
    --gray-light: #1e293b;
    --gray-lighter: #0f172a;
    --white: #1e293b;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.6);
    --glass: rgba(30,41,59,0.7);
}
[data-theme="dark"] body { background: #020617; color: #e2e8f0; }
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #000000 0%, #0a0f1c 100%); }
[data-theme="dark"] .top-header { background: rgba(15,23,42,0.78); border-color: #1e293b; }
[data-theme="dark"] .header-search input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .header-search input:focus { background: #1e293b; }
[data-theme="dark"] table thead th { background: #0f172a; }
[data-theme="dark"] table tbody tr:hover { background: #0f172a; }
[data-theme="dark"] .form-group input, [data-theme="dark"] .form-group select, [data-theme="dark"] .form-group textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .form-group input:focus, [data-theme="dark"] .form-group select:focus, [data-theme="dark"] .form-group textarea:focus { border-color: var(--accent); }
[data-theme="dark"] .modal { background: #1e293b; }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer, [data-theme="dark"] .card-header, [data-theme="dark"] .card-footer { background: #0f172a; }
[data-theme="dark"] .welcome-banner { background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%); }
[data-theme="dark"] .login-page { background: linear-gradient(135deg, #020617, #0f172a, #1e293b); }
[data-theme="dark"] .user-dropdown { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .user-dropdown a:hover { background: #334155; }
[data-theme="dark"] ::selection { background: rgba(96,165,250,0.3); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* ============================================
   COMMAND PALETTE
   ============================================ */
.cmd-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(6px);
    z-index: 3000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.cmd-overlay.show { display: flex; }
.cmd-box {
    width: 90%; max-width: 560px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: cmdIn 0.2s ease;
    border: 1px solid var(--gray-light);
}
@keyframes cmdIn { from { opacity:0; transform:scale(0.95) translateY(-10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.cmd-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-light);
}
.cmd-input-wrap i { color: var(--gray); font-size: 1.1rem; flex-shrink: 0; }
.cmd-input-wrap input {
    flex: 1; border: none; outline: none; font-size: 1rem; font-family: var(--font); background: transparent; color: var(--dark);
}
.cmd-input-wrap input::placeholder { color: var(--gray); }
.cmd-input-wrap kbd {
    background: var(--light); border: 1px solid var(--gray-light); border-radius: 5px;
    padding: 2px 8px; font-size: 0.7rem; color: var(--gray); font-family: var(--font);
}
.cmd-results { max-height: 360px; overflow-y: auto; padding: 6px; }
.cmd-results .cmd-group-title {
    padding: 8px 14px 4px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--gray);
}
.cmd-results a {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
    font-size: 0.88rem; color: var(--dark); transition: all 0.15s;
}
.cmd-results a:hover, .cmd-results a.focused { background: var(--info-light); color: var(--accent); }
.cmd-results a i { width: 20px; text-align: center; font-size: 0.85rem; opacity: 0.7; }
.cmd-results a .cmd-shortcut { margin-left: auto; font-size: 0.7rem; color: var(--gray); }
.cmd-results .cmd-empty { padding: 30px; text-align: center; color: var(--gray); font-size: 0.88rem; }
.cmd-footer {
    padding: 10px 16px; border-top: 1px solid var(--gray-light); display: flex; gap: 14px;
    font-size: 0.7rem; color: var(--gray); background: var(--gray-lighter);
}
.cmd-footer kbd { background: var(--light); border: 1px solid var(--gray-light); border-radius: 4px; padding: 1px 6px; font-size: 0.65rem; }

/* ============================================
   NOTIFICATION DROPDOWN
   ============================================ */
.notif-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-light); width: 360px; z-index: 1001;
    animation: dropIn 0.2s ease;
}
.notif-dropdown.show { display: block; }
.notif-dropdown .notif-header {
    padding: 14px 16px; border-bottom: 1px solid var(--gray-light);
    display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown .notif-header h4 { font-size: 0.9rem; font-weight: 700; color: var(--dark); }
.notif-dropdown .notif-body { max-height: 320px; overflow-y: auto; }
.notif-dropdown .notif-item {
    padding: 12px 16px; border-bottom: 1px solid var(--gray-light); display: flex;
    gap: 10px; cursor: pointer; transition: background 0.15s;
}
.notif-dropdown .notif-item:hover { background: var(--gray-lighter); }
.notif-dropdown .notif-item.unread { background: rgba(59,130,246,0.04); border-left: 3px solid var(--accent); }
.notif-dropdown .notif-icon {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; font-size: 0.8rem;
}
.notif-dropdown .notif-text { font-size: 0.82rem; color: var(--dark); line-height: 1.4; }
.notif-dropdown .notif-time { font-size: 0.7rem; color: var(--gray); margin-top: 2px; }
.notif-dropdown .notif-footer {
    padding: 10px 16px; border-top: 1px solid var(--gray-light); text-align: center;
}
.notif-dropdown .notif-footer a { font-size: 0.82rem; color: var(--accent); font-weight: 600; }

/* ============================================
   DARK MODE TOGGLE
   ============================================ */
.theme-toggle {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; border: 1px solid transparent; background: transparent;
    color: var(--gray); font-size: 1.1rem; transition: var(--transition);
}
.theme-toggle:hover { background: var(--light); color: var(--dark); border-color: var(--gray-light); }

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.7); z-index: 5000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
[data-theme="dark"] .loading-overlay { background: rgba(15,23,42,0.7); }
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 48px; height: 48px; border: 4px solid var(--gray-light);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--gray-light) 25%, var(--gray-lighter) 50%, var(--gray-light) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }

/* ============================================
   ENHANCED TRANSITIONS
   ============================================ */
.card { animation: cardIn 0.4s ease backwards; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
@keyframes cardIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.stat-card { animation: statIn 0.5s ease backwards; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes statIn { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }

/* Table row entrance */
table tbody tr { animation: rowIn 0.3s ease backwards; }
@keyframes rowIn { from { opacity:0; } to { opacity:1; } }

/* Progress bar */
.progress-bar { height: 8px; background: var(--gray-light); border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; background: linear-gradient(90deg, var(--accent), var(--success)); }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); background: var(--dark); color: #fff; padding: 5px 12px;
    border-radius: 6px; font-size: 0.72rem; white-space: nowrap; z-index: 100;
    animation: tooltipIn 0.2s ease;
}
@keyframes tooltipIn { from { opacity:0; transform:translateX(-50%) translateY(4px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(52,211,153,0.2); animation: pulse-green 2s infinite; }
.status-dot.offline { background: var(--gray); }
@keyframes pulse-green { 0%,100% { box-shadow: 0 0 0 3px rgba(52,211,153,0.2); } 50% { box-shadow: 0 0 0 6px rgba(52,211,153,0.1); } }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-state i { font-size: 3rem; opacity: 0.3; margin-bottom: 12px; display: block; }
.empty-state h4 { font-size: 1rem; color: var(--dark); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; max-width: 360px; margin: 0 auto; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar, .top-header, .btn, .search-bar, .sidebar-overlay, .quick-actions, .welcome-banner, .cmd-overlay, .loading-overlay, .notif-dropdown, .theme-toggle, #backToTop {
        display: none !important;
    }
    .main-content { margin-left: 0; }
    .content-area { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; animation: none; }
    .stat-card { animation: none; }
}
