/* ==========================================================================
   HEADWAY INTERNATIONAL — FULL CRM & ERP MASTER STYLESHEET (ALL MODULES)
   ========================================================================== */

:root {
    /* Color Palette */
    --sidebar-bg: #090e23;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active: #1d284e;
    --sidebar-section-title: #64748b;

    --bg-main: #f4f6fa;
    --card-bg: #ffffff;
    --border-color: #eaecf0;
    --border-hover: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --primary-blue: #2563eb;
    --primary-dark: #0f172a;
    --accent-teal: #0d9488;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-purple: #6366f1;

    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.08), 0 2px 4px -1px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(16, 24, 40, 0.1), 0 4px 6px -2px rgba(16, 24, 40, 0.05);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* Text Utility Classes */
.text-success { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }
.text-orange { color: #f59e0b !important; }
.text-purple { color: #8b5cf6 !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-blue) !important; }
.w-full { width: 100% !important; }

/* --- App Layout --- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- Sidebar Navigation --- */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99; opacity: 0; visibility: hidden;
    transition: var(--transition);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex; flex-direction: column; flex-shrink: 0;
    height: 100vh; position: relative; z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition); overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .brand-info,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-arrow { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 1.25rem 0.5rem; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem 0; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.brand-info { display: flex; flex-direction: column; }
.brand-name { font-size: 1.15rem; font-weight: 700; color: #ffffff; letter-spacing: -0.02em; line-height: 1.1; }
.brand-subtitle { font-size: 0.65rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.12em; margin-top: 1px; }

.sidebar-collapse-toggle { color: var(--sidebar-text); font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; }
.sidebar-collapse-toggle:hover { background-color: var(--sidebar-hover); color: #ffffff; }
.sidebar-close-btn { display: none; color: var(--sidebar-text); font-size: 1.2rem; }

.sidebar-nav { padding: 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 1.5rem; }
.nav-section { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav [hidden] { display: none !important; }
.sidebar-search-empty { padding: 0.75rem; color: var(--sidebar-text); font-size: 0.8rem; }
.nav-section-title { font-size: 0.68rem; font-weight: 700; color: var(--sidebar-section-title); letter-spacing: 0.08em; padding: 0.25rem 0.75rem; margin-bottom: 0.25rem; }
.nav-section-quick { padding-bottom: 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 0.15rem; }
.nav-section-quick .nav-section-title { color: #93c5fd; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem; font-size: 0.875rem; font-weight: 500;
    color: var(--sidebar-text); border-radius: var(--radius-md); transition: var(--transition);
}
.nav-item:hover { background-color: var(--sidebar-hover); color: #ffffff; }
.nav-item.active {
    background: linear-gradient(90deg, #1e293b, #1d284e);
    color: #ffffff; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.nav-icon { font-size: 0.95rem; width: 20px; text-align: center; }
.nav-arrow { margin-left: auto; font-size: 0.65rem; opacity: 0.6; }

.student-nav-item {
    padding: 0.5rem 0.85rem; border-radius: var(--radius-md);
    color: var(--text-primary); font-weight: 600; font-size: 0.85rem;
    transition: var(--transition);
}
.student-nav { display: flex; align-items: center; gap: 1rem; }
.student-menu-toggle {
    display: none; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    background-color: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 1rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.student-nav-item:hover { background-color: #f1f5f9; }
.student-nav-item.active {
    background: linear-gradient(90deg, #1e293b, #1d284e);
    color: #ffffff;
}

/* --- Main Wrapper & Header --- */
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; }

.top-header {
    background-color: #ffffff; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 90; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 1rem; flex: 1; max-width: 550px; }
.mobile-toggle-btn { display: none; font-size: 1.25rem; color: var(--text-secondary); padding: 0.4rem; }

.header-search {
    display: flex; align-items: center;
    background-color: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: var(--radius-full); padding: 0.45rem 0.9rem;
    width: 100%; gap: 0.6rem; transition: var(--transition);
}
.header-search:focus-within { background-color: #ffffff; border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.search-icon { color: var(--text-muted); font-size: 0.85rem; }
.header-search input { border: none; background: transparent; width: 100%; font-size: 0.85rem; color: var(--text-primary); }
.search-shortcut { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); background: #ffffff; border: 1px solid #cbd5e1; border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }

.header-right { display: flex; align-items: center; gap: 1rem; }
.branch-selector {
    display: flex; align-items: center; gap: 0.5rem;
    background-color: #ffffff; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 0.45rem 0.85rem;
    font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
    cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.branch-selector:hover { border-color: var(--border-hover); background-color: #f8fafc; }
.branch-icon { color: var(--primary-blue); }
.font-xs { font-size: 0.7rem; }

.btn-create {
    display: flex; align-items: center; gap: 0.4rem;
    background-color: #0f172a; color: #ffffff;
    font-size: 0.85rem; font-weight: 600;
    padding: 0.45rem 0.95rem; border-radius: var(--radius-md);
    transition: var(--transition); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}
.btn-create:hover { background-color: #1e293b; transform: translateY(-1px); }

.header-icon-btn {
    position: relative; width: 36px; height: 36px;
    border-radius: var(--radius-full); display: flex;
    align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 1rem; cursor: pointer; transition: var(--transition);
}
.header-icon-btn:hover { background-color: #f1f5f9; color: var(--text-primary); }
.badge-count {
    position: absolute; top: 2px; right: 2px;
    background-color: #3b82f6; color: #ffffff;
    font-size: 0.65rem; font-weight: 700; width: 16px; height: 16px;
    border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; border: 2px solid #ffffff;
}
.count-red { background-color: var(--accent-red); }

.user-profile { display: flex; align-items: center; gap: 0.6rem; padding-left: 0.5rem; border-left: 1px solid var(--border-color); cursor: pointer; }
.avatar {
    width: 34px; height: 34px; border-radius: var(--radius-full);
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff; font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); line-height: 1.1; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* --- Dashboard Container --- */
.dashboard-container { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; max-width: 1600px; margin: 0 auto; width: 100%; flex: 1; }

.app-footer { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:.3rem; padding:1rem 1.5rem; color:#64748b; font-size:.82rem; text-align:center; border-top:1px solid #e2e8f0; }
.app-footer a { color:#2563eb; text-decoration:none; font-weight:600; }
.app-footer a:hover { text-decoration:underline; }
.pwa-install-button { position:fixed; right:1rem; bottom:1rem; z-index:1500; border:0; border-radius:999px; padding:.75rem 1.1rem; background:#172554; color:#fff; font:600 .9rem Inter,Arial,sans-serif; box-shadow:0 8px 22px #17255440; cursor:pointer; }
.pwa-install-button:hover { background:#1e3a8a; }
.pwa-install-button[hidden] { display:none; }

/* --- Header Banner --- */
.dashboard-banner, .page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.banner-text .overview-tag, .page-header-text .page-tag { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; }
.banner-text h1, .page-header-text h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; margin: 0.1rem 0; }
.banner-text p, .page-header-text p { font-size: 0.875rem; color: var(--text-muted); }

.banner-actions, .page-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.btn-secondary {
    display: flex; align-items: center; gap: 0.4rem;
    background-color: #ffffff; border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    padding: 0.5rem 0.9rem; border-radius: var(--radius-md);
    transition: var(--transition); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background-color: #f8fafc; border-color: var(--border-hover); color: var(--text-primary); }

.btn-primary {
    display: flex; align-items: center; gap: 0.4rem;
    background-color: var(--primary-blue); color: #ffffff;
    font-size: 0.85rem; font-weight: 600; padding: 0.5rem 1rem;
    border-radius: var(--radius-md); transition: var(--transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background-color: #1d4ed8; transform: translateY(-1px); }

.btn-ai-insights {
    display: flex; align-items: center; gap: 0.4rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    color: #ffffff; font-size: 0.85rem; font-weight: 600;
    padding: 0.5rem 1rem; border-radius: var(--radius-md);
    transition: var(--transition); box-shadow: 0 4px 12px rgba(49, 46, 129, 0.35);
}
.btn-ai-insights:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(49, 46, 129, 0.45); }
.btn-ai-insights i { color: #a78bfa; }

/* --- Stats Row & Stat Cards --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.15rem;
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.stat-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* --- KPI Cards Grid --- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.kpi-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.15rem; display: flex;
    flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden; transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.kpi-header { display: flex; align-items: center; justify-content: space-between; }
.kpi-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.06em; }

.kpi-icon {
    width: 42px; height: 42px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.icon-purple { background-color: #f1f5f9; color: #64748b; }
.icon-blue { background-color: #e0f2fe; color: #0284c7; }
.icon-teal { background-color: #d1fae5; color: #059669; }
.icon-orange { background-color: #ffedd5; color: #ea580c; }

.kpi-value-row { margin-top: 0.5rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.kpi-badge-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; font-size: 0.75rem; }
.trend-badge { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-sm); }
.badge-green { background-color: #d1fae5; color: #047857; }
.badge-red { background-color: #fee2e2; color: #b91c1c; }
.kpi-subtext { color: var(--text-muted); font-size: 0.75rem; }
.kpi-chart-wrapper { height: 45px; margin-top: 0.75rem; margin-bottom: -0.5rem; margin-left: -0.5rem; margin-right: -0.5rem; }

/* --- Analytics & Charts Grid --- */
.card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.card-title-group h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.card-title-group p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.analytics-grid { display: grid; grid-template-columns: 8fr 4fr; gap: 1.25rem; }
.time-tabs { display: flex; background-color: #f1f5f9; padding: 3px; border-radius: var(--radius-md); gap: 2px; }
.tab-btn { padding: 3px 10px; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); border-radius: var(--radius-sm); }
.tab-btn.active { background-color: #0f172a; color: #ffffff; }

.chart-legend-row { display: flex; align-items: center; gap: 1.25rem; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.75rem; }
.justify-end { justify-content: flex-end; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.legend-dot { width: 8px; height: 8px; border-radius: var(--radius-full); }
.dot-collected { background-color: #1e1b4b; }
.dot-target { background-color: #94a3b8; }
.legend-box { width: 10px; height: 10px; border-radius: 2px; }
.box-admissions { background-color: #1e293b; }
.box-revenue { background-color: #3b82f6; }
.main-chart-wrapper { height: 280px; width: 100%; position: relative; }

.donut-chart-container { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; margin: 0.5rem 0; }
.donut-center-info { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.center-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.center-val { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.donut-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; justify-content: center; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); margin-top: 0.5rem; }
.legend-chip { display: flex; align-items: center; gap: 0.35rem; }
.dot { width: 8px; height: 8px; border-radius: var(--radius-full); }
.legend-converted { background-color: #10b981; }
.legend-negotiating { background-color: #f59e0b; }
.legend-contacted { background-color: #06b6d4; }
.legend-new { background-color: #3b82f6; }
.legend-lost { background-color: #ef4444; }

.conversion-footer-metrics { display: flex; align-items: center; justify-content: space-around; border-top: 1px solid var(--border-color); padding-top: 0.75rem; margin-top: 1rem; }
.metric-item { display: flex; flex-direction: column; align-items: center; }
.metric-lbl { font-size: 0.72rem; color: var(--text-muted); }
.metric-val { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.metric-divider { width: 1px; height: 24px; background-color: var(--border-color); }

.secondary-grid { display: grid; grid-template-columns: 8fr 4fr; gap: 1.25rem; }
.bar-chart-wrapper { height: 260px; width: 100%; }
.view-all-link { font-size: 0.78rem; font-weight: 600; color: var(--primary-blue); }
.admissions-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.5rem; }
.admission-item { display: flex; align-items: center; gap: 0.75rem; }
.student-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); color: #ffffff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bg-navy { background-color: #0f172a; }
.bg-blue { background-color: #0284c7; }
.bg-teal { background-color: #0d9488; }
.bg-purple { background-color: #7c3aed; }
.bg-darkblue { background-color: #1e3a8a; }
.student-info { flex: 1; min-width: 0; }
.student-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-details { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-full); }
.status-paid { background-color: #d1fae5; color: #047857; }
.status-pending { background-color: #fef3c7; color: #b45309; }

.bottom-widgets-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.lectures-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lecture-item { display: flex; gap: 0.75rem; background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.75rem; }
.lecture-icon-box { width: 36px; height: 36px; border-radius: var(--radius-md); background-color: #e2e8f0; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; }
.lecture-details { display: flex; flex-direction: column; gap: 0.15rem; }
.lecture-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.event-audience { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.45rem; }
.event-audience span { padding:.2rem .55rem; border-radius:999px; background:#f1f5f9; color:#475569; font-size:.72rem; font-weight:600; }
.lecture-meta { font-size: 0.72rem; color: var(--text-muted); }
.lecture-pills { display: flex; gap: 0.4rem; margin-top: 0.2rem; }
.pill-time { font-size: 0.68rem; font-weight: 700; background-color: #e0f2fe; color: #0369a1; padding: 1px 6px; border-radius: 4px; }
.pill-room { font-size: 0.68rem; font-weight: 600; background-color: #f1f5f9; color: var(--text-muted); padding: 1px 6px; border-radius: 4px; }

.tasks-list { display: flex; flex-direction: column; gap: 0.85rem; }
.task-item { display: flex; flex-direction: column; gap: 0.35rem; }
.task-row { display: flex; align-items: center; justify-content: space-between; }
.checkbox-container { display: flex; align-items: center; gap: 0.5rem; position: relative; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { height: 16px; width: 16px; background-color: #ffffff; border: 1.5px solid #cbd5e1; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.checkbox-container input:checked ~ .checkmark { background-color: var(--primary-blue); border-color: var(--primary-blue); }
.checkmark::after { content: ""; display: none; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox-container input:checked ~ .checkmark::after { display: block; }
.text-done { text-decoration: line-through; color: var(--text-light); }
.task-percent { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.progress-bar-bg { width: 100%; height: 6px; background-color: #f1f5f9; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background-color: #0f172a; border-radius: 3px; }
.fill-complete { background-color: #10b981; }

.trophy-icon { color: #f59e0b; font-size: 1rem; }
.leaderboard-list { display: flex; flex-direction: column; gap: 0.7rem; }
.leader-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0; }
.rank-badge { width: 24px; height: 24px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; flex-shrink: 0; }
.rank-1 { background-color: #fef3c7; color: #d97706; }
.rank-2 { background-color: #e2e8f0; color: #475569; }
.rank-3 { background-color: #ffedd5; color: #c2410c; }
.rank-default { background-color: #f1f5f9; color: #94a3b8; }
.leader-info { flex: 1; }
.leader-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.leader-branch { font-size: 0.7rem; color: var(--text-muted); }
.leader-stats { display: flex; flex-direction: column; align-items: flex-end; }
.stat-count { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.stat-rev { font-size: 0.68rem; color: var(--text-muted); }

/* --- Courses Grid --- */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.course-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; transition: var(--transition); }
.course-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.course-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.course-icon-badge { width: 44px; height: 44px; border-radius: var(--radius-md); background-color: #eff6ff; color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.course-meta-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.75rem 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; }
.meta-box .lbl { font-size: 0.68rem; color: var(--text-muted); }
.meta-box .val { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }

/* --- Tables & Filters --- */
.table-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: visible; }
.table-toolbar { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border-color); background-color: #ffffff; flex-wrap: wrap; }
.search-box-sm { display: flex; align-items: center; gap: 0.5rem; background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.4rem 0.75rem; width: 280px; }
.search-box-sm input { border: none; background: transparent; width: 100%; font-size: 0.85rem; }
.table-filters { display: flex; align-items: center; gap: 0.6rem; }
.filter-select {
    background-color: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 0.4rem 2rem 0.4rem 0.75rem; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500;
    appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.65rem center;
    box-shadow: var(--shadow-sm); transition: var(--transition);
}
.filter-select:hover { border-color: var(--border-hover); }
.filter-select:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.table-wrapper { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table-card > .table-wrapper:first-child { border-radius: var(--radius-lg); }
.custom-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: left; }
.custom-table th { background-color: #f8fafc; color: var(--text-muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.custom-table td { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); vertical-align: middle; }
.custom-table tr:hover td { background-color: #f8fafc; }

.user-cell { display: flex; align-items: center; gap: 0.75rem; }
.user-cell-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background-color: var(--primary-blue); color: #ffffff; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-cell-title { font-weight: 700; color: var(--text-primary); font-size: 0.875rem; }
.user-cell-sub { font-size: 0.72rem; color: var(--text-muted); }

.badge-pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.badge-hot { background-color: #fee2e2; color: #dc2626; }
.badge-warm { background-color: #fef3c7; color: #d97706; }
.badge-cold { background-color: #e0f2fe; color: #0284c7; }
.badge-converted { background-color: #d1fae5; color: #059669; }
.badge-active { background-color: #d1fae5; color: #059669; }
.badge-pending { background-color: #fef3c7; color: #b45309; }

.action-btn { width: 30px; height: 30px; border-radius: var(--radius-md); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); }
.action-btn:hover { background-color: #f1f5f9; color: var(--text-primary); }

.material-chip-list { display: flex; flex-direction: column; gap: 0.35rem; }
.material-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background-color: #f1f5f9; border-radius: var(--radius-md);
    padding: 0.3rem 0.5rem; font-size: 0.78rem; width: fit-content; max-width: 100%;
}
.material-chip a { color: var(--text-primary); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-chip a:hover { color: var(--primary-blue); }
.material-chip i.fa-file-pdf { color: #dc2626; }
.material-chip i.fa-file-excel { color: #059669; }
.material-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; padding: 0; font-size: 0.75rem; }
.material-chip button:hover { color: #dc2626; }

.table-pagination { padding: 0.85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 0.3rem; }
.page-num { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.78rem; border: 1px solid var(--border-color); }
.page-num.active { background-color: var(--primary-dark); color: #ffffff; border-color: var(--primary-dark); }
.page-num.is-disabled { opacity: .45; cursor: default; }
button.page-num { cursor: pointer; background: #fff; color: var(--text-primary); }
button.page-num.active { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

/* --- UNIVERSAL MODAL DIALOG --- */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex !important;
}

.modal-container {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlide 0.25s ease-out;
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 10px;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

select.form-control:hover:not(:disabled) {
    border-color: var(--border-hover);
}

select.form-control:disabled {
    background-color: #f8fafc;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

input[type="file"].form-control {
    padding: 0.45rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    background-color: #f8fafc;
}

input[type="file"].form-control::file-selector-button {
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--primary-blue);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

input[type="file"].form-control::file-selector-button:hover {
    background-color: var(--primary-blue-dark, #1d4ed8);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    width: 100%;
    padding-right: 2.5rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) { .analytics-grid, .secondary-grid { grid-template-columns: 1fr; } .bottom-widgets-grid { grid-template-columns: repeat(1, 1fr); } }
@media (max-width: 850px) {
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
    .sidebar.active { left: 0; }
    .sidebar-close-btn { display: block; }
    .mobile-toggle-btn { display: block; }
    .header-left { max-width: none; }
    .search-shortcut { display: none; }
    .branch-selector span { display: none; }
    .student-menu-toggle { display: inline-flex; }
    .student-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0.25rem;
        background-color: #ffffff; border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md); padding: 0.75rem 1rem;
    }
    .student-nav.active { display: flex; }
    .student-nav .student-nav-item { padding: 0.75rem 0.9rem; font-size: 0.9rem; }
}
@media (max-width: 600px) {
    .dashboard-container { padding: 1rem; }
    .kpi-grid { grid-template-columns: 1fr; }
    .dashboard-banner, .page-header { flex-direction: column; align-items: flex-start; }
    .banner-actions, .page-header-actions { width: 100%; justify-content: flex-start; }
    .user-info { display: none; }
}

/* ==========================================================================
   STUDENT PROFILE PAGE
   ========================================================================== */

.admission-item { border-radius: var(--radius-md); transition: var(--transition); }
.admission-item[href] { cursor: pointer; }
.admission-item[href]:hover { background-color: #f8fafc; }

.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; transition: var(--transition); }
.back-link:hover { color: var(--primary-blue); }

.profile-header-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm); display: flex; align-items: center;
    justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    position: relative; overflow: hidden;
}
.profile-header-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #1e293b, #3b82f6, #0d9488);
}
.profile-header-main { display: flex; align-items: center; gap: 1.25rem; }
.profile-avatar-lg {
    width: 76px; height: 76px; border-radius: var(--radius-full);
    color: #1d4ed8; font-size: 1.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25); flex-shrink: 0;
}
.profile-name-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.profile-name-row h2 { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.profile-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; font-weight: 500; }
.profile-contact-row { display: flex; gap: 1.25rem; margin-top: 0.6rem; flex-wrap: wrap; }
.profile-contact-row span { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.profile-contact-row i { color: var(--primary-blue); font-size: 0.85rem; }
.profile-header-actions { display: flex; gap: 0.6rem; }
.icon-action-btn {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    border: 1px solid var(--border-color); background-color: #ffffff;
    color: var(--text-secondary); display: flex; align-items: center;
    justify-content: center; font-size: 1rem; transition: var(--transition);
}
.icon-action-btn:hover { background-color: #f8fafc; border-color: var(--border-hover); color: var(--primary-blue); }

.profile-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border-color); padding: 0 0.25rem; overflow-x: auto; }
.profile-tab-btn { padding: 0.75rem 1.1rem; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid transparent; transition: var(--transition); white-space: nowrap; }
.profile-tab-btn:hover { color: var(--text-primary); }
.profile-tab-btn.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); }

.tab-panel { display: none; flex-direction: column; gap: 1.25rem; }
.tab-panel.active { display: flex; }

.overview-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 1.25rem; align-items: start; }
.info-list { display: flex; flex-direction: column; gap: 0.9rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.75rem; border-bottom: 1px dashed var(--border-color); }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.info-value { font-size: 0.85rem; color: var(--text-primary); font-weight: 700; text-align: right; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 0.9rem; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 10px; height: 10px; border-radius: var(--radius-full); background-color: var(--primary-blue); flex-shrink: 0; margin-top: 4px; }
.timeline-line { flex: 1; width: 2px; background-color: var(--border-color); margin-top: 4px; min-height: 20px; }
.timeline-content { flex: 1; padding-bottom: 1.25rem; }
.timeline-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.timeline-date { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.timeline-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.25rem; }

.attendance-summary-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 1.25rem; align-items: start; }
.attendance-ring-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
.attendance-sessions-list { display: flex; flex-direction: column; gap: 0.6rem; }
.session-row { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.75rem; background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.session-date { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.session-topic { font-size: 0.72rem; color: var(--text-muted); }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; }
.doc-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; transition: var(--transition); }
.doc-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.doc-icon { width: 42px; height: 42px; border-radius: var(--radius-md); background-color: #eff6ff; color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.doc-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.doc-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.doc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

@media (max-width: 1100px) {
    .overview-grid, .attendance-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .profile-header-card { flex-direction: column; align-items: flex-start; }
    .profile-header-actions { width: 100%; }
}

/* ==========================================================================
   STUDENT FOLLOW-UP MODULE
   ========================================================================== */

.toolbar-bar {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}

.followup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }
.followup-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 0.9rem; transition: var(--transition);
}
.followup-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.followup-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.followup-reason { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; }
.followup-reason i { color: var(--primary-blue); }

.followup-meta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.75rem 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.followup-meta-box { display: flex; flex-direction: column; gap: 2px; }
.followup-meta-box .lbl { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.followup-meta-box .val { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }

.followup-note { font-size: 0.78rem; color: var(--text-secondary); font-style: italic; line-height: 1.5; }

.followup-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; }
.followup-actions { display: flex; gap: 0.4rem; }
.followup-actions .icon-action-btn { width: 34px; height: 34px; font-size: 0.85rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }

.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2rem; opacity: 0.4; }

/* Follow-up tab inside Student Profile */
.followup-tab-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 1.25rem; align-items: start; }
.risk-score-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem 0; }
.risk-score-val { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
.risk-score-lbl { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; }
.reminder-box { display: flex; align-items: center; gap: 0.75rem; background-color: #f8fafc; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.85rem 1rem; margin-top: 0.75rem; }
.reminder-icon { width: 38px; height: 38px; border-radius: var(--radius-md); background-color: #eff6ff; color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.reminder-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.reminder-sub { font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 1100px) {
    .followup-tab-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .followup-meta-row { grid-template-columns: 1fr; gap: 0.35rem; }
    .followup-card-footer { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   BRANCH MANAGEMENT MODULE
   ========================================================================== */

.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.branch-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 0.85rem; transition: var(--transition);
}
.branch-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.branch-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.branch-icon-badge { width: 44px; height: 44px; border-radius: var(--radius-md); background-color: #eff6ff; color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.branch-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.branch-manager-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--text-secondary); }
.branch-manager-row strong { color: var(--text-primary); }

/* ==========================================================================
   USERS & ROLES / PERMISSIONS MODULE
   ========================================================================== */

.bg-orange { background-color: #ea580c; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.role-card {
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 0.85rem; transition: var(--transition);
}
.role-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.role-card.active { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.role-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.role-icon-badge { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.role-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.role-perm-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.perm-badge { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); background-color: #f1f5f9; border-radius: var(--radius-sm); padding: 3px 8px; }

.permission-matrix th, .permission-matrix td { text-align: center; }
.permission-matrix th:first-child, .permission-matrix td:first-child { text-align: left; }
.perm-check { color: var(--accent-green); font-size: 0.95rem; }
.perm-cross { color: var(--text-light); font-size: 0.85rem; opacity: 0.5; }

/* ==========================================================================
   ACCOUNTS & EXPENSE LEDGER
   ========================================================================== */

.expense-category-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.25rem; }
.expense-category-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.expense-category-name { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.expense-category-amount { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }

/* ==========================================================================
   ATTENDANCE REPORT
   ========================================================================== */

.report-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.report-filter-mode { display: flex; background-color: #f1f5f9; padding: 3px; border-radius: var(--radius-md); gap: 2px; }
.report-filter-inputs { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.filter-input-group { display: flex; align-items: center; gap: 0.5rem; }
.filter-input-group .form-control { padding: 0.5rem 0.75rem; font-size: 0.82rem; }
.range-separator { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

@media (max-width: 700px) {
    .report-filter-row { flex-direction: column; align-items: stretch; }
    .report-filter-inputs { flex-direction: column; align-items: stretch; }
    .filter-input-group { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   LOGIN
   ========================================================================== */

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: var(--bg-main); padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.5rem; }
.login-card .brand-logo { justify-content: center; margin-bottom: 1.75rem; }
.login-card h1 { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 0.35rem; }
.login-card p.login-subtext { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-bottom: 2rem; }
.login-card form { display: flex; flex-direction: column; gap: 1.25rem; }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 0.25rem; padding: 0.7rem 0.85rem; }
.login-error { background-color: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 0.8rem; padding: 0.65rem 0.9rem; border-radius: var(--radius-md); margin-bottom: 1.25rem; }
.login-success { background-color: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; font-size: 0.8rem; padding: 0.65rem 0.9rem; border-radius: var(--radius-md); margin-bottom: 1.25rem; }
.login-options-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; margin-top: -0.5rem; }
.login-options-row a { color: var(--primary-blue); font-weight: 600; }
.login-remember { display: flex; align-items: center; gap: 0.4rem; color: var(--text-secondary); cursor: pointer; }
.login-back-link { display: block; text-align: center; margin-top: 1.5rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.login-back-link i { margin-right: 0.3rem; }
button.header-icon-btn { background: none; border: none; padding: 0; }
.schedule-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.schedule-row .form-control { flex: 1; }

.modal-container { display: flex; flex-direction: column; max-height: 90vh; }
.modal-container > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-header, .modal-footer { flex-shrink: 0; }
.modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.branch-selector-wrap { position: relative; }

/* Generic dropdown panel system — reused by the branch selector, notifications,
   and JS-enhanced custom selects (see .custom-select-wrap below). Keep the
   .branch-dropdown-* names as aliases so existing markup keeps working untouched. */
.branch-dropdown-menu, .dropdown-panel {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0;
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    min-width: 190px; padding: 0.4rem; z-index: 300;
    flex-direction: column; gap: 2px;
    max-height: 280px; overflow-y: auto;
}
.branch-dropdown-menu.active, .dropdown-panel.active { display: flex; }
.branch-dropdown-item, .dropdown-option {
    display: block; width: 100%; text-align: left;
    padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; color: var(--text-primary);
    background: none; border: none; cursor: pointer; transition: var(--transition);
}
.branch-dropdown-item:hover, .dropdown-option:hover { background-color: #eff6ff; }
.branch-dropdown-item.active, .dropdown-option.active { background-color: #dbeafe; color: var(--primary-blue); font-weight: 700; }

/* Custom select — a JS-enhanced native <select> that visually matches the
   dropdown-panel system above while the real <select> keeps handling the
   value/name/required/change-event/form-submission behind the scenes. */
.custom-select-wrap { position: relative; display: inline-block; }
.custom-select-wrap .custom-select-native {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; pointer-events: none;
}
.custom-select-trigger {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    background-color: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition);
    width: 100%; min-width: 140px;
}
.custom-select-trigger:hover { border-color: var(--border-hover); }
.custom-select-trigger:focus-visible { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.custom-select-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger i { font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; transition: var(--transition); }
.custom-select-trigger.is-open i { transform: rotate(180deg); }
.custom-select-trigger.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.custom-select-wrap .dropdown-panel { right: 0; left: 0; width: max-content; min-width: 100%; }

.notif-wrap { position: relative; }
.notif-dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 0;
    background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    width: 340px; max-width: 90vw; z-index: 200;
    flex-direction: column;
}
.notif-dropdown-menu.active { display: flex; }
.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem; font-weight: 700; color: var(--text-primary);
}
.notif-clear-btn { background: none; border: none; font-size: 0.78rem; font-weight: 600; color: var(--primary-blue); cursor: pointer; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 0.7rem; padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color); transition: var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background-color: #f8fafc; }
.notif-item.unread { background-color: #eff6ff; }
.notif-icon {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-full);
    background-color: #eef2ff; color: var(--primary-blue);
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.notif-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.notif-message { font-size: 0.78rem; color: var(--text-secondary); margin-top: 1px; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }
.notif-empty { padding: 2rem 1rem; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

.main-wrapper { overflow-x: hidden; }

@media (max-width: 480px) {
    .top-header { padding: 0 0.75rem; gap: 0.5rem; }
    .header-search { display: none; }
    .header-right { gap: 0.4rem; }
    .btn-create span { display: none; }
    .btn-create { padding: 0.5rem; }
    .header-icon-btn.fullscreen-btn { display: none; }
    .branch-selector { padding: 0.4rem 0.5rem; }
    .search-box-sm { width: 100%; }
    .toolbar-bar, .table-toolbar { padding: 0.85rem 1rem; }
    .table-filters { flex-wrap: wrap; }
}

.brand-logo-chip { background-color: #ffffff; border-radius: var(--radius-md); padding: 0.4rem 0.6rem; display: inline-flex; }
.brand-logo-chip img { display: block; width: 100%; height: auto; max-width: 190px; }
.login-card .brand-logo-chip img { max-width: 240px; }

/* --- Student portal: mobile view only (smaller type, tighter spacing) --- */
@media (max-width: 600px) {
    html.student-portal { font-size: 13.5px; }
    .student-portal .top-header { padding: 0 0.75rem; }
    .student-portal .dashboard-container { padding: 0.85rem; gap: 1rem; }
    .student-portal .dashboard-banner h1,
    .student-portal .page-header-text h1 { font-size: 1.35rem; }
    .student-portal .profile-header-card { padding: 1.1rem; }
    .student-portal .profile-header-main { flex-direction: column; align-items: flex-start; gap: 0.75rem; width: 100%; }
    .student-portal .profile-header-info { min-width: 0; width: 100%; }
    .student-portal .profile-avatar-lg { width: 58px; height: 58px; font-size: 1.15rem; }
    .student-portal .profile-name-row h2 { font-size: 1.1rem; }
    .student-portal .profile-contact-row { flex-direction: column; gap: 0.45rem; }
    .student-portal .profile-contact-row span { word-break: break-word; }
    .student-portal .kpi-value { font-size: 1.3rem; }
    .student-portal .card { padding: 1rem; }
    .student-portal .custom-table th { padding: 0.65rem 0.75rem; font-size: 0.68rem; }
    .student-portal .custom-table td { padding: 0.7rem 0.75rem; font-size: 0.8rem; }
    .student-portal .info-row { flex-wrap: wrap; gap: 0.2rem; }
}

/* --- Table export buttons (Excel / PDF) --- */
.export-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.export-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background-color: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.export-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.export-btn[data-export="excel"] i { color: #16a34a; }
.export-btn[data-export="pdf"] i { color: #dc2626; }
.table-toolbar.export-only { justify-content: flex-end; padding: 0.75rem 1.25rem; }

/* --- Dashboard / chart widgets: let grid cells and chart containers shrink (fixes horizontal overflow on small screens) --- */
.kpi-grid > *, .analytics-grid > *, .secondary-grid > *, .bottom-widgets-grid > * { min-width: 0; }
.main-chart-wrapper, .bar-chart-wrapper, .donut-chart-container, .kpi-chart-wrapper { position: relative; min-width: 0; max-width: 100%; }
.dashboard-container { min-width: 0; }

@media (max-width: 1100px) {
    .analytics-grid, .secondary-grid, .bottom-widgets-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- Dashboard: mobile view only (smaller sizes, tighter spacing) --- */
@media (max-width: 600px) {
    .dashboard-container { padding: 0.85rem; gap: 1rem; }
    .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: 0.85rem; }
    .analytics-grid, .secondary-grid, .bottom-widgets-grid { gap: 1rem; }
    .banner-text h1, .page-header-text h1 { font-size: 1.35rem; }
    .banner-text p, .page-header-text p { font-size: 0.8rem; }
    .banner-actions .btn-primary, .banner-actions .btn-secondary { padding: 0.5rem 0.85rem; font-size: 0.8rem; }

    .kpi-card { padding: 0.95rem; }
    .kpi-icon { width: 36px; height: 36px; font-size: 0.95rem; }
    .kpi-value { font-size: 1.35rem; }
    .kpi-title { font-size: 0.68rem; }

    .card { padding: 1rem; }
    .card-header { flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; }
    .card-title-group h3 { font-size: 0.95rem; }
    .card-title-group p { font-size: 0.72rem; }
    .tab-btn { padding: 3px 8px; font-size: 0.68rem; }

    .main-chart-wrapper { height: 220px; }
    .bar-chart-wrapper { height: 210px; }
    .donut-chart-container { height: 160px; }
    .center-val { font-size: 1.05rem; }
    .chart-legend-row { flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.72rem; }
    .donut-legend { font-size: 0.68rem; }

    .conversion-footer-metrics { flex-wrap: wrap; gap: 0.6rem; }
    .metric-val { font-size: 0.85rem; }
    .admissions-list { gap: 0.7rem; }
    .student-name { font-size: 0.8rem; }
    .lecture-item { padding: 0.6rem; gap: 0.6rem; }
    .lecture-title { font-size: 0.8rem; }
}

@media print {
    @page { margin: 12mm; }
    html, body, .app-container, .main-wrapper, .dashboard-container {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        width: auto !important;
        background: #fff !important;
    }
    .sidebar, .sidebar-overlay, .top-header, .page-header-actions, .profile-tabs,
    .modal-backdrop, .action-btn, .followup-actions, button, form,
    .export-actions, .table-toolbar {
        display: none !important;
    }
    .main-wrapper { flex: 1 1 auto !important; }
    .dashboard-container { padding: 0 !important; margin: 0 !important; }
    .tab-panel, .tab-panel.active { display: flex !important; }
    .card, .profile-header-card, .table-card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}
/* Exams module */
.exam-student-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.1rem}.exam-student-card{padding:1.25rem;display:flex;flex-direction:column;gap:.75rem}.exam-student-card-top{display:flex;align-items:center;justify-content:space-between}.exam-student-icon,.exam-result-icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;color:#2563eb;background:#eff6ff;font-size:1.15rem}.exam-status-pill{font-size:.75rem;font-weight:700;border-radius:999px;padding:.35rem .65rem;background:#f1f5f9;color:#64748b}.exam-status-pill.is-open{background:#dcfce7;color:#15803d}.exam-student-card h2{margin:0;font-size:1.1rem}.exam-student-card>p,.exam-empty-state p{color:#64748b;margin:0;line-height:1.55}.exam-student-meta{display:flex;gap:.55rem 1rem;flex-wrap:wrap;color:#475569;font-size:.8rem}.exam-student-meta i{color:#2563eb;margin-right:.25rem}.exam-student-scope{font-size:.8rem;color:#64748b}.exam-last-result{display:flex;flex-direction:column;gap:.2rem;border-top:1px solid #e2e8f0;padding-top:.8rem;margin-top:.15rem}.exam-last-result strong{font-size:.85rem}.exam-last-result span{font-size:.8rem;color:#64748b}.exam-card-action{width:100%;text-align:center;justify-content:center;margin-top:auto}.exam-empty-state{text-align:center;padding:3rem 1.5rem;grid-column:1/-1}.exam-empty-state .exam-student-icon{margin:0 auto 1rem}.exam-attempt-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}.exam-attempt-header h1{margin:.45rem 0}.exam-attempt-header p{color:#64748b;max-width:760px}.exam-countdown{position:sticky;top:1rem;z-index:2;border-radius:14px;background:#0f172a;color:#fff;padding:.8rem 1rem;font-size:1.2rem;font-weight:800;white-space:nowrap;box-shadow:0 6px 20px #0f172a22}.exam-countdown.is-low{background:#b91c1c}.exam-answer-card{padding:1.3rem;margin-bottom:1rem}.exam-answer-heading{display:flex;justify-content:space-between;color:#64748b;font-size:.82rem;font-weight:700;margin-bottom:.9rem}.exam-answer-card h2{font-size:1.05rem;line-height:1.55;margin:0 0 1rem}.exam-answer-options{display:grid;gap:.65rem}.exam-answer-option{display:flex;align-items:center;gap:.75rem;padding:.75rem;border:1px solid #e2e8f0;border-radius:12px;cursor:pointer}.exam-answer-option:has(input:checked){border-color:#2563eb;background:#eff6ff}.exam-answer-option input{accent-color:#2563eb}.exam-answer-option-letter{width:28px;height:28px;border-radius:50%;background:#f1f5f9;display:grid;place-items:center;font-weight:700;color:#475569}.exam-puzzle-answer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:1rem}.exam-puzzle-answer{display:grid;gap:.55rem;font-weight:600}.exam-puzzle-answer img{width:100%;height:180px;object-fit:contain;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.exam-matching-game{display:grid;gap:1rem}.exam-match-bank{padding:.9rem;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px}.exam-match-chips{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:.65rem}.exam-match-chip{cursor:grab;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:.5rem .8rem;font-weight:600}.exam-match-chip:active{cursor:grabbing}.exam-match-rows{display:grid;gap:.65rem}.exam-match-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(180px,1.4fr) minmax(160px,1fr);align-items:center;gap:.75rem}.exam-drop-slot{min-height:42px;border:1px dashed #94a3b8;border-radius:9px;padding:.65rem;color:#94a3b8}.exam-drop-slot.has-answer{border-style:solid;border-color:#86efac;background:#f0fdf4;color:#166534}.exam-match-select{display:none}.exam-submit-bar{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;margin-top:1rem;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 -5px 22px #0f172a0c;z-index:1}.exam-submit-bar span{font-size:.85rem;color:#64748b}.exam-result-card{max-width:620px;margin:1rem auto;padding:2rem;text-align:center}.exam-result-icon{width:64px;height:64px;margin:0 auto 1rem;border-radius:20px;background:#fef3c7;color:#d97706;font-size:1.5rem}.exam-result-caption{color:#64748b}.exam-result-score{font-size:3.5rem;font-weight:800;line-height:1.2;margin:.6rem 0}.exam-result-score small{font-size:1.3rem;color:#94a3b8;font-weight:600}.exam-result-stats{display:grid;grid-template-columns:repeat(3,1fr);border-block:1px solid #e2e8f0;padding:1rem 0;margin:1.2rem 0}.exam-result-stats div{display:grid;gap:.3rem}.exam-result-stats span{font-size:.75rem;color:#64748b}.exam-result-stats strong{font-size:1.1rem}.exam-result-card>p{color:#64748b;font-size:.85rem}.exam-result-card>.btn-primary{display:inline-flex;margin-top:.75rem}
@media(max-width:700px){.exam-attempt-header{display:block}.exam-countdown{position:fixed;top:auto;right:1rem;bottom:1rem}.exam-match-row{grid-template-columns:1fr}.exam-drop-slot{display:none}.exam-match-select{display:block}.exam-submit-bar{align-items:stretch;flex-direction:column}.exam-result-card{padding:1.25rem}.exam-result-score{font-size:2.8rem}}
.exam-builder-section{margin-bottom:1.25rem}.exam-details-grid,.exam-question-common{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.exam-field-wide{grid-column:1/-1}.exam-section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem}.exam-section-heading h2{margin:0}.exam-section-heading p,.card-title-group p{color:#64748b;margin:.35rem 0 0}.exam-question-builder{padding:1.15rem;margin-bottom:1rem}.exam-question-builder-head,.exam-puzzle-row,.exam-pair-row,.exam-grade-row{display:flex;align-items:flex-end;gap:.8rem}.exam-question-builder-head{justify-content:space-between;align-items:center;margin-bottom:1rem}.exam-question-number{font-weight:800;color:#1e3a8a}.exam-question-common{grid-template-columns:minmax(180px,1fr) 140px}.exam-options-heading,.exam-items-heading{display:flex;justify-content:space-between;gap:.75rem;margin:.75rem 0;color:#334155}.exam-options-heading span,.exam-items-heading span{color:#64748b;font-size:.85rem}.exam-option-row{display:grid;grid-template-columns:30px minmax(140px,1fr) auto;gap:.65rem;align-items:center;margin:.6rem 0}.exam-option-number{height:28px;width:28px;border-radius:50%;display:grid;place-items:center;background:#f1f5f9}.exam-correct-choice{display:flex;align-items:center;gap:.35rem;font-size:.8rem;color:#475569}.exam-puzzle-row,.exam-pair-row{margin:.7rem 0;padding:.8rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.exam-puzzle-row .form-group,.exam-pair-row .form-group{flex:1;margin:0}.exam-pair-arrow{align-self:center;color:#94a3b8;padding-bottom:.5rem}.exam-grade-row{margin:.7rem 0}.exam-grade-row .form-group{flex:1;margin:0}.exam-total-strip{display:flex;justify-content:flex-end;gap:.5rem;padding:.75rem 1rem;border-radius:10px;background:#eff6ff;color:#1e40af}.exam-form-actions{display:flex;justify-content:flex-end;gap:.75rem;margin:1.25rem 0}.exam-actions-cell{white-space:nowrap}.exam-actions-cell>*{margin:.1rem}
@media(max-width:700px){.exam-details-grid,.exam-question-common{grid-template-columns:1fr}.exam-section-heading{align-items:flex-start;flex-direction:column}.exam-puzzle-row,.exam-pair-row,.exam-grade-row{align-items:stretch;flex-direction:column}.exam-option-row{grid-template-columns:26px 1fr}.exam-correct-choice{grid-column:2}}
/* Exam detail page refinements */
.exam-detail-card{padding:1.35rem;margin-bottom:1.15rem}.exam-detail-card .card-header{padding:0 0 1rem;margin:0 0 .3rem;border-bottom:1px solid #e8edf4}.exam-detail-card .card-title-group h3{font-size:1.05rem;margin:0}.exam-details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 2rem;padding:1.2rem 0}.exam-details-grid>div{display:grid;align-content:start;gap:.3rem;min-width:0}.exam-detail-label{font-size:.76rem;text-transform:uppercase;letter-spacing:.045em;color:#718096;font-weight:700}.exam-details-grid strong{font-size:.92rem;color:#17233b;line-height:1.45}.exam-grade-summary{display:flex;flex-wrap:wrap;gap:.65rem;padding-top:.35rem}.exam-grade-chip{display:flex;flex-direction:column;gap:.25rem;min-width:135px;padding:.75rem .9rem;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}.exam-grade-chip strong{color:#1e3a8a}.exam-grade-chip small{font-size:.76rem;color:#64748b}.exam-window-note{display:flex;align-items:flex-start;gap:.65rem;padding:.8rem .9rem;border:1px solid #bfdbfe;background:#eff6ff;border-radius:10px;color:#1e40af;font-size:.84rem;line-height:1.5}.exam-window-note i{margin-top:.15rem}.exam-instructions{margin-top:.8rem;padding:.9rem 1rem;border-left:3px solid #60a5fa;background:#f8fafc;border-radius:0 10px 10px 0}.exam-instructions p{margin:.35rem 0 0;color:#475569;white-space:pre-line;line-height:1.55}.exam-preview-question{padding:1.2rem 1.35rem;margin:.75rem 0}.exam-preview-title{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.8rem}.exam-preview-question h3{font-size:1rem;margin:0 0 .8rem;line-height:1.5}.exam-preview-options{margin:.3rem 0 0;padding-left:1.5rem;display:grid;gap:.4rem;color:#334155}.exam-preview-options li{padding-left:.2rem}.exam-preview-options span{display:inline-flex;padding:.45rem .65rem;margin:.2rem;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc}.exam-preview-images{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.75rem}.exam-preview-images img{width:100%;height:150px;object-fit:contain;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px}.exam-readonly-status{display:grid;gap:.5rem;align-content:start;font-size:.78rem;color:#64748b;line-height:1.45}.exam-readonly-status .badge-pill{width:max-content}.exam-actions-cell{display:flex;flex-wrap:wrap;gap:.3rem}.exam-actions-cell>*{margin:0!important}
@media(max-width:700px){.exam-details-grid{grid-template-columns:1fr;gap:.8rem}.exam-grade-chip{flex:1;min-width:calc(50% - .65rem)}.exam-detail-card{padding:1rem}.exam-preview-question{padding:1rem}.exam-window-note{font-size:.78rem}}

.exam-select-options{display:grid;gap:.7rem}.exam-select-option-row{display:grid;grid-template-columns:30px minmax(140px,1fr) minmax(180px,1fr) auto auto;align-items:end;gap:.65rem;padding:.8rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.exam-select-option-row .form-group{margin:0}.exam-select-drag{display:grid;gap:.9rem}.exam-select-bank{display:flex;flex-wrap:wrap;gap:.65rem}.exam-select-chip,.exam-select-picked-chip{display:flex;align-items:center;gap:.5rem;cursor:grab;padding:.55rem .75rem;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff;color:#1d4ed8;font-weight:600}.exam-select-chip img,.exam-select-picked-chip img,.exam-preview-options img{width:68px;height:54px;object-fit:contain;border-radius:8px;background:white}.exam-select-chip.is-picked{opacity:.45}.exam-select-tray{min-height:100px;padding:.8rem;border:2px dashed #94a3b8;border-radius:12px;background:#f8fafc}.exam-select-picked{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.6rem}.exam-select-picked-chip{cursor:pointer;border-color:#86efac;background:#f0fdf4;color:#166534}.exam-select-placeholder{display:block;color:#64748b;font-size:.85rem;margin-top:.6rem}.exam-preview-options span{display:inline-flex;align-items:center;gap:.4rem;margin:.25rem;padding:.5rem;background:#f8fafc;border-radius:8px}@media(max-width:700px){.exam-select-option-row{grid-template-columns:28px 1fr}.exam-select-option-row .form-group{grid-column:2}.exam-select-option-row .exam-correct-choice{grid-column:2}.exam-select-option-row .icon-action-btn{grid-column:2}}
/* Shared server and client form validation feedback. */
.form-error-summary { box-sizing:border-box; width:100%; padding:12px 16px; margin:0 0 16px; border:1px solid #fecaca; border-radius:10px; background:#fef2f2; color:#991b1b; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.form-error-summary ul { margin:6px 0 0; padding-left:20px; }
.form-error-summary p { margin:8px 0 0; }
.form-error-summary:focus { outline:2px solid #dc2626; outline-offset:2px; }
.form-error-link { padding:0; border:0; background:transparent; color:inherit; font:inherit; text-align:left; text-decoration:underline; cursor:pointer; }
.form-field-invalid, .form-control.form-field-invalid { border-color:#dc2626 !important; }
.validation-field-error { display:block; margin-top:5px; color:#b91c1c; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
