/* ============================================================
   CourseHub — v5 Complete Visual Overhaul
   Faculty of Civil Engineering, UTM
   Bold new palette · DM Sans · Refined layout
   ============================================================ */

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-soft: #ecfdf5;
    --primary-ring: rgba(5,150,105,.18);

    --accent: #0891b2;
    --accent-soft: #ecfeff;

    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active: rgba(5,150,105,.18);

    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #1e293b;
    --text-secondary: #475569;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --heading: #0f172a;

    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #e11d48;
    --danger-soft: #ffe4e6;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --info: #0284c7;
    --info-soft: #e0f2fe;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);

    --radius-sm: 10px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: .2s cubic-bezier(.4,0,.2,1);
    --sidebar-w: 272px;
    --font-body: 'DM Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-heading: 'DM Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--heading);
}
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
::selection { background: rgba(5,150,105,.15); color: #0f172a; }
code, pre { font-family: var(--font-mono); font-size: .875em; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a3a9b3; }

/* ============================================================
   App Shell & Sidebar
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #94a3b8;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 22px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: relative;
    text-decoration: none;
    transition: background var(--transition);
}
.brand:hover { background: var(--sidebar-hover); color: #fff; }
.brand-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #059669, #0891b2);
    display: grid; place-items: center;
    font-size: 21px; color: #fff;
    box-shadow: 0 4px 14px rgba(5,150,105,.35);
    flex-shrink: 0;
    transition: transform var(--transition);
}
.brand:hover .brand-logo { transform: scale(1.05); }
.brand strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}
.brand small {
    display: block;
    color: #64748b;
    font-size: 11.5px;
    margin-top: 2px;
    letter-spacing: .01em;
    font-weight: 500;
}

/* Role card */
.sidebar-role-card {
    margin: 16px 14px 8px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
    color: #fff;
}
.sidebar-role-card small {
    display: block;
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
    font-weight: 700;
}
.sidebar-role-card strong {
    font-size: 13px;
    font-weight: 700;
}

/* Sidebar nav */
.sidebar-menu { padding: 8px 12px; overflow-y: auto; flex: 1; }

.sidebar-label {
    margin: 24px 10px 8px;
    text-transform: uppercase;
    color: #475569;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .1em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: #94a3b8;
    text-decoration: none;
    margin: 2px 0;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: all var(--transition);
}
.nav-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    transition: color var(--transition);
}
.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}
.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 26px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.nav-link.active i { color: #34d399; }

.nav-count {
    margin-left: auto;
    min-width: 24px; height: 24px;
    border-radius: 99px;
    display: grid; place-items: center;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255,255,255,.1);
    color: #fff;
    padding: 0 6px;
}
.nav-count.danger { background: #e11d48; }
.nav-count.warning { background: #d97706; }
.nav-count.success { background: #059669; }

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 16px 22px;
}
.sidebar-close {
    position: absolute; right: 12px; top: 12px;
    background: rgba(255,255,255,.06);
    color: #fff; border: 0; border-radius: var(--radius);
    width: 36px; height: 36px;
    cursor: pointer;
    transition: background var(--transition);
}
.sidebar-close:hover { background: rgba(255,255,255,.12); }

.logout-link {
    color: #fb7185;
    text-decoration: none;
    font-weight: 600;
    display: flex; gap: 10px; align-items: center;
    padding: 8px 0;
    font-size: 14px;
    transition: color var(--transition);
}
.logout-link:hover { color: #fda4af; }

/* ============================================================
   Main Area & Topbar
   ============================================================ */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-w));
}

.topbar {
    height: 72px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 900;
    transition: box-shadow var(--transition);
}
.topbar.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,.06); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; }

.hamburger {
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    font-size: 22px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
}
.hamburger:hover { background: var(--primary-soft); border-color: #a7f3d0; color: var(--primary); }

.topbar-heading h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--heading);
    margin: 0;
    letter-spacing: -.02em;
}
.topbar-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.topbar-icon {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: #fff;
    text-decoration: none;
    transition: all var(--transition);
}
.topbar-icon:hover { background: var(--primary-soft); color: var(--primary); border-color: #a7f3d0; }

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: #fff;
    transition: all var(--transition);
}
.user-pill:hover { border-color: #a7f3d0; box-shadow: var(--shadow-xs); }
.avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #059669, #0891b2);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}
.user-pill strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--heading);
}
.user-pill small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.content { padding: 32px 36px 48px; }

.btn-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 13px;
    background: #fff; color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
}
.btn-back:hover { background: var(--primary-soft); color: var(--primary); border-color: #a7f3d0; }

/* ============================================================
   Page Heading
   ============================================================ */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.page-heading h2 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--heading);
    margin: 0;
    line-height: 1.15;
}
.page-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

/* ============================================================
   Cards / Panels
   ============================================================ */
.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.panel-card:hover { box-shadow: var(--shadow-sm); }
.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}
.panel-header h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--heading);
    margin: 0;
}
.panel-header .text-muted { color: var(--muted-2) !important; font-weight: 500; }
.panel-body { padding: 24px; }
.panel-body.p-0 { padding: 0; }

/* KPI Cards — redesigned with left color accent */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
@media (max-width: 1199px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--label, var(--primary));
    border-radius: var(--radius-lg);
    padding: 22px 22px 20px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.kpi-card small {
    display: block;
    color: var(--label, var(--primary));
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 4px;
}
.kpi-card h3 {
    margin: 14px 0 6px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--heading);
    line-height: 1;
}
.kpi-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}
.kpi-icon {
    position: absolute;
    right: 18px; bottom: 18px;
    width: 46px; height: 46px;
    border-radius: var(--radius);
    display: grid; place-items: center;
    background: var(--tint, #ecfdf5);
    color: var(--label, #059669);
    font-size: 22px;
    opacity: .85;
}
.kpi-card.mb-0 { margin-bottom: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 14px;
    letter-spacing: -.005em;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 4px 14px rgba(5,150,105,.35);
    transform: translateY(-1px);
}
.btn-success { background: var(--success); border-color: transparent; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #be123c; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 8px; }

.btn-soft {
    background: var(--primary-soft);
    border: 1px solid #a7f3d0;
    color: #047857;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13.5px;
}
.btn-soft:hover { background: #d1fae5; color: #047857; border-color: #6ee7b7; }

.btn-outline-primary { border: 1px solid #6ee7b7; color: #047857; }
.btn-outline-primary:hover { background: var(--primary-soft); border-color: #059669; color: #047857; }
.btn-outline-secondary { border: 1px solid var(--border); color: #475569; }
.btn-outline-secondary:hover { background: #f8fafc; }
.btn-outline-danger { border: 1px solid #fda4af; color: #be123c; }
.btn-outline-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    min-height: 44px;
    font-size: 15px;
    color: var(--text);
    font-family: var(--font-body);
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px var(--primary-ring);
    outline: 0;
}
.form-control::placeholder { color: var(--muted-2); font-weight: 400; }
label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--heading);
    margin-bottom: 7px;
}

/* Input group — password toggle */
.input-group-password { position: relative; }
.input-group-password .form-control { padding-right: 46px; }
.toggle-password {
    position: absolute;
    right: 1px; top: 1px; bottom: 1px;
    width: 44px;
    display: grid; place-items: center;
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color var(--transition);
    font-size: 17px;
}
.toggle-password:hover { color: var(--primary); }

/* ============================================================
   Tables
   ============================================================ */
.table {
    color: var(--text);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 14.5px;
}
.table thead th {
    background: #f1f5f9;
    color: var(--heading);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 13px 18px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.table td {
    padding: 13px 18px;
    border-top: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text);
}
.table tbody tr:nth-child(even) td { background: #f8fafc; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: #ecfdf5; }
.table tbody tr:last-child td { border-top: 1px solid; }

/* CourseHub tables */
.course-table { width: 100%; }
.course-table th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--heading);
    background: #f1f5f9;
    padding: 13px 18px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}
.course-table td {
    padding: 13px 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    transition: background var(--transition);
}
.course-table .small { font-size: 13px; }
.course-table strong {
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -.01em;
}
.course-table tbody tr:nth-child(even) td { background: #f8fafc; }
.course-table tbody tr { transition: background var(--transition); }
.course-table tbody tr:hover td { background: #ecfdf5; }

/* ============================================================
   Status Chips & Badges
   ============================================================ */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 99px;
    padding: 5px 14px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.status-not-submitted, .status-pending-confirmation {
    background: #f1f5f9; color: #475569;
}
.status-returned, .status-overdue {
    background: var(--danger-soft); color: #9f1239;
}
.status-completed, .status-approved, .status-verified {
    background: var(--success-soft); color: #065f46;
    animation: chipPulse .4s ease;
}
@keyframes chipPulse {
    0% { opacity: .7; transform: scale(.96); }
    100% { opacity: 1; transform: scale(1); }
}
.status-pending-tda, .status-pending-it {
    background: var(--warning-soft); color: #92400e;
}

.badge {
    border-radius: 8px;
    font-weight: 700;
    font-size: 11.5px;
    padding: 4px 11px;
    letter-spacing: .02em;
}
.badge.text-bg-success { background: var(--success-soft); color: #065f46; }
.badge.text-bg-warning { background: var(--warning-soft); color: #92400e; }
.badge.text-bg-secondary { background: #f1f5f9; color: #475569; }
.badge.text-bg-danger { background: var(--danger-soft); color: #9f1239; }
.badge.text-bg-light { background: #f8fafc; color: #475569; }
.badge.text-bg-info { background: var(--info-soft); color: #075985; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 14.5px;
    line-height: 1.65;
}
.alert-success { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: var(--danger-soft); color: #9f1239; border-color: #fecdd3; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--info-soft); color: #075985; border-color: #bae6fd; }

/* ============================================================
   Info Callout
   ============================================================ */
.info-callout {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    border-left: 4px solid #6ee7b7;
}
.info-callout strong { color: var(--heading); font-size: 14px; }

/* ============================================================
   Modals
   ============================================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 20px 26px; }
.modal-header h5 { font-weight: 700; color: var(--heading); font-size: 17px; }
.modal-body { padding: 26px; }
.modal-footer { border-top: 1px solid var(--border); padding: 18px 26px; }

/* ============================================================
   Progress Bars
   ============================================================ */
.progress {
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, #059669, #0891b2);
    transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-bar.bg-success { background: linear-gradient(90deg, #059669, #34d399); }
.progress-bar.bg-warning { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-bar.bg-danger { background: linear-gradient(90deg, #e11d48, #fb7185); }

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    position: relative;
    overflow: hidden;
    padding: 24px;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 85%, rgba(5,150,105,.2) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(8,145,178,.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(5,150,105,.08) 0%, transparent 60%);
    animation: loginBgShift 15s ease-in-out infinite alternate;
}
@keyframes loginBgShift {
    0% { opacity: .7; }
    100% { opacity: 1; transform: scale(1.08); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 460px;
    max-width: 94%;
    background: #fff;
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: 0 25px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05);
    padding: 48px 44px;
    animation: loginCardIn .5s cubic-bezier(.4,0,.2,1);
}
@keyframes loginCardIn {
    0% { opacity: 0; transform: translateY(24px) scale(.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card .brand-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #059669, #0891b2);
    display: grid; place-items: center;
    font-size: 26px; color: #fff;
    box-shadow: 0 8px 24px rgba(5,150,105,.3);
}
.login-card h3 {
    color: var(--heading);
    font-weight: 800;
    margin: 0;
    font-size: 24px;
    letter-spacing: -.02em;
}
.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}
.login-card .faculty {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 4px;
    font-weight: 500;
}
.login-card .form-control {
    background: #f8fafc;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 15px;
}
.login-card .form-control:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px var(--primary-ring);
    background: #fff;
}
.login-card label {
    font-weight: 600;
    font-size: 13.5px;
}
.login-card .btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(5,150,105,.3);
    margin-top: 4px;
}
.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 6px 24px rgba(5,150,105,.35);
    transform: translateY(-1px);
}
.login-card .demo-info {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 22px;
}
.login-card .demo-info strong {
    display: block;
    color: var(--heading);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.login-card .demo-info span, .login-card .demo-info code {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ============================================================
   Upload Dropzone
   ============================================================ */
.upload-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    background: #f8fafc;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #059669;
    background: var(--primary-soft);
    box-shadow: 0 0 0 4px var(--primary-ring);
}
.upload-dropzone .drop-icon {
    font-size: 44px;
    color: #94a3b8;
    margin-bottom: 14px;
    display: block;
    transition: all var(--transition);
}
.upload-dropzone:hover .drop-icon,
.upload-dropzone.dragover .drop-icon {
    color: #059669;
    transform: translateY(-4px);
}
.upload-dropzone .drop-text {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}
.upload-dropzone .drop-text strong { color: var(--primary); font-weight: 700; }
.upload-dropzone .file-chosen {
    display: none;
    margin-top: 14px;
    padding: 8px 16px;
    background: var(--success-soft);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: #065f46;
    font-weight: 600;
}
.upload-dropzone .file-chosen.visible { display: inline-block; }
.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    padding: 52px 24px;
    text-align: center;
}
.empty-state i {
    font-size: 52px;
    color: #d1d5db;
    margin-bottom: 18px;
}
.empty-state h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--muted);
    font-size: 15px;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
#flashToastContainer {
    position: fixed !important;
    top: 18px !important;
    right: 18px !important;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#flashToastContainer .toast {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: toastIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
    min-width: 300px;
}
@keyframes toastIn {
    0% { opacity: 0; transform: translateX(40px) scale(.95); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.hide {
    animation: toastOut .25s ease-in forwards !important;
}
@keyframes toastOut {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   Scroll to Top Button
   ============================================================ */
.scroll-top-btn {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 0;
    box-shadow: 0 4px 18px rgba(5,150,105,.3);
    font-size: 20px;
    display: grid; place-items: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: all .3s ease;
    z-index: 800;
}
.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(5,150,105,.4);
}

/* ============================================================
   Attendance print page
   ============================================================ */
.att-sheet {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    margin-bottom: 22px;
    page-break-inside: avoid;
}
.att-sheet .att-head {
    background: linear-gradient(135deg, #059669, #0891b2);
    color: #fff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 600;
}
.att-sheet table { width: 100%; border-collapse: collapse; }
.att-sheet td, .att-sheet th {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    font-size: 13px;
}
.att-sheet th { background: #f1f5f9; font-weight: 600; }

/* ============================================================
   Loading spinner
   ============================================================ */
.spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(2px);
    z-index: 9998;
    place-items: center;
}
.spinner-overlay.active { display: grid; }
.spinner-ring {
    width: 44px; height: 44px;
    border: 3px solid #e2e8f0;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-overlay.open {
        display: block;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
    .app-main { margin-left: 0; width: 100%; }
    .topbar { padding: 0 18px; }
    .content { padding: 22px 18px 32px; }
    .topbar-heading h1 { display: none; }
    .filter-row { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
    .topbar { height: 64px; padding: 0 14px; }
    .kpi-card { padding: 18px; }
    .kpi-card h3 { font-size: 28px; }
    .content { padding: 18px 16px 28px; }
    .page-heading { display: block; }
    .page-heading h2 { font-size: 24px; }
    .panel-body { padding: 18px; }
    .user-pill { display: none; }
    .login-card { padding: 32px 24px; }
    .login-card .brand-icon { width: 48px; height: 48px; font-size: 22px; }
    .scroll-top-btn { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}

/* Filter row */
.filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.filter-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-row .form-control, .filter-row .form-select { width: 100%; }

/* ============================================================
   Print
   ============================================================ */
@media print {
    .sidebar, .topbar, .filter-row, .page-heading, .no-print, .scroll-top-btn { display: none !important; }
    .app-main, .content { margin: 0 !important; width: 100% !important; padding: 0 !important; }
    body { background: #fff !important; }
}