/* School Management System - Admin Dashboard style
 * Responsive breakpoints (Bootstrap 5): xs <576px, sm ≥576px, md ≥768px, lg ≥992px, xl ≥1200px
 * Sidebar: fixed on lg+, collapsible (hamburger) below lg. Test: 360px, 768px, 1024px, 1440px
 */
:root {
    --sidebar-green: #1a5f4a;
    --sidebar-green-light: #248f6f;
    --sidebar-green-active: #2da87d;
    --main-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --green: #16a34a;
    --blue: #2563eb;
    --orange: #ea580c;
    --red: #dc2626;
    --purple: #7c3aed;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--main-bg); color: var(--text); min-height: 100vh; line-height: 1.5; overflow-x: hidden; }
body.sidebar-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }

/* Responsive images (Bootstrap breakpoints: sm 576, md 768, lg 992, xl 1200) */
img { max-width: 100%; height: auto; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem;
    background: #f3f4f6;
    color: #111827;
    position: relative;
}
.login-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45%;
    min-height: 280px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 320'%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='1.2' opacity='0.35' d='M0 160 Q300 60 600 160 T1200 160'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='1' opacity='0.3' d='M0 200 Q300 100 600 200 T1200 200'/%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='1' opacity='0.3' d='M0 120 Q300 220 600 120 T1200 120'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='0.9' opacity='0.25' d='M-80 260 Q250 160 580 260 T1200 260'/%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='0.7' opacity='0.28' d='M0 80 Q400 200 600 80 T1200 80'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='0.6' opacity='0.2' d='M0 240 Q350 140 700 240 T1200 240'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.login-page::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 220px;
    min-height: 180px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 280'%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='1.2' opacity='0.35' d='M0 140 Q300 220 600 140 T1200 140'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='1' opacity='0.3' d='M0 180 Q300 100 600 180 T1200 180'/%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='1' opacity='0.3' d='M0 100 Q300 180 600 100 T1200 100'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='0.9' opacity='0.25' d='M-80 220 Q250 120 580 220 T1200 220'/%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='0.7' opacity='0.28' d='M0 60 Q400 180 600 60 T1200 60'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='0.6' opacity='0.2' d='M0 200 Q350 100 700 200 T1200 200'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center bottom;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.login-shell {
    width: 100%;
    max-width: 980px;
    position: relative;
    z-index: 1;
}
.login-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 610px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 22px 52px rgba(17, 24, 39, 0.14);
}
.login-card.row { display: flex; flex-wrap: wrap; grid-template-columns: unset; min-height: auto; }
.login-card.row .login-left { min-height: 400px; }
.login-card.row .login-right { min-height: 400px; }
.login-left {
    padding: 2.8rem 2.9rem 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fdf9 0%, #f7fafc 50%, #f0f9ff 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400'%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='0.8' opacity='0.12' d='M0 200 Q400 120 800 200 T1200 200'/%3E%3Cpath fill='none' stroke='%233b82f6' stroke-width='0.8' opacity='0.1' d='M0 260 Q300 160 600 260 T1200 260'/%3E%3Cpath fill='none' stroke='%2316a34a' stroke-width='0.6' opacity='0.08' d='M0 140 Q500 220 800 140 T1200 140'/%3E%3C/svg%3E"), linear-gradient(135deg, #f8fdf9 0%, #f7fafc 50%, #f0f9ff 100%);
    background-size: cover, 100% 100%;
    background-position: center, 0 0;
    background-repeat: no-repeat, repeat;
}
.login-left::before {
    content: "";
    position: absolute;
    bottom: -60px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.18) 0%, rgba(22, 163, 74, 0.06) 40%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
.login-left::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.05) 40%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
.login-left .login-brand-minimal,
.login-left .alert-error,
.login-left .login-form {
    position: relative;
    z-index: 1;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.9rem;
}
.login-brand-minimal {
    margin-bottom: 1.1rem;
    min-height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: lowercase;
}
.login-brand-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #16a34a;
    line-height: 0.9;
    text-transform: lowercase;
}
.login-brand-subtitle {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: #6b7280;
}
.login-detected-school-logo-wrap {
    margin-top: 0;
    min-height: 140px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
#schoolLogo,
.login-detected-school-logo {
    max-height: 150px;
    width: auto;
    display: block;
    margin: 0 auto 25px auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
}
.login-detected-school-logo {
    max-width: 300px;
    width: auto;
}
.login-title {
    margin: 0 0 1rem;
    font-size: 2.6rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.08;
}
.login-form input {
    width: 100%;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f3f4f6;
    padding: 0 .85rem;
    margin-bottom: 0.85rem;
    font-size: 0.94rem;
    color: #111827;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-role-select {
    width: 100%;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f3f4f6;
    padding: 0 .85rem;
    margin-bottom: 0.85rem;
    font-size: 0.94rem;
    color: #111827;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-role-select:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
    outline: none;
}
.login-form input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
    outline: none;
}
.login-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 0.72rem 1.1rem;
    border-radius: 12px;
    border: none;
    background: #111827;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.22);
    margin-top: 0.35rem;
}
.login-help-text {
    margin-top: 110px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}
.login-alt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.15rem;
}
.login-alt-btn {
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: default;
    text-align: center;
}
.login-hint {
    margin-top: auto;
    font-size: 0.78rem;
    color: #9ca3af;
}
.login-right {
    position: relative;
    background: linear-gradient(148deg, #785cff, #5c4be6);
    overflow: hidden;
}
.login-right::before {
    content: "";
    position: absolute;
    left: -31%;
    top: -12%;
    width: 76%;
    height: 124%;
    border-radius: 50%;
    background: #fff;
    z-index: 2;
}
.login-right::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1' opacity='0.2' d='M0 200 Q300 80 600 200 T1200 200'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='0.9' opacity='0.15' d='M0 280 Q400 160 800 280 T1200 280'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='0.8' opacity='0.18' d='M0 120 Q250 240 600 120 T1200 120'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='0.7' opacity='0.12' d='M-50 380 Q350 260 700 380 T1250 380'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='0.6' opacity='0.1' d='M0 40 Q500 180 600 40 T1200 40'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    pointer-events: none;
}
.login-role-image {
    position: absolute;
    right: 3%;
    bottom: 2%;
    width: 88%;
    height: 92%;
    object-fit: contain;
    border-radius: 16px;
    z-index: 3;
}
.login-right-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(22, 163, 74, 0.52), rgba(22, 163, 74, 0.04));
    z-index: 4;
}
.login-right-text {
    position: absolute;
    left: 10%;
    bottom: 10%;
    width: 74%;
    font-size: 2.1rem;
    line-height: 1.1;
    font-weight: 700;
    font-family: 'Poppins', 'Inter', sans-serif;
    letter-spacing: -0.01em;
    color: #fff;
    z-index: 5;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.login-card .alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.85rem;
}
@media (max-width: 991.98px) {
    .login-card:not(.row) { grid-template-columns: 1fr; min-height: auto; }
    .login-card:not(.row) .login-right { display: none; }
    .login-left { padding: 2rem 1.2rem 1.4rem; }
    .login-brand-title { font-size: 2.2rem; }
    .login-title { font-size: 1.7rem; }
}
@media (max-width: 575.98px) {
    .login-form input.form-control, .login-form .login-submit-btn { width: 100% !important; }
}

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: var(--sidebar-green); color: #fff; }
.btn-primary:hover { background: var(--sidebar-green-light); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: rgba(220,38,38,0.1); border: 1px solid var(--red); color: var(--red); }
.alert-success { background: rgba(22,163,74,0.1); border: 1px solid var(--green); color: var(--green); }
.alert-info { background: rgba(37,99,235,0.1); border: 1px solid var(--blue); color: var(--blue); }
.alert-warning { background: rgba(234,88,12,0.1); border: 1px solid var(--orange); color: var(--orange); }

/* App layout — header always on top (z-index above sidebar), sidebar below header on mobile */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1050;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
/* Header: left (toggle, logo, title, subtitle) and right (Profile + Logout icons) */
.app-header .header-actions { margin-left: auto; flex-shrink: 0; }
.app-header .brand { display: flex; align-items: center; gap: 0.75rem; }
.app-header .brand-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--sidebar-green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; flex-shrink: 0; }
.app-header .brand-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0; }
.app-header .brand-avatar--school-logo { object-fit: contain; background: #fff; padding: 3px; }
.app-header .brand-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.app-header .brand-info .brand-text,
.app-header .brand-info h5.brand-text { margin: 0; font-weight: 600; font-size: 1.15rem; color: var(--text); line-height: 1.25; }
.app-header .brand-info .brand-school,
.app-header .brand-info small.brand-school { margin: 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }
.header-icon {
    font-size: 20px;
    color: #374151;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.header-icon:hover { color: var(--blue); background: rgba(0, 0, 0, 0.05); }
.header-icon .nav-icon { display: flex; }
.header-icon .nav-icon svg { width: 20px; height: 20px; }

/* Header user actions: desktop = full text, mobile = icons only */
.app-header .user-actions { display: flex; align-items: center; }
.app-header .desktop-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.app-header .desktop-actions .user-role { font-size: 0.9rem; color: var(--text-muted); }
.app-header .desktop-actions .status.text-success { font-size: 0.9rem; color: var(--green); }
.app-header .desktop-actions a { color: var(--blue); font-size: 0.9rem; text-decoration: none; }
.app-header .desktop-actions a:hover { text-decoration: underline; }
.app-header .mobile-actions {
    display: none;
    gap: 12px;
    align-items: center;
}
.app-header .icon-btn {
    font-size: 20px;
    color: #374151;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.app-header .icon-btn:hover { color: var(--blue); background: rgba(0, 0, 0, 0.05); }
.app-header .icon-btn .nav-icon { display: flex; }
.app-header .icon-btn .nav-icon svg { width: 20px; height: 20px; }
@media (max-width: 991.98px) {
    .app-header .desktop-actions { display: none !important; }
    .app-header .mobile-actions { display: flex !important; }
}

.app-header .user-area { display: flex; align-items: center; gap: 1rem; }
.app-header .avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.app-header .avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-green);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.app-header .role { font-size: 0.9rem; color: var(--text-muted); }
.app-header .status { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--green); }
.app-header .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.app-header .user-area a { color: var(--blue); font-size: 0.9rem; }

/* Mobile menu toggle — visible only below lg (Bootstrap d-lg-none) */
#menuToggle {
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    font-size: 1.4rem;
    line-height: 1;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    margin-right: 0.5rem;
}
#menuToggle:hover { background: var(--border); }
.sidebar-overlay {
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.layout { display: flex; min-height: 0; }
.layout .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    background: #343a40;
    color: #fff;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 0.75rem; }
.sidebar-brand-icon { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }
.sidebar-brand-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0; }
.sidebar-brand-avatar--school-logo { object-fit: contain; background: rgba(255,255,255,0.95); padding: 2px; }
.sidebar-brand-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.sidebar-brand-name { font-weight: 600; color: #fff; font-size: 0.95rem; }
.sidebar-brand-school { font-size: 0.75rem; color: rgba(255,255,255,0.75); }

/* Sidebar user: role, status, profile, logout — single row, visible only on mobile/tablet (d-lg-none) */
.sidebar-user {
    padding: 10px 15px;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user-role {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
}
.sidebar-user .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.sidebar-user-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-user-link .nav-icon { flex-shrink: 0; }
.sidebar-user-link:hover { background: #4b5a6b; color: #fff; }
.sidebar-user-link.active { background: #4b5a6b; color: #fff; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    margin: 0 0.5rem 0.35rem;
    border-radius: 12px;
    color: #bdc3c7;
    font-size: 0.9rem;
}
.sidebar nav .nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.sidebar nav .nav-icon svg {
    width: 100%;
    height: 100%;
}
.sidebar nav a:last-of-type { margin-bottom: 0; }
.sidebar nav a:hover { background: #4b5a6b; color: #fff; }
.sidebar nav a.active { background: #4b5a6b; color: #fff; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; }

/* Sidebar dropdown (e.g. My Class for Form Master) */
.sidebar-dropdown {
    margin: 0 0.5rem 0.35rem;
    border-radius: 12px;
    overflow: hidden;
}
.sidebar-dropdown-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    color: #bdc3c7;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.sidebar-dropdown-title:hover { background: #4b5a6b; color: #fff; }
.sidebar-dropdown-title .nav-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: inherit; }
.sidebar-dropdown-title .nav-icon svg { width: 100%; height: 100%; }
.sidebar-dropdown-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.sidebar-dropdown.expanded .sidebar-dropdown-chevron { transform: rotate(180deg); }
.sidebar-dropdown-menu {
    display: none;
    flex-direction: column;
    padding-left: 0.25rem;
    padding-bottom: 0.25rem;
}
.sidebar-dropdown.expanded .sidebar-dropdown-menu { display: flex; }
.sidebar-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    margin: 0 0.25rem 0.2rem;
    border-radius: 10px;
    color: #bdc3c7;
    font-size: 0.85rem;
    text-decoration: none;
}
.sidebar-dropdown-menu a:hover { background: #4b5a6b; color: #fff; }
.sidebar-dropdown-menu a.active { background: #4b5a6b; color: #fff; }
.sidebar-dropdown-menu .nav-icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.sidebar-dropdown-menu .nav-icon svg { width: 100%; height: 100%; }

.sidebar-profile { margin-top: auto; padding: 0.5rem 0.5rem 0; }
.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    margin: 0 0.5rem 0.35rem;
    border-radius: 12px;
    color: #bdc3c7;
    font-size: 0.9rem;
    text-decoration: none;
}
.sidebar-profile-link .nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.sidebar-profile-link .nav-icon svg { width: 100%; height: 100%; }
.sidebar-profile-link:hover { background: #4b5a6b; color: #fff; }
.sidebar-profile-link.active { background: #4b5a6b; color: #fff; font-weight: 500; }

.sidebar-parent-school-wrap {
    margin: 0 0.75rem 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}
.sidebar-parent-school-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
    padding: 0;
    background: none;
}
.sidebar-parent-school-form {
    margin: 0;
}
.sidebar-parent-school-form .sidebar-parent-school-select {
    width: 100%;
    font-size: 0.875rem;
    padding: 0.5rem 2rem 0.5rem 0.65rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.sidebar-parent-school-form .sidebar-parent-school-select:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
}
.sidebar-parent-school-form .sidebar-parent-school-select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}
.sidebar-parent-school-form .sidebar-parent-school-select option {
    background: #2c3e50;
    color: #fff;
}

/* Desktop (lg and above): fixed sidebar, main content with left margin */
@media (min-width: 992px) {
    .layout .sidebar { left: 0; }
    .main { margin-left: 250px; }
}

/* Mobile (below lg): sidebar hidden off-screen, overlay when open; main full width */
@media (max-width: 991.98px) {
    .app-header { height: auto; min-height: 60px; padding: 0.6rem 1rem; }
    .layout .sidebar {
        position: fixed;
        left: -260px;
        top: 60px;
        width: 260px;
        height: calc(100vh - 60px);
        transition: left 0.3s ease, box-shadow 0.3s ease;
        box-shadow: none;
        z-index: 1000;
    }
    .layout .sidebar.show {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    .main {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
        min-width: 0;
        height: calc(100vh - 60px);
    }
}

.main {
    margin-top: 60px;
    padding: 1.25rem;
    height: calc(100vh - 60px);
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
}
/* Main content area: full width and padding on mobile (layout-wrapper context) */
.main.main-content { width: 100%; min-width: 0; }

/* Small screens: full-width form controls inside main */
@media (max-width: 575.98px) {
    .main .form-control, .main select:not([multiple]), .main input[type="text"], .main input[type="email"], .main input[type="number"], .main input[type="password"], .main .btn { width: 100%; max-width: 100%; }
}

/* Table responsive wrapper — use .table-responsive when not already wrapped */
.main .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.main .table-responsive table { margin-bottom: 0; min-width: 100%; }

/* Student: My Exam Schedule — mobile-friendly scroll, empty state, row highlights */
.student-exam-schedule-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.student-exam-schedule-empty { margin: 0.5rem 0 0; }
.student-exam-schedule-row-today { background: rgba(37, 99, 235, 0.08) !important; }
.student-exam-schedule-row-upcoming { }
.student-exam-schedule-row-completed { opacity: 0.85; }
.student-exam-schedule-row-completed td { color: var(--text-muted, #6b7280); }
.student-exam-schedule-day-section { margin-bottom: 1.25rem; }
.student-exam-schedule-grid { min-width: 520px; }

/* Prevent column collapse: tables scroll horizontally instead of wrapping */
.table th, .table td { white-space: nowrap; }
.main .classes-list-table th, .main .classes-list-table td,
.main .subjects-list-table th, .main .subjects-list-table td,
.main .search-students-table th, .main .search-students-table td,
.main .students-mgmt-table th, .main .students-mgmt-table td,
.main .grades-report-table th, .main .grades-report-table td,
.main .parents-list-table th, .main .parents-list-table td,
.main .teacher-assignments-table th, .main .teacher-assignments-table td,
.main table.report-table th, .main table.report-table td,
.main .student-payments-table th, .main .student-payments-table td,
.main .parent-payments-table th, .main .parent-payments-table td,
.main .student-exam-schedule-table th, .main .student-exam-schedule-table td { white-space: nowrap; }

/* Table action buttons: keep Edit/Delete aligned horizontally on all screen sizes */
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
}
.actions-cell {
    white-space: nowrap;
}
.actions-cell .table-actions { flex-shrink: 0; }
@media (max-width: 768px) {
    .table-actions .btn,
    .table-actions .btn-action { padding: 4px 10px; font-size: 12px; }
}

/* Header responsiveness: wrap and compact on small screens */
@media (max-width: 767.98px) {
    .app-header { padding: 0.5rem 0.75rem; gap: 0.5rem; }
    .app-header .brand-text { font-size: 1rem; }
    .app-header .brand-school { font-size: 0.75rem; }
    .app-header .user-area { flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
    .app-header .user-area .role, .app-header .user-area .status { font-size: 0.8rem; }
    .app-header .user-area a { font-size: 0.85rem; }
}

/* Profile page */
.profile-card { max-width: 560px; }
.profile-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.profile-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.profile-section-title { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; color: var(--text); }
.profile-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1.5rem; }
.profile-dl dt { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.profile-dl dd { margin: 0; font-size: 0.95rem; }
.profile-logo-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-logo-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.profile-form .form-group { margin-bottom: 1rem; }
.profile-form .form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; }
.profile-form .form-group input { width: 100%; max-width: 320px; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; }

/* Dashboard */
.dashboard-title { margin: 0 0 1rem; font-size: 1.5rem; color: var(--text); }
.attendance-page-title { background: var(--green); color: #fff; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.card--attendance { padding: 0; overflow: hidden; }
.card--attendance .attendance-card-header { background: var(--green); color: #fff; padding: 0.75rem 1.25rem; font-size: 1.15rem; font-weight: 700; }
.card--attendance .attendance-card-body { padding: 1.25rem; }
.attendance-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; margin-bottom: 1rem; max-width: 640px; }
.attendance-view-grid.row { display: flex; flex-wrap: wrap; grid-template-columns: unset; max-width: none; margin-bottom: 1rem; }
.attendance-view-grid .register-student-form-group label { display: block; font-size: 0.9rem; font-weight: 500; color: var(--text); margin-bottom: 0.35rem; }
.attendance-view-grid .register-student-form-group select,
.attendance-view-grid .register-student-form-group input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--card-bg); }
.attendance-export-hint { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--text-muted); }
.attendance-export-toolbar { margin-top: 0.25rem; margin-bottom: 0; }

/* Attendance Records page */
.card--attendance-records { padding: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.attendance-records-header { background: var(--green); color: #fff; padding: 1.25rem 1.5rem; }
.attendance-records-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: #fff; }
.attendance-records-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.95; color: rgba(255,255,255,0.95); }
.attendance-records-school-form { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; }
.attendance-records-school-form .form-label { margin: 0; font-size: 0.9rem; font-weight: 500; }
.attendance-records-school-form .form-select { width: auto; min-width: 200px; }
.attendance-records-filters-card { padding: 1.25rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border); }
.attendance-records-filters { margin: 0; }
.attendance-records-filters-grid {
    display: grid;
    /* One row on desktop: Date From, Date To, Class, Subject, Teacher, Academic Year, Apply */
    grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
    gap: 1rem 1.25rem;
    align-items: end;
    max-width: 100%;
}
.attendance-records-field .form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.02em; }
.attendance-records-field .form-control,
.attendance-records-field .form-select { min-height: 38px; border-radius: 6px; border: 1px solid var(--border); }
.attendance-records-field--submit { display: flex; align-items: flex-end; }
.attendance-records-filter-btn { min-height: 38px; padding: 0.4rem 1rem; font-weight: 600; border-radius: 6px; }
.attendance-records-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.attendance-records-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 0.9rem; }
.attendance-records-table thead tr { background: var(--green); color: #fff; }
.attendance-records-table thead th { padding: 0.75rem 1rem; text-align: left; font-weight: 600; font-size: 0.85rem; border: none; white-space: nowrap; }
.attendance-records-table thead th.text-end { text-align: right; }
.attendance-records-table tbody tr { transition: background 0.15s; }
.attendance-records-table tbody tr:nth-child(even) { background: #f8fafc; }
.attendance-records-table tbody tr:nth-child(odd) { background: #fff; }
.attendance-records-table tbody tr:hover { background: #f0fdf4; }
.attendance-records-table tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.attendance-records-view-link { display: inline-block; padding: 0.35rem 0.75rem; background: var(--green); color: #fff !important; border-radius: 6px; font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: background 0.15s, transform 0.1s; }
.attendance-records-view-link:hover { background: var(--sidebar-green-light); color: #fff !important; }
.attendance-records-empty { text-align: center; padding: 2.5rem 1rem !important; color: var(--text-muted); font-size: 0.95rem; }

/* Student payments */
.card--student-payments { padding: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.student-payments-header { background: var(--green); color: #fff; padding: 1.25rem 1.5rem; }
.student-payments-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: #fff; }
.student-payments-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.95; color: rgba(255,255,255,0.95); }
.student-payments-filters-card { padding: 1.25rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border); }
.student-payments-filters { margin: 0; }
.student-payments-filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem 1.25rem; align-items: end; max-width: 980px; }
.student-payments-field .form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.02em; }
.student-payments-field .form-control,
.student-payments-field .form-select { min-height: 38px; border-radius: 6px; border: 1px solid var(--border); }
.student-payments-field--submit { display: flex; align-items: flex-end; }
.student-payments-body { padding: 1.25rem 1.5rem; }
.student-payments-section { margin-bottom: 1.25rem; }
.student-payments-section:last-child { margin-bottom: 0; }
.student-payments-section-head { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.6rem; }
.student-payments-section-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.student-payments-section-title .student-payments-section-sub { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }
.student-payments-table td { font-variant-numeric: tabular-nums; }

/* Student results / grades */
.card--student-results { padding: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.student-results-header { background: var(--green); color: #fff; padding: 1.25rem 1.5rem; }
.student-results-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: #fff; }
.student-results-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.95; color: rgba(255,255,255,0.95); }
.student-results-alert { padding: 0 1.5rem; padding-top: 1rem; }
.student-results-filters-card { padding: 1.25rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border); }
.student-results-filters { margin: 0; }
.student-results-filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem 1.25rem; align-items: end; max-width: 100%; }
.student-results-field .form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.02em; }
.student-results-field .form-select.student-results-select { min-height: 38px; border-radius: 6px; border: 1px solid var(--border); }
.student-results-field--submit { display: flex; align-items: flex-end; gap: 0.5rem; }
.student-results-btn-apply { border-radius: 6px; font-weight: 600; }
.student-results-btn-clear { border-radius: 6px; }
.student-results-body { padding: 1.25rem 1.5rem; }
.student-results-empty { margin: 0; }
.student-results-exam-heading { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.student-results-summary { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; padding: 0.75rem 0; font-size: 0.95rem; }
.student-results-summary span { color: var(--text); }

@media (max-width: 768px) {
    .student-results-filters-grid { grid-template-columns: 1fr 1fr; }
    .student-results-field--submit { grid-column: span 2; }
}

/* Student exam schedule */
.card--student-exam-schedule { padding: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.student-exam-schedule-header { background: var(--green); color: #fff; padding: 1.25rem 1.5rem; }
.student-exam-schedule-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: #fff; }
.student-exam-schedule-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.95; color: rgba(255,255,255,0.95); }
.student-exam-schedule-filters-card { padding: 1.25rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border); }
.student-exam-schedule-filters { margin: 0; max-width: 360px; }
.student-exam-schedule-filter-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem; letter-spacing: 0.02em; }
.student-exam-schedule-filter-select {
    display: block; width: 100%; min-height: 44px; padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 0.9375rem; font-weight: 500; color: var(--text); background: #fff;
    border: 1px solid #d1d5db; border-radius: 8px;
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.student-exam-schedule-filter-select:hover { border-color: #9ca3af; }
.student-exam-schedule-filter-select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.student-exam-schedule-body { padding: 1.25rem 1.5rem; }
.student-exam-schedule-table-wrap { margin: 0; }

/* Attendance view (single session) */
.card--attendance-view { padding: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.attendance-view-header { background: var(--green); color: #fff; padding: 1.25rem 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.attendance-view-title { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 700; color: #fff; }
.attendance-view-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.95; color: rgba(255,255,255,0.95); }
.attendance-view-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.attendance-view-export { background: rgba(255,255,255,0.2); color: #fff !important; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px; padding: 0.4rem 0.75rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.attendance-view-export:hover { background: rgba(255,255,255,0.35); color: #fff !important; border-color: rgba(255,255,255,0.5); }
.attendance-view-back { background: rgba(255,255,255,0.2); color: #fff !important; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px; padding: 0.4rem 0.75rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.attendance-view-back:hover { background: rgba(255,255,255,0.3); color: #fff !important; border-color: rgba(255,255,255,0.5); }
.attendance-view-table-wrap { padding: 1rem 1.5rem; overflow-x: auto; }
.attendance-view-table { min-width: 320px; }

@media (max-width: 768px) {
    .attendance-records-filters-grid { grid-template-columns: 1fr 1fr; }
    .attendance-records-field--submit { grid-column: span 2; }
    .student-payments-filters-grid { grid-template-columns: 1fr 1fr; }
    .student-payments-field--submit { grid-column: span 2; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.kpi-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; }
.kpi-icon.green { background: rgba(22,163,74,0.15); color: var(--green); }
.kpi-icon.blue { background: rgba(37,99,235,0.15); color: var(--blue); }
.kpi-icon.orange { background: rgba(234,88,12,0.15); color: var(--orange); }
.kpi-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); }

/* Admin dashboard (reference layout) */
.admin-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .admin-kpi-grid { grid-template-columns: 1fr; } }
.admin-kpi-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; flex-direction: column; align-items: flex-start; }
.admin-kpi-icon-wrap { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; }
.admin-kpi-icon { width: 24px; height: 24px; background: #fff; mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.admin-kpi-icon-grad { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2zm0 2.5l5 2.5v2.5l-5 2.5-5-2.5V7l5-2.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-teacher { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 20c0-4 3.5-6 8-6s8 2 8 6v1H4v-1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 20c0-4 3.5-6 8-6s8 2 8 6v1H4v-1z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-class { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-users { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-dollar { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2v2.5a4 4 0 0 0-3 3.87V12h-2v2h2v6h2v-6h2v-2h-2V8.37A4 4 0 0 0 12 4.5V2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2v2.5a4 4 0 0 0-3 3.87V12h-2v2h2v6h2v-6h2v-2h-2V8.37A4 4 0 0 0 12 4.5V2z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-warning { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 3.5L19.5 19h-15L12 5.5zM11 10v4h2v-4h-2zm0 6v2h2v-2h-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 3.5L19.5 19h-15L12 5.5z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-clipboard { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='m9 14 2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='m9 14 2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-clock { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 2' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 2' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-check { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-icon-doc { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm0 2l5 5h-5V4zM8 12h8v2H8v-2zm0 4h8v2H8v-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm0 2l5 5h-5V4zM8 12h8v2H8v-2zm0 4h8v2H8v-2z'/%3E%3C/svg%3E"); background: #fff; }
.admin-kpi-blue .admin-kpi-icon-wrap { background: #2563eb; }
.admin-kpi-green .admin-kpi-icon-wrap { background: var(--green); }
.admin-kpi-yellow .admin-kpi-icon-wrap { background: #eab308; }
.admin-kpi-cyan .admin-kpi-icon-wrap { background: #06b6d4; }
.admin-kpi-grey .admin-kpi-icon-wrap { background: #6b7280; }
.admin-kpi-red .admin-kpi-icon-wrap { background: #dc2626; }
.admin-kpi-warning .admin-kpi-icon-wrap { background: #eab308; }
.admin-kpi-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.admin-kpi-label { font-size: 0.8rem; color: var(--text-muted); }

.admin-dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.admin-dashboard-row > * { min-width: 0; }
@media (max-width: 768px) { .admin-dashboard-row { grid-template-columns: 1fr; } }
.admin-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 0; }
.admin-card-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.admin-card-title-icon { font-size: 1.1rem; opacity: 0.8; }
.admin-chart-wrap { width: 100%; max-width: 100%; min-height: 200px; height: 220px; position: relative; }
.admin-chart-wrap canvas { max-width: 100% !important; }
@media (max-width: 768px) {
    .admin-chart-wrap { height: 240px; min-height: 200px; }
}
.admin-actions-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-action-btn { display: block; padding: 0.6rem 1rem; border-radius: 6px; text-align: center; font-weight: 500; text-decoration: none; color: #fff; border: none; font-size: 0.95rem; width: 100%; max-width: 100%; box-sizing: border-box; }
.admin-action-blue { background: #2563eb; }
.admin-action-green { background: var(--green); }
.admin-action-orange { background: #ea580c; }
.admin-action-cyan { background: #06b6d4; }
.admin-action-grey { background: #6b7280; }
.admin-action-btn:hover { opacity: 0.92; color: #fff; }

/* Student dashboard — same design as reference (welcome, 4 KPI cards, recent grades/attendance, quick actions). Fit to page. */
.student-dashboard-wrap { width: 100%; max-width: 100%; min-width: 0; padding: 1rem 0; box-sizing: border-box; }
.student-dashboard-header { margin-bottom: 1.5rem; }
.student-dashboard-welcome { margin: 0 0 0.25rem; font-size: 1.75rem; font-weight: 700; color: var(--text); }
.student-dashboard-subtitle { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.student-dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .student-dashboard-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .student-dashboard-kpi-grid { grid-template-columns: 1fr; } }
.student-dashboard-kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; flex-direction: column; align-items: flex-start; }
.student-dashboard-kpi-icon-wrap { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; }
.student-dashboard-kpi-icon { width: 24px; height: 24px; background: #fff; mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.student-dashboard-kpi-icon-id { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3Cpath d='M8 16c0-2 2-3 4-3s4 1 4 3v1H8v-1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3Cpath d='M8 16c0-2 2-3 4-3s4 1 4 3v1H8v-1z'/%3E%3C/svg%3E"); background: #fff; }
.student-dashboard-kpi-icon-class { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); background: #fff; }
.student-dashboard-kpi-icon-calendar { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18M7 2v4M17 2v4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18M7 2v4M17 2v4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background: #fff; }
.student-dashboard-kpi-icon-cap { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L2 9v2h2l2 10h12l2-10h2V9L12 3zm0 2.5l6 3.5v1.5H6V8.5l6-3.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L2 9v2h2l2 10h12l2-10h2V9L12 3z'/%3E%3C/svg%3E"); background: #fff; }
.student-dashboard-kpi-blue .student-dashboard-kpi-icon-wrap { background: #2563eb; }
.student-dashboard-kpi-green .student-dashboard-kpi-icon-wrap { background: var(--green); }
.student-dashboard-kpi-yellow .student-dashboard-kpi-icon-wrap { background: #eab308; }
.student-dashboard-kpi-teal .student-dashboard-kpi-icon-wrap { background: #06b6d4; }
.student-dashboard-kpi-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.student-dashboard-kpi-label { display: block; font-size: 0.8rem; color: var(--text-muted); }
.student-dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .student-dashboard-row { grid-template-columns: 1fr; } }
.student-dashboard-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.student-dashboard-card-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
.student-dashboard-card-title-icon { width: 20px; height: 20px; flex-shrink: 0; background: var(--text-muted); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.student-dashboard-icon-chart { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 17v2h2v-2H3zm4 0v2h2v-2H7zm4-4v6h2v-6h-2zm4 2v4h2v-4h-2zm4-6v10h2V9h-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 17v2h2v-2H3zm4 0v2h2v-2H7zm4-4v6h2v-6h-2zm4 2v4h2v-4h-2zm4-6v10h2V9h-2z'/%3E%3C/svg%3E"); background: var(--text-muted); }
.student-dashboard-icon-attendance { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M9 12l2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3Cpath d='M7 2v4M17 2v4M3 10h18' stroke='currentColor' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' fill='currentColor'/%3E%3Cpath d='M9 12l2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background: var(--text-muted); }
.student-dashboard-icon-list { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E"); background: var(--text-muted); }
.student-dashboard-card-body { min-height: 120px; }
.student-dashboard-empty { margin: 0; color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 1.5rem 0; }
.student-dashboard-list { margin: 0; padding-left: 1.25rem; list-style: disc; }
.student-dashboard-list li { margin-bottom: 0.35rem; }
.student-dashboard-actions-card { margin-bottom: 0; }
.student-dashboard-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.student-dashboard-action-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: 8px; font-weight: 500; text-decoration: none; color: #fff; font-size: 0.95rem; }
.student-dashboard-action-btn:hover { opacity: 0.92; color: #fff; }
.student-dashboard-action-icon { width: 20px; height: 20px; flex-shrink: 0; background: #fff; mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.student-dashboard-action-blue { background: #2563eb; }
.student-dashboard-action-blue .student-dashboard-action-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 17v2h2v-2H3zm4 0v2h2v-2H7zm4-4v6h2v-6h-2zm4 2v4h2v-4h-2zm4-6v10h2V9h-2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 17v2h2v-2H3zm4 0v2h2v-2H7zm4-4v6h2v-6h-2zm4 2v4h2v-4h-2zm4-6v10h2V9h-2z'/%3E%3C/svg%3E"); }
.student-dashboard-action-green { background: var(--green); }
.student-dashboard-action-green .student-dashboard-action-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M9 12l2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3Cpath d='M7 2v4M17 2v4M3 10h18' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M9 12l2 2 4-4' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }
.student-dashboard-action-teal { background: #06b6d4; }
.student-dashboard-action-teal .student-dashboard-action-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 2' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 2' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); }
.student-dashboard-action-yellow { background: #eab308; }
.student-dashboard-action-yellow .student-dashboard-action-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); }
.student-dashboard-action-purple { background: #7c3aed; }
.student-dashboard-action-purple .student-dashboard-action-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2v2.5a4 4 0 0 0-3 3.87V12h-2v2h2v6h2v-6h2v-2h-2V8.37A4 4 0 0 0 12 4.5V2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2v2.5a4 4 0 0 0-3 3.87V12h-2v2h2v6h2v-6h2v-2h-2V8.37A4 4 0 0 0 12 4.5V2z'/%3E%3C/svg%3E"); }

/* Parent dashboard — child selector + child overview (reuses student-dashboard-* for cards/actions) */
.parent-dashboard-wrap { width: 100%; max-width: 100%; min-width: 0; padding: 1rem 0; box-sizing: border-box; }
.parent-dashboard-main-title { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.parent-dashboard-selector-card { margin-bottom: 1.5rem; }
.parent-dashboard-instruction { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.95rem; }
.parent-dashboard-select-form .form-group { margin-bottom: 0; }
.parent-dashboard-select { min-width: 280px; max-width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.parent-dashboard-child-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-top: 0; }
.parent-dashboard-child-header { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.parent-dashboard-viewing { margin: 0 0 0.25rem; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.parent-dashboard-viewing-sub { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.parent-dashboard-child-section .student-dashboard-kpi-grid { margin-bottom: 1.5rem; }
.parent-dashboard-child-section .student-dashboard-row { margin-bottom: 1.5rem; }
.parent-dashboard-child-section .student-dashboard-actions-card { margin-bottom: 0; }

/* Student profile — banner + 4 cards */
.student-profile-wrap { padding: 0 0 1.5rem; max-width: 100%; }
.student-profile-banner { background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%); color: #fff; padding: 1.5rem 1.25rem; border-radius: 12px; margin-bottom: 1.5rem; box-shadow: 0 4px 12px rgba(124,58,237,0.25); }
.student-profile-banner-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.student-profile-banner-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; }
.student-profile-avatar-icon { width: 32px; height: 32px; background: #fff; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.student-profile-banner-text { flex: 1; min-width: 0; }
.student-profile-name { margin: 0 0 0.2rem; font-size: 1.6rem; font-weight: 700; color: #fff; }
.student-profile-subtitle { margin: 0; font-size: 0.95rem; opacity: 0.95; }
.student-profile-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.student-profile-status-badge { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 8px; background: rgba(255,255,255,0.25); font-weight: 600; font-size: 0.9rem; }
.student-profile-back-btn { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 8px; background: #fff; color: #7c3aed; font-weight: 500; text-decoration: none; font-size: 0.9rem; }
.student-profile-back-btn:hover { opacity: 0.95; color: #7c3aed; }
.student-profile-cards { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; width: 100%; max-width: 100%; }
.student-profile-card-full { width: 100%; }
.student-profile-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; }
@media (max-width: 768px) { .student-profile-cards-row { grid-template-columns: 1fr; } }
.student-profile-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.student-profile-card-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.student-profile-card-icon { width: 22px; height: 22px; flex-shrink: 0; background: var(--text-muted); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.student-profile-icon-person { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); }
.student-profile-icon-envelope { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); }
.student-profile-icon-doc { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z'/%3E%3C/svg%3E"); }
.student-profile-icon-people { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3z'/%3E%3C/svg%3E"); }
.student-profile-dl { margin: 0; }
.student-profile-dl dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-top: 0.75rem; margin-bottom: 0.2rem; }
.student-profile-dl dt:first-child { margin-top: 0; }
.student-profile-dl dd { margin: 0; font-size: 0.95rem; color: var(--text); }
.student-profile-footer { margin-top: 1rem; font-size: 0.9rem; }
.student-profile-footer a { color: var(--blue); }

.admin-roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
@media (max-width: 576px) { .admin-roles-grid { grid-template-columns: repeat(2, 1fr); } }
.admin-role-mini { background: var(--main-bg); border-radius: 8px; padding: 0.75rem; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 0; }
.admin-role-mini-icon { width: 32px; height: 32px; border-radius: 50%; background: #6b7280; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 600; }
.admin-role-mini-label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.admin-role-mini-count { font-size: 0.8rem; color: var(--text-muted); }
.admin-role-cyan .admin-role-mini-icon { background: #06b6d4; }
.admin-role-blue .admin-role-mini-icon { background: #2563eb; }
.admin-role-purple .admin-role-mini-icon { background: #7c3aed; }
.admin-role-orange .admin-role-mini-icon { background: #ea580c; }
.admin-role-grey .admin-role-mini-icon { background: #6b7280; }
.admin-current-user { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.admin-current-user-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.admin-current-user-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.admin-current-user-details { display: flex; flex-direction: column; gap: 0.2rem; }
.admin-current-user-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.admin-current-user-role { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; background: rgba(37,99,235,0.15); color: var(--blue); width: fit-content; }
.admin-current-user-login { font-size: 0.85rem; color: var(--text-muted); }
.admin-current-user-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-user-btn { display: flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.6rem 1rem; border-radius: 6px; font-weight: 500; text-decoration: none; font-size: 0.95rem; }
.admin-user-btn-blue { background: #2563eb; color: #fff; }
.admin-user-btn-grey { background: #6b7280; color: #fff; }
.admin-user-btn:hover { color: #fff; opacity: 0.92; }
.admin-action-icon-grad::before { content: '🎓'; margin-right: 0.35rem; }
.admin-action-icon-users::before, .admin-action-icon-edit::before { content: ''; display: inline-block; width: 1em; height: 1em; }

/* Teacher dashboard */
.teacher-dash-wrap { max-width: 100%; box-sizing: border-box; }
.teacher-dash-header { margin-bottom: 1.25rem; }
.teacher-dash-welcome { margin: 0 0 0.25rem; font-size: 1.4rem; font-weight: 700; color: var(--text); }
.teacher-dash-subtitle { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.teacher-dash-kpis { margin-bottom: 1.25rem; }
.teacher-dash-kpis-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .teacher-dash-kpis-3 { grid-template-columns: 1fr; } }
.teacher-dash-next-class-empty { display: block; height: 2px; width: 3rem; background: var(--border); margin: 0.5rem 0; border-radius: 1px; }
.teacher-dash-attendance-chart-wrap { min-height: 200px; position: relative; }
.teacher-dash-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }
.teacher-dash-legend-item { display: flex; align-items: center; gap: 0.35rem; }
.teacher-dash-legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.teacher-dash-legend-dot.present { background: #22c55e; }
.teacher-dash-legend-dot.absent { background: #ef4444; }
.teacher-dash-legend-dot.late { background: #eab308; }
.teacher-dash-badge { display: inline-block; margin-left: 0.5rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500; background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.teacher-dash-empty { text-align: center; padding: 1.5rem 1rem; color: var(--text-muted); }
.teacher-dash-activity-empty { padding: 1rem; }
.teacher-dash-empty-icon { width: 48px; height: 48px; margin: 0 auto 0.75rem; border-radius: 50%; background: var(--main-bg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.teacher-dash-empty-title { margin: 0 0 0.25rem; font-weight: 600; font-size: 1rem; color: var(--text); }
.teacher-dash-empty-text { margin: 0; font-size: 0.9rem; }
.teacher-dash-subjects-list { margin: 0; padding-left: 1.25rem; list-style: disc; column-count: 2; column-gap: 1.5rem; }
.teacher-dash-subjects-list li { margin-bottom: 0.35rem; break-inside: avoid; }
.teacher-dash-activity-icon { display: inline-block; width: 1.1em; height: 1.1em; font-size: 1.1rem; line-height: 1; vertical-align: -0.15em; }
.teacher-dash-activity-icon::before { content: '📄'; }
.teacher-dash-activity-item { padding: 0.75rem 0; }
.teacher-dash-activity-desc { margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--text); font-weight: 500; }
.teacher-dash-activity-date { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* Next Class (Upcoming Lesson) card */
.teacher-dash-next-class-card { text-decoration: none; color: inherit; transition: box-shadow 0.2s, border-color 0.2s; }
.teacher-dash-next-class-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #06b6d4; }
.teacher-dash-next-class-card .admin-kpi-label { margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.teacher-dash-next-class-detail { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
.teacher-dash-next-class-subject { font-weight: 700; font-size: 1rem; color: var(--text); }
.teacher-dash-next-class-class { color: var(--text); }
.teacher-dash-next-class-time { color: var(--text-muted); font-size: 0.85rem; }
.teacher-dash-next-class-countdown { margin-top: 0.25rem; font-size: 0.8rem; font-weight: 600; color: #059669; }
.teacher-dash-next-class-none { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }
.teacher-dash-next-class-soon { border-color: #eab308; background: #fffbeb; box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25); }

.admin-card.admin-chart-card .admin-chart-wrap { min-height: 200px; }
.teacher-dash-wrap .teacher-dash-chart-wrap { min-height: 220px; background: #f8fafc; border-radius: 8px; padding: 1rem; }

/* My Assigned Classes (teacher) */
.teacher-classes-wrap { max-width: 100%; padding-bottom: 1rem; }
.teacher-classes-header { margin-bottom: 1.75rem; }
.teacher-classes-title { margin: 0 0 0.35rem; font-size: 1.6rem; font-weight: 700; color: #1f2937; display: flex; align-items: center; gap: 0.6rem; }
.teacher-classes-title::before { content: ''; display: inline-block; width: 32px; height: 32px; background: #6366f1; border-radius: 8px; flex-shrink: 0; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.teacher-classes-subtitle { margin: 0; font-size: 0.9rem; color: #6b7280; }
.teacher-classes-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 600px) { .teacher-classes-summary { grid-template-columns: 1fr; } }
.teacher-classes-summary-card { border-radius: 14px; padding: 1.5rem 1.75rem; box-shadow: 0 4px 14px rgba(91, 33, 182, 0.2); color: #fff; }
.teacher-classes-summary-purple,
.teacher-classes-summary-blue { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #a78bfa 100%); }
.teacher-classes-summary-value { display: block; font-size: 2.5rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.teacher-classes-summary-label { font-size: 0.9rem; opacity: 0.95; }
.teacher-classes-list { display: flex; flex-direction: column; gap: 1.25rem; }
.teacher-class-card { display: flex; align-items: center; gap: 1.25rem; background: #fff; border: none; border-radius: 14px; padding: 1.25rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.teacher-class-card-icon { width: 48px; height: 48px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.teacher-class-card-svg { width: 24px; height: 24px; background: #6366f1; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.teacher-class-card-body { flex: 1; min-width: 0; }
.teacher-class-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.35rem; }
.teacher-class-card-name { font-weight: 700; font-size: 1.15rem; color: #1f2937; }
.teacher-class-card-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #3b82f6; color: #fff; }
.teacher-class-card-badge::before { content: ''; display: inline-block; width: 0.9em; height: 0.9em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4H6z'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.teacher-class-card-meta { margin: 0; font-size: 0.875rem; color: #6b7280; }
.teacher-class-card-action { flex-shrink: 0; }
.teacher-class-card-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1.1rem; border-radius: 10px; background: #2563eb; color: #fff; font-size: 0.9rem; font-weight: 600; text-decoration: none; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3); }
.teacher-class-card-btn:hover { background: #1d4ed8; color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4); }
.teacher-class-card-btn::before { content: ''; display: inline-block; width: 1.1em; height: 1.1em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }

/* ========== Teacher Dashboard — Responsive (Mobile / Tablet) ========== */
.teacher-classes-wrap,
.teacher-dash-wrap {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
.teacher-classes-wrap .table-responsive,
.teacher-dash-wrap .table-responsive,
.teacher-classes-wrap table,
.teacher-dash-wrap table {
    max-width: 100%;
}
@media (max-width: 767.98px) {
    .teacher-classes-wrap,
    .teacher-dash-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }
    .teacher-classes-header,
    .teacher-dash-header { margin-bottom: 24px; }
    .teacher-classes-list { margin-bottom: 24px; gap: 16px; }
    /* Statistics cards: full width, larger stat number */
    .teacher-classes-summary { display: block; width: 100%; margin-bottom: 24px; }
    .teacher-classes-summary-card {
        width: 100%;
        margin-bottom: 16px;
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }
    .teacher-classes-summary-card:last-child { margin-bottom: 0; }
    .teacher-classes-summary-value {
        font-size: 32px;
        font-weight: bold;
    }
    /* Class / Subject cards: vertical stack, full-width buttons */
    .teacher-class-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 18px;
        margin-bottom: 16px;
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        width: 100%;
        box-sizing: border-box;
    }
    .teacher-class-card-icon { flex-shrink: 0; }
    .teacher-class-card-body { min-width: 0; }
    .teacher-class-card-top {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .teacher-class-card-action {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        flex-shrink: 0;
    }
    .teacher-class-card-btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
    /* Teacher dashboard KPI grid: full width cards, stat number */
    .admin-kpi-grid.teacher-dash-kpis { gap: 12px; margin-bottom: 24px; }
    .admin-kpi-grid .admin-kpi-card {
        width: 100%;
        min-width: 0;
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }
    .admin-kpi-value { font-size: 32px; font-weight: bold; }
    .admin-dashboard-row { margin-bottom: 24px; }
    .admin-card {
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        min-width: 0;
    }
}
@media (min-width: 768px) {
    .teacher-class-card { border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
    .teacher-classes-summary-card { border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
}

/* Exam — Classes: card grid (same as reference: icon, name, Students, Capacity, status, View Details + Exams) */
.exam-classes-wrap { max-width: 100%; }
.exam-classes-header { margin-bottom: 1.5rem; }
.exam-classes-title { margin: 0 0 0.35rem; font-size: 1.75rem; font-weight: 700; color: #1f2937; }
.exam-classes-subtitle { margin: 0; font-size: 0.9rem; color: #6b7280; }
.exam-classes-school-filter { margin-bottom: 1.25rem; }
.exam-classes-school-filter label { margin-right: 0.5rem; font-size: 0.9rem; color: #374151; }
.exam-classes-school-filter select { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }
.exam-classes-empty { padding: 2rem; text-align: center; background: #f8fafc; border-radius: 12px; }
.exam-classes-empty p { margin-bottom: 1rem; }
.exam-class-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .exam-class-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .exam-class-cards { grid-template-columns: 1fr; } }
.exam-class-card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.06); }
.exam-class-card-icon { width: 52px; height: 52px; border-radius: 50%; background: #2563eb; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 1rem; }
.exam-class-card-svg { width: 28px; height: 28px; background: #fff; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6zm9 11h3v-2h-3v2zm-6 0h3v-2H7v2z'/%3E%3Ccircle cx='12' cy='8' r='2.5'/%3E%3Cpath d='M12 12c-2.5 0-4.5 1.5-5.5 3.5l1.5 1.5c.7-1.2 2-2 3.5-2s2.8.8 3.5 2l1.5-1.5c-1-2-3-3.5-5.5-3.5z'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6zm9 11h3v-2h-3v2zm-6 0h3v-2H7v2z'/%3E%3Ccircle cx='12' cy='8' r='2.5'/%3E%3Cpath d='M12 12c-2.5 0-4.5 1.5-5.5 3.5l1.5 1.5c.7-1.2 2-2 3.5-2s2.8.8 3.5 2l1.5-1.5c-1-2-3-3.5-5.5-3.5z'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.exam-class-card-body { flex: 1; min-width: 0; }
.exam-class-card-name { margin: 0 0 0.75rem; font-size: 1.15rem; font-weight: 700; color: #1f2937; }
.exam-class-card-stats { margin: 0 0 0.5rem; font-size: 0.9rem; color: #374151; }
.exam-class-card-stats p { margin: 0.2rem 0; }
.exam-class-card-status { margin: 0 0 1.25rem; font-size: 0.85rem; color: #6b7280; }
.exam-class-card-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.exam-class-card-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 10px; font-size: 0.9rem; font-weight: 600; text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.exam-class-card-btn-outline { background: transparent; color: #2563eb; border: 2px solid #2563eb; }
.exam-class-card-btn-outline:hover { background: #eff6ff; color: #1d4ed8; border-color: #1d4ed8; }
.exam-class-card-btn-icon { width: 1.1em; height: 1.1em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.exam-class-card-btn-exams { background: #16a34a; color: #fff; border: 2px solid #16a34a; }
.exam-class-card-btn-exams:hover { background: #15803d; color: #fff; border-color: #15803d; }
.exam-class-card-btn-exams::before { content: ''; display: inline-block; width: 1.1em; height: 1.1em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }

/* Exam Schedules page — class cards first, then filtered table */
.schedules-page-wrap { max-width: 100%; }
.schedules-page-title { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.schedules-intro { font-size: 0.95rem; }
.schedules-class-cards .exam-class-card { display: flex; flex-direction: column; }
.schedules-class-card .exam-class-card-actions { margin-top: auto; }
.schedules-card-badges .badge { font-size: 0.8rem; font-weight: 600; }
.schedules-empty-class { margin-bottom: 0; }

/* Teacher Exam Schedules — cards use Bootstrap row/col (3/2/1); table scrolls on mobile */
.teacher-exam-schedules-cards .exam-class-card { display: flex; flex-direction: column; }
.teacher-exam-schedules-cards .exam-class-card-actions { margin-top: auto; }
.teacher-exam-schedule-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.main .teacher-exam-schedule-table th,
.main .teacher-exam-schedule-table td { white-space: nowrap; }
.report-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Teacher Report (Overview) - tabs, title, metric cards */
.teacher-report-wrap { max-width: 100%; padding-bottom: 1.5rem; background: #f8fafc; margin: 0 -1rem; padding: 1.5rem 1rem 2rem; border-radius: 0 0 12px 12px; }
.teacher-report-tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.teacher-report-tab { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1.1rem; border-radius: 8px; border: none; background: transparent; color: #374151; text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.teacher-report-tab:hover { background: #f1f5f9; color: #1f2937; }
.teacher-report-tab.active { background: #2563eb; color: #fff; }
.teacher-report-tab.active:hover { background: #1d4ed8; color: #fff; }
.teacher-report-tab-icon { font-size: 1rem; opacity: 0.9; }
.teacher-report-title-section { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.teacher-report-title-icon { width: 24px; height: 24px; flex-shrink: 0; background: #374151; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.teacher-report-title { margin: 0; font-size: 1.35rem; font-weight: 700; color: #1f2937; }
.teacher-report-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .teacher-report-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .teacher-report-cards { grid-template-columns: 1fr; } }
.teacher-report-metric-card { display: flex; align-items: center; gap: 1.25rem; background: #fff; border-radius: 14px; padding: 1.35rem 1.5rem; border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.teacher-report-metric-icon { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: currentColor; }
.teacher-report-metric-icon::after { content: ''; display: block; width: 26px; height: 26px; background: #fff; mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.teacher-report-icon-blue { color: #2563eb; }
.teacher-report-icon-blue::after { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3Cpath d='M12 7v10m0 0l-7-3.5V10m7 7l7-3.5V10'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 3l9 4v6l-9 4-9-4V7l9-4z'/%3E%3Cpath d='M12 7v10m0 0l-7-3.5V10m7 7l7-3.5V10'/%3E%3C/svg%3E"); }
.teacher-report-icon-green { color: #16a34a; }
.teacher-report-icon-green::after { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E"); }
.teacher-report-icon-cyan { color: #0ea5e9; }
.teacher-report-icon-cyan::after { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2zm0 2.5l5 2.5v2.5l-5 2.5-5-2.5V7l5-2.5z'/%3E%3Cpath d='M6 14l6 2.5 6-2.5'/%3E%3Ccircle cx='12' cy='10' r='.8'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2zm0 2.5l5 2.5v2.5l-5 2.5-5-2.5V7l5-2.5z'/%3E%3Cpath d='M6 14l6 2.5 6-2.5'/%3E%3Ccircle cx='12' cy='10' r='.8'/%3E%3C/svg%3E"); }
.teacher-report-icon-yellow { color: #ca8a04; }
.teacher-report-icon-yellow::after { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E"); }
.teacher-report-icon-red { color: #dc2626; }
.teacher-report-icon-red::after { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2' fill='%23fff'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1' fill='%23fff'/%3E%3Cpath d='M9 11l2 2 4-4' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2' fill='%23fff'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1' fill='%23fff'/%3E%3Cpath d='M9 11l2 2 4-4' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.teacher-report-metric-content { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.teacher-report-metric-value { display: block; font-size: 2rem; font-weight: 700; color: #1f2937; letter-spacing: -0.02em; line-height: 1.2; }
.teacher-report-metric-label { font-size: 0.9rem; color: #6b7280; }

/* Teacher Grades page - Filters + Grades Report */
.teacher-grades-page .grades-filters-card,
.teacher-grades-page .grades-report-card,
.teacher-attendance-report-page .grades-filters-card,
.teacher-attendance-report-page .grades-report-card,
.teacher-students-report-page .grades-filters-card,
.teacher-students-report-page .grades-report-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.grades-filters-heading { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; color: #1f2937; display: flex; align-items: center; gap: 0.5rem; }
.grades-filters-heading-icon { font-size: 0.75rem; color: #6b7280; }
.grades-filters-form { display: flex; flex-direction: column; gap: 1rem; }
.grades-filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .grades-filters-row { grid-template-columns: 1fr; } }
.grades-filter-group { margin: 0; }
.grades-filter-group .input-academic-year { width: 100%; max-width: 100%; }
.grades-filters-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.grades-btn-apply { display: inline-flex; align-items: center; gap: 0.4rem; }
.grades-btn-clear { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.grades-btn-clear:hover { color: inherit; }
.grades-btn-icon { font-size: 1rem; opacity: 0.9; }
.grades-report-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.grades-report-heading-row .grades-report-heading { margin: 0; }
.grades-report-heading { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; color: #1f2937; display: flex; align-items: center; gap: 0.5rem; }
.grades-report-heading-icon { font-size: 1rem; color: #6b7280; }
.grades-report-empty { text-align: center; padding: 3rem 2rem; }
.grades-report-empty-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: #e5e7eb; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.grades-report-empty-title { margin: 0 0 0.35rem; font-size: 1.15rem; font-weight: 700; color: #1f2937; }
.grades-report-empty-text { margin: 0; font-size: 0.95rem; color: #6b7280; }
.grades-report-table-wrap { overflow-x: auto; }
.grades-report-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.grades-report-table th { text-align: left; padding: 0.65rem 0.75rem; background: #f8fafc; border-bottom: 1px solid var(--border); font-weight: 600; color: #374151; }
.grades-report-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); color: #1f2937; }
.grades-report-table tbody tr:hover { background: #f8fafc; }

/* Teacher Students Report - single Class filter, status badges */
.teacher-students-report-page .students-filters-row { grid-template-columns: 1fr; max-width: 320px; }
.students-status-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.students-status-active { background: #dcfce7; color: #166534; }
.students-status-suspend { background: #fef3c7; color: #b45309; }
.students-status-inactive { background: #f3f4f6; color: #6b7280; }
.students-report-table tbody tr:nth-child(even) { background: #f9fafb; }
.students-report-table tbody tr:nth-child(even):hover { background: #f1f5f9; }

/* Teacher Attendance Report - date filters + Take Attendance button */
.teacher-attendance-report-page .attendance-filters-row { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) { .teacher-attendance-report-page .attendance-filters-row { grid-template-columns: 1fr; } }
.attendance-date-wrap { position: relative; display: flex; align-items: center; }
.attendance-date-wrap input { flex: 1; min-width: 0; }
.attendance-date-wrap .attendance-date-icon { margin-left: 0.5rem; font-size: 1rem; color: #6b7280; pointer-events: none; }
.attendance-report-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.attendance-report-heading-row .grades-report-heading { margin: 0; }
.attendance-btn-take { text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.attendance-btn-take:hover { color: #fff; }

.upload-grades-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.upload-grades-heading-row .dashboard-title { margin: 0; }
.bulk-grades-table-wrap { overflow-x: auto; margin: 1rem 0; }
.bulk-grades-table { min-width: 100%; }
.bulk-grades-table th { white-space: nowrap; padding: 0.5rem 0.4rem; font-size: 0.85rem; }
.bulk-grades-table td { padding: 0.4rem; vertical-align: middle; }

/* Upload Grades matrix: students × subjects */
.upload-grades-matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
.upload-grades-matrix-table { min-width: 100%; table-layout: auto; }
.upload-grades-matrix-table th { white-space: nowrap; padding: 0.5rem 0.6rem; font-size: 0.9rem; background: var(--card-bg, #f8fafc); }
.upload-grades-matrix-table td { padding: 0.35rem 0.5rem; vertical-align: middle; }
.upload-grades-col-student { min-width: 10rem; position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 2px 0 4px rgba(0,0,0,0.06); }
.upload-grades-matrix-table thead th.upload-grades-col-student { background: var(--green, #15803d); color: #fff; }
.upload-grades-input { min-width: 4rem; max-width: 5.5rem; }
.upload-grades-cell-empty { background: #fef3c7; }
.upload-grades-cell-empty .upload-grades-input { background: #fffbeb; }
.bulk-grade-cell { display: flex; flex-direction: column; gap: 0.2rem; min-width: 6rem; }
.bulk-grade-marks { width: 100%; max-width: 5rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem; }
.bulk-grade-grade { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; min-height: 1.2em; }

/* Time Table (Admin) - inputs match .register-student-form-group select */
.timetable-wrap { max-width: 100%; padding-bottom: 1.5rem; }
.timetable-school-filter { margin-bottom: 1rem; }
.timetable-school-filter .students-filter-form { display: flex; align-items: center; gap: 0.5rem; }
.timetable-school-filter label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.timetable-school-filter select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; min-width: 200px; background: var(--card-bg); color: var(--text); font-family: inherit; }
.timetable-school-filter select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.timetable-header { margin-bottom: 1.75rem; }
.timetable-title { margin: 0 0 0.35rem; font-size: 1.6rem; font-weight: 700; color: #1f2937; display: flex; align-items: center; gap: 0.6rem; }
.timetable-title::before { content: ''; display: inline-block; width: 32px; height: 32px; background: #6366f1; border-radius: 8px; flex-shrink: 0; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.timetable-subtitle { margin: 0; font-size: 0.9rem; color: #6b7280; }
.timetable-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 600px) { .timetable-summary { grid-template-columns: 1fr; } }
.timetable-summary-card { border-radius: 14px; padding: 1.5rem 1.75rem; box-shadow: 0 4px 14px rgba(91, 33, 182, 0.2); color: #fff; }
.timetable-summary-purple,
.timetable-summary-blue { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #a78bfa 100%); }
.timetable-summary-value { display: block; font-size: 2rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.timetable-summary-label { font-size: 0.9rem; opacity: 0.95; }
.timetable-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding: 0.75rem 0; }
.timetable-toolbar-form { display: inline-flex; align-items: center; gap: 0.5rem; }
.timetable-toolbar-label { font-size: 0.9rem; font-weight: 500; color: var(--text); margin: 0; }
.timetable-toolbar-select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; min-width: 160px; background: var(--card-bg); color: var(--text); font-family: inherit; box-sizing: border-box; }
.timetable-toolbar-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }

/* Academic Year input - blue border design (same as reference) */
.input-academic-year {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--blue);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 160px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    box-sizing: border-box;
}
.input-academic-year:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.input-academic-year:disabled {
    background: var(--card-bg);
    color: var(--text);
    cursor: default;
    opacity: 1;
}
.register-student-form-group .input-academic-year { max-width: 100%; min-width: 0; }
.required-asterisk { color: var(--red); font-weight: 600; }
.timetable-btn-add { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.1rem; border-radius: 10px; background: #2563eb; color: #fff; font-size: 0.9rem; font-weight: 600; text-decoration: none; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3); }
.timetable-btn-add:hover { background: #1d4ed8; color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4); }
.timetable-btn-add-inline { margin-top: 1rem; }
.timetable-publish-form { display: inline; }
.timetable-btn-publish { display: inline-flex; padding: 0.6rem 1.1rem; border-radius: 10px; border: none; background: #22c55e; color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3); }
.timetable-btn-publish:hover { background: #16a34a; }
.timetable-btn-unpublish { display: inline-flex; padding: 0.6rem 1.1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.timetable-btn-unpublish:hover { background: var(--main-bg); }
.timetable-status-note { margin: 0 0 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.timetable-status-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.timetable-status-published { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.timetable-status-draft { background: rgba(107, 114, 128, 0.2); color: #4b5563; }
.timetable-empty { text-align: center; padding: 2rem 1.5rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.timetable-empty-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.timetable-empty-icon::after { content: ''; display: block; width: 28px; height: 28px; background: #94a3b8; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' fill='currentColor'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' fill='currentColor'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.timetable-empty-title { margin: 0 0 0.35rem; font-weight: 600; font-size: 1.1rem; color: var(--text); }
.timetable-empty-text { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.timetable-table-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 1.25rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; }
.timetable-table-card .timetable-table { font-size: 0.9rem; }
.timetable-table-card .timetable-table th { background: #f8fafc; font-weight: 600; color: #475569; padding: 0.75rem 1rem; }
.timetable-table-card .timetable-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.timetable-table-card .timetable-table tbody tr:last-child td { border-bottom: none; }
.timetable-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.timetable-btn-edit { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; text-decoration: none; background: #3b82f6; color: #fff; }
.timetable-btn-edit:hover { background: #2563eb; color: #fff; }
.timetable-btn-delete { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; text-decoration: none; background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.timetable-btn-delete:hover { background: rgba(239, 68, 68, 0.2); color: #b91c1c; }

/* Class Timetable grid view - same as reference: clean white/grey, simple header */
.class-timetable-wrap { max-width: 100%; padding-bottom: 2.5rem; }
.class-timetable-header-simple { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 1.25rem; }
.class-timetable-header-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: #374151; }
.class-timetable-back-btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; background: #e5e7eb; color: #374151; font-size: 0.875rem; font-weight: 500; text-decoration: none; border: 1px solid #d1d5db; }
.class-timetable-back-btn:hover { background: #d1d5db; color: #1f2937; }
.class-timetable-filters-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.class-timetable-toolbar-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 2rem; }
.class-timetable-filter-group { display: flex; flex-direction: column; gap: 0.4rem; flex: 0 0 auto; width: 220px; }
.class-timetable-filter-label { font-size: 0.8125rem; font-weight: 500; color: #374151; letter-spacing: 0.01em; }
.class-timetable-filter-group select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; background: #fff; color: #374151; box-sizing: border-box; }
.class-timetable-filters-card .class-timetable-filter-group select.input-academic-year { border-color: #3b82f6; }
.class-timetable-filters-inline { display: flex; align-items: center; gap: 0.5rem; }
.class-timetable-filters-inline .class-timetable-filter-label { margin-right: 0.25rem; }
.class-timetable-toolbar-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; padding-left: 1rem; border-left: 1px solid #e5e7eb; }
.class-timetable-reset { font-size: 0.875rem; font-weight: 500; color: #374151; text-decoration: none; padding: 0.4rem 0.6rem; border-radius: 4px; }
.class-timetable-reset:hover { background: #f3f4f6; color: #1f2937; }
.class-timetable-print { font-size: 0.875rem; font-weight: 500; color: #374151; text-decoration: none; padding: 0.4rem 0.6rem; border-radius: 4px; }
.class-timetable-print:hover { background: #f3f4f6; color: #1f2937; }
.class-timetable-empty-msg { color: var(--text-muted); padding: 1.25rem; text-align: center; background: var(--main-bg); border-radius: 10px; }
.class-timetable-card .class-timetable-wrap { margin-top: 0.25rem; }
.class-timetable-day-section { margin-bottom: 2rem; }
.class-timetable-day-title { margin: 0 0 0.75rem; font-size: 0.95rem; font-weight: 600; color: #6b7280; padding: 0.5rem 0.75rem; background: #f3f4f6; border-radius: 4px; border: 1px solid #e5e7eb; }
.class-timetable-day-name { letter-spacing: 0.01em; }
.class-timetable-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; }
.class-timetable-grid { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 0.875rem; }
.class-timetable-grid th { text-align: center; padding: 0.6rem 0.5rem; background: #f3f4f6; font-weight: 600; color: #374151; border: 1px solid #e5e7eb; white-space: nowrap; font-size: 0.8rem; }
.class-timetable-grid td { padding: 0; border: 1px solid #e5e7eb; text-align: center; vertical-align: middle; background: #fff; }
.class-timetable-col-time { min-width: 128px; position: sticky; left: 0; z-index: 2; background: #f3f4f6 !important; font-size: 0.8rem; color: #374151; padding: 0.6rem 0.5rem !important; }
.class-timetable-col-no { min-width: 40px; position: sticky; left: 128px; z-index: 2; background: #f3f4f6 !important; font-weight: 600; color: #374151; }
.class-timetable-col-class { min-width: 96px; }
.class-timetable-grid thead th.class-timetable-col-class { position: sticky; top: 0; z-index: 3; background: #f3f4f6 !important; box-shadow: 0 1px 0 0 #e5e7eb; }
.class-timetable-grid thead th.class-timetable-col-time,
.class-timetable-grid thead th.class-timetable-col-no { z-index: 4; box-shadow: 1px 0 0 0 #e5e7eb; }
.class-timetable-period-row:nth-child(even) td.class-timetable-col-time,
.class-timetable-period-row:nth-child(even) td.class-timetable-col-no { background: #f9fafb !important; }
.class-timetable-period-row:nth-child(even) .class-timetable-cell { background: #fafafa; }
.class-timetable-cell { min-width: 96px; background: #fff; }
.class-timetable-cell-link { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.6rem 0.5rem; text-decoration: none; color: inherit; border-radius: 0; min-height: 3rem; transition: background 0.15s; }
.class-timetable-cell-link:hover { background: #f3f4f6 !important; color: #1f2937; }
.class-timetable-cell-empty { color: #9ca3af; font-size: 1rem; }
.class-timetable-cell-filled { text-align: center; }
.class-timetable-cell-subject { display: block; font-weight: 700; font-size: 0.75rem; color: #1f2937; line-height: 1.3; }
.class-timetable-cell-teacher { display: block; font-size: 0.55rem; color: #6b7280; margin-top: 0.15rem; }
.class-timetable-break-row { background: #f9fafb; }
.class-timetable-break-cell { font-weight: 700; font-size: 0.85rem; color: #374151; padding: 0.6rem 1rem !important; text-align: center !important; background: #e5e7eb !important; border-top: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; }
.class-timetable-cell-edit-wrap { max-width: 100%; }
@media print {
    .class-timetable-card .teachers-toolbar, .class-timetable-card .dashboard-title + .students-filter-form, .sidebar, .user-area, .app-header .user-area { display: none !important; }
    .class-timetable-scroll-wrap { overflow: visible !important; box-shadow: none; }
    .class-timetable-wrap { padding: 0; }
    .class-timetable-day-section { break-inside: avoid; }
    .app-header, .sidebar { position: static !important; }
    .main { margin: 0 !important; padding: 0.5rem !important; height: auto !important; overflow: visible !important; }
}

/* Class Details (View Details) page */
.class-details-wrap { max-width: 100%; padding-bottom: 1.5rem; }
.class-details-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.class-details-header-left { flex: 1; min-width: 0; }
.class-details-title { margin: 0 0 0.25rem; font-size: 1.4rem; font-weight: 700; color: #1f2937; }
.class-details-meta { margin: 0; font-size: 0.9rem; color: #6b7280; }
.class-details-header-right { flex-shrink: 0; }
.class-details-back { display: inline-block; padding: 0.5rem 1rem; border-radius: 8px; background: #e5e7eb; color: #374151; font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.class-details-back:hover { background: #d1d5db; color: #1f2937; }
.class-details-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .class-details-row { grid-template-columns: 1fr; } }
.class-details-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.class-details-card-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; color: #1f2937; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.class-details-card-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; font-weight: 700; color: #fff; }
.class-details-icon-info { background: #6366f1; font-style: italic; }
.class-details-icon-info::after { content: 'i'; }
.class-details-icon-person { background: #3b82f6; font-size: 0; }
.class-details-icon-person::after { content: ''; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-icon-grad { background: #059669; font-size: 0; }
.class-details-icon-grad::after { content: ''; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2z'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L2 7v1.5h2v5.5l8 4 8-4V8.5h2V7L12 2z'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
/* Class Information card — info grid with clear label/value rows */
.class-details-info-card .class-details-card-title { margin-bottom: 1rem; }
.class-details-info-grid { display: flex; flex-direction: column; gap: 0; }
.class-details-info-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.85rem; border-radius: 8px; background: #f8fafc; border-left: 3px solid #6366f1; margin-bottom: 0.4rem; }
.class-details-info-item:last-child { margin-bottom: 0; }
.class-details-info-label { font-size: 0.85rem; font-weight: 600; color: #64748b; }
.class-details-info-value { font-size: 0.95rem; font-weight: 600; color: #1e293b; }
.class-details-dl { margin: 0; display: grid; gap: 0.35rem 1rem; grid-template-columns: auto 1fr; }
.class-details-dl dt { margin: 0; font-weight: 600; font-size: 0.9rem; color: #374151; }
.class-details-dl dd { margin: 0; font-size: 0.9rem; color: #1f2937; }
/* My Assignment card — avatar, role badge, name, contact rows */
.class-details-assignment-card .class-details-card-title { margin-bottom: 1rem; }
.class-details-assignment-inner { background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%); border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.25rem 1.5rem; }
.class-details-assignment-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.class-details-assignment-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.class-details-assignment-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.class-details-assignment-role { display: inline-flex; align-items: center; padding: 0.25rem 0.6rem; border-radius: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%); color: #fff; width: fit-content; box-shadow: 0 1px 3px rgba(67,56,202,0.25); }
.class-details-assigned { font-size: 0.8rem; color: #64748b; }
.class-details-assignment-name { margin: 0 0 1rem; font-weight: 700; font-size: 1.1rem; color: #1e293b; }
.class-details-assignment-contact-list { display: flex; flex-direction: column; gap: 0.5rem; }
.class-details-assignment-contact-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 8px; background: #fff; border: 1px solid #e2e8f0; font-size: 0.9rem; color: #334155; }
.class-details-assignment-contact-item .class-details-contact-icon { width: 1.1em; height: 1.1em; flex-shrink: 0; color: #6366f1; }
.class-details-role-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; background: #e0e7ff; color: #3730a3; }
.class-details-name { margin: 0 0 0.5rem; font-weight: 600; font-size: 1rem; color: #1f2937; }
.class-details-contact { margin: 0 0 0.25rem; font-size: 0.875rem; color: #4b5563; display: flex; align-items: center; gap: 0.35rem; }
.class-details-contact-icon { width: 1em; height: 1em; flex-shrink: 0; display: inline-block; background: currentColor; vertical-align: -0.15em; }
.class-details-icon-email { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-icon-phone { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-students-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.class-details-students-card .class-details-card-title { margin-bottom: 1rem; }
/* Show first ~10 rows; scroll for the rest */
.class-details-students-table-wrap { max-height: 32rem; overflow-y: auto; overflow-x: auto; }
/* Teachers in this class — list with avatar, name, Form Master badge, subject tags; scrollable when many */
.class-details-teachers-list { max-height: 20rem; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 0.5rem; }
.class-details-teacher-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: #f9fafb; border: 1px solid #e5e7eb; }
.class-details-teacher-avatar { width: 36px; height: 36px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.class-details-teacher-body { flex: 1; min-width: 0; }
.class-details-teacher-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.35rem; }
.class-details-teacher-name { font-weight: 700; font-size: 0.95rem; color: #1f2937; }
.class-details-teacher-fm-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%); color: #fff; box-shadow: 0 1px 2px rgba(67,56,202,0.25); }
.class-details-teacher-subjects { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.class-details-teacher-subject-tag { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.78rem; color: #374151; background: #e5e7eb; border: 1px solid #d1d5db; }
.class-details-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.85rem; font-weight: 700; background: #2563eb; color: #fff; margin-left: 0.5rem; }
.class-details-table-wrap { overflow-x: auto; }
.class-details-parents-card .class-details-table-wrap { max-height: 20rem; overflow-y: auto; overflow-x: auto; }
.class-details-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.class-details-table th { text-align: left; padding: 0.75rem 1rem; background: #f3f4f6; font-weight: 600; color: #374151; border-bottom: 1px solid #e5e7eb; }
.class-details-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; color: #1f2937; }
.class-details-contact-line { display: block; margin-bottom: 0.15rem; }
.class-details-contact-line:last-child { margin-bottom: 0; }
.class-details-status { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.class-details-status-active { background: #d1fae5; color: #065f46; }
.class-details-status-inactive { background: #fee2e2; color: #991b1b; }
.class-details-action-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #2563eb; color: #fff; text-decoration: none; font-size: 0; }
.class-details-action-btn::before { content: ''; display: inline-block; width: 1em; height: 1em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.class-details-action-btn:hover { background: #1d4ed8; color: #fff; }
.class-details-empty { color: #6b7280; text-align: center; padding: 1.5rem; }
.class-details-row-single { grid-template-columns: 1fr; }
.class-details-dl-inline { grid-template-columns: auto 1fr; gap: 0.5rem 2rem; }
.class-details-icon-clipboard { background: #059669; font-size: 0; }
.class-details-icon-clipboard::after { content: ''; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-exams-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-top: 1.5rem; }
.class-details-exams-card .class-details-card-title { margin-bottom: 1rem; }
.class-details-empty-state { text-align: center; padding: 2rem 1.5rem; }
.class-details-empty-icon { display: block; width: 64px; height: 64px; margin: 0 auto 1rem; opacity: 0.4; }
.class-details-empty-icon-person { background: #6b7280; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4'/%3E%3Cpath d='M4 4l16 16' stroke='%23dc2626' stroke-width='2' fill='none'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M6 20c0-2.2 2.5-4 6-4s6 1.8 6 4'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-empty-icon-clipboard { background: #6b7280; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E"); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.class-details-empty-text { margin: 0 0 1rem; font-size: 0.95rem; color: #6b7280; }
.class-details-create-exam-btn { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Exam dashboard: recent list (KPI cards use .admin-kpi-* like admin dashboard) */
.exam-dash-recent-list { display: flex; flex-direction: column; gap: 0.5rem; }
.exam-dash-recent-item { display: block; padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.exam-dash-recent-item:hover { background: var(--main-bg); }
.exam-dash-recent-name { font-weight: 600; display: block; }
.exam-dash-recent-meta { font-size: 0.85rem; color: var(--text-muted); }

/* Cards & forms */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.attendance-filter-form { margin-bottom: 1.25rem; }
.attendance-table-wrap { margin-top: 0.5rem; }
.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input, .form-group select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; min-width: 200px; }
.mb-1 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--main-bg); font-weight: 600; color: var(--text-muted); }
.text-red { color: var(--red); }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.badge-success { background: rgba(22,163,74,0.15); color: var(--green); }

/* Pagination */
.pagination-wrap { margin-top: 1.25rem; margin-bottom: 1.25rem; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.pagination li { display: inline-flex; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem; border-radius: 8px; font-size: 0.9rem; font-family: inherit; text-decoration: none; color: #374151; border: 1px solid #e5e7eb; background: #fff; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.pagination a:hover { background: #f9fafb; border-color: #d1d5db; color: #111827; }
.pagination .pagination-current { font-weight: 600; background: #2563eb; border-color: #2563eb; color: #fff; }
.pagination .pagination-disabled { opacity: 0.6; cursor: not-allowed; color: #9ca3af; }
.pagination .pagination-ellipsis { border: none; background: transparent; cursor: default; min-width: 1.5rem; color: #6b7280; padding: 0 0.25rem; }

/* Create New Class page */
.create-class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.create-class-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.create-class-card .register-student-section-grid { margin-bottom: 0; }
.create-exam-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .create-exam-grid-3 { grid-template-columns: 1fr; } }
.create-class-teachers { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.create-class-teacher-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.create-class-teacher-select { min-width: 180px; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.create-class-role-select { min-width: 120px; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.create-class-add-teacher { margin-bottom: 0.5rem; }
.create-class-teachers-hint { margin: 0.25rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.create-class-btn-icon { margin-right: 0.35rem; }

/* Teacher Assignment: Single vs Bulk mode toggle */
.assignment-mode-toggle { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.assignment-mode-label { font-weight: 600; color: var(--text); margin-right: 0.25rem; }
.assignment-mode-tab {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.assignment-mode-tab:hover { background: #f1f5f9; color: var(--text); }
.assignment-mode-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.bulk-assign-table-wrap { overflow-x: auto; margin: 1rem 0; }
.bulk-assign-table { max-width: 600px; }
.bulk-assign-table select { width: 100%; min-width: 180px; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--card-bg); }

/* Finance dashboard */
/* Finance Dashboard: Academic Year selector (rounded white box, dark label) */
.finance-dash-academic-year {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.finance-dash-academic-year label {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}
.finance-dash-academic-year-select {
    min-width: 140px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    cursor: pointer;
}
.finance-dash-academic-year-select:hover {
    border-color: #d1d5db;
}
.finance-dash-academic-year-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.finance-summary-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 1100px) { .finance-summary-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .finance-summary-cards { grid-template-columns: repeat(2, 1fr); } }
.finance-card { border-radius: 8px; padding: 1rem 1.25rem; border: none; }
.finance-card-label { display: block; font-size: 0.8rem; margin-bottom: 0.35rem; font-weight: 500; }
.finance-card-value { font-size: 1.35rem; font-weight: 700; }
.finance-card-total { background: #374151; color: #fff; }
.finance-card-total .finance-card-label { color: rgba(255,255,255,0.9); }
.finance-card-total-breakdown { display: flex; flex-direction: column; align-items: flex-start; }
.finance-card-total-breakdown .finance-card-value { margin-bottom: 0.25rem; }
.finance-card-line { display: block; font-size: 0.85rem; opacity: 0.95; margin-top: 0.15rem; }
.finance-card-line.finance-card-paid { color: #86efac; }
.finance-card-line.finance-card-unpaid { color: #fca5a5; }
.finance-card-forwarded { background: #0d9488; color: #fff; }
.finance-card-forwarded .finance-card-label,
.finance-card-forwarded .finance-card-value,
.finance-card-forwarded .finance-card-line { color: #fff; }
.finance-card-discount { background: var(--orange); color: #fff; }
.finance-card-discount .finance-card-label { color: rgba(255,255,255,0.9); }
.finance-card-income { background: #ea580c; color: #fff; }
.finance-card-income .finance-card-label { color: rgba(255,255,255,0.9); }
.finance-card-accrued { background: var(--green); color: #fff; }
.finance-card-accrued .finance-card-label { color: rgba(255,255,255,0.9); }
.finance-card-deferred { background: var(--red); color: #fff; }
.finance-card-deferred .finance-card-label { color: rgba(255,255,255,0.9); }
.finance-card-free { background: #7c3aed; color: #fff; }
.finance-card-free .finance-card-label,
.finance-card-free .finance-card-value { color: #fff; }

.finance-charts-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .finance-charts-row { grid-template-columns: 1fr; } }
.chart-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.chart-panel h3 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--text); }
.chart-placeholder { min-height: 200px; background: var(--main-bg); border-radius: 6px; padding: 0.75rem; display: flex; flex-direction: column; color: var(--text-muted); }
.chart-placeholder-finance .chart-yaxis { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.chart-placeholder-finance .chart-grid { flex: 1; background: repeating-linear-gradient(transparent, transparent 19px, var(--border) 20px); border-radius: 4px; }
.chart-axis { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Same design as placeholder: y-axis left, horizontal grid right (like report charts) */
.chart-placeholder-finance-row {
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
}
.chart-placeholder-finance-row .chart-yaxis-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-bottom: 0;
}
.chart-placeholder-finance-row .chart-grid-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
    border-radius: 4px;
    overflow: hidden;
}
.chart-placeholder-finance-row .chart-grid {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 19px, var(--border) 20px);
    border-radius: 4px;
}
.chart-placeholder-finance-row .chart-bars-overlay {
    position: relative;
    height: 100%;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    padding: 0 0 1.25rem 0;
}
.chart-placeholder-finance-row .chart-bars-overlay-many { flex-wrap: wrap; }
.chart-placeholder-finance-row .finance-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
    max-width: 48px;
}
.chart-placeholder-finance-row .finance-bar {
    width: 100%;
    max-width: 40px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.2s ease;
}
.chart-placeholder-finance-row .finance-bar-expected { background: #ea580c; }
.chart-placeholder-finance-row .finance-bar-collected { background: var(--green); }
.chart-placeholder-finance-row .finance-bar-class { background: #2563eb; }
.chart-placeholder-finance-row .finance-bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.chart-placeholder-finance-row .finance-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.finance-table-section { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.finance-table-header-bar { padding: 0.6rem 1rem; background: var(--green); color: #fff; font-weight: 700; font-size: 1rem; }
.finance-table-wrap { overflow-x: auto; }
.finance-table { width: 100%; border-collapse: collapse; }
.finance-table th, .finance-table td { padding: 0.55rem 0.75rem; font-size: 0.9rem; }
.finance-table thead tr { background: var(--green); color: #fff; }
.finance-table thead th { background: var(--green); color: #fff; font-weight: 600; border: none; }
.finance-table tbody tr:nth-child(even) { background: #f8fafc; }
.finance-table tbody tr:nth-child(odd) { background: #fff; }
.finance-table tbody td { border-bottom: 1px solid var(--border); }
.finance-table tbody td.col-orange { background: rgba(234,88,12,0.12); color: var(--text); }
.finance-table tbody td.col-green { background: rgba(22,163,74,0.12); color: var(--text); }
.finance-table tbody td.col-red { background: rgba(220,38,38,0.12); color: var(--text); }
.finance-table tbody td.col-free { background: rgba(59,130,246,0.1); color: var(--text); }
.col-orange { color: var(--orange); }
.col-green { color: var(--green); }
.col-red { color: var(--red); }
.col-free { color: #2563eb; }

/* Fees toolbar & table */
.fees-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    padding: 0.85rem 1rem;
    background: #e5e7eb;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.fees-toolbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.btn-fees-export {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-fees-export.btn-fees-excel { background: var(--green); color: #fff; border-color: var(--green); }
.btn-fees-export.btn-fees-word:hover,
.btn-fees-export.btn-fees-pdf:hover { background: var(--border); color: var(--text); }
.btn-reset-fees { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; background: #eab308; color: #1f2937; font-weight: 500; font-size: 0.9rem; border: none; cursor: pointer; text-decoration: none; }
.btn-reset-fees:hover { background: #ca8a04; color: #fff; }
.fees-toolbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.fees-filter-label { font-size: 0.85rem; color: var(--text-muted); margin-right: 0.15rem; }
.fees-toolbar-filters select,
.fees-filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
    min-width: 120px;
    height: 2.25rem;
    box-sizing: border-box;
}
.fees-month-picker { position: relative; display: inline-block; }
.fees-month-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 140px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.fees-month-picker-arrow { font-size: 0.65rem; opacity: 0.7; }
.fees-month-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    min-width: 200px;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}
.fees-month-picker-year { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.fees-month-picker-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
}
.fees-month-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.fees-month-picker-month {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}
.fees-month-picker-month:hover { background: var(--border); }
.fees-month-picker-month.active { background: var(--green); color: #fff; border-color: var(--green); }
.fees-month-picker-month.disabled,
.fees-month-picker-month:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; background: var(--bg); color: var(--muted); }
.fees-month-picker-month.disabled:hover,
.fees-month-picker-month:disabled:hover { background: var(--bg); }
.fees-month-picker-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.fees-month-picker-action {
    padding: 0.35rem 0.6rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}
.fees-month-picker-action:hover { color: var(--text); }
.fees-month-picker-this { color: var(--green); font-weight: 500; }
.fees-month-picker-this:hover { color: var(--green); }

.fees-search-input { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; width: 220px; font-size: 0.9rem; }
.btn-search { padding: 0.5rem 1rem; border-radius: 6px; background: var(--blue); color: #fff; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-print { padding: 0.5rem 1rem; border-radius: 6px; background: #7dd3fc; color: #0369a1; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-print:hover { background: #38bdf8; color: #0c4a6e; }

.fees-category-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.fees-category-label { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; font-weight: 500; }
.fees-category-tab {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}
button.fees-category-tab { margin: 0; }
.fees-category-tab:hover { background: var(--border); color: var(--text); }
.fees-category-tab.active { background: var(--green); color: #fff; border-color: var(--green); }

.discounts-card .fees-toolbar { margin-bottom: 1.5rem; }

/* Clearance page */
.clearance-grant-card { margin-bottom: 1.5rem; }
.clearance-grant-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}
.clearance-grant-row .clearance-grant-field { min-width: 0; }
.clearance-grant-row .clearance-grant-field label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--text-muted); }
.clearance-grant-row .clearance-grant-field select,
.clearance-grant-row .clearance-grant-field input[type="text"] {
    width: 100%;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.95rem;
}
.clearance-grant-row .clearance-grant-student { flex: 1; min-width: 200px; }
.clearance-card .clearance-toolbar { margin-bottom: 1.5rem; }
.clearance-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.clearance-toolbar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.clearance-filter-label { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; }
.clearance-toolbar-form select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
}
.clearance-toolbar-export { display: flex; align-items: center; }
.btn-clearance-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-clearance-export:hover { background: #15803d; color: #fff; }
.clearance-toolbar-export .btn-clearance-pdf { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); text-decoration: none; margin-left: 0.5rem; }
.clearance-toolbar-export .btn-clearance-pdf:hover { background: var(--border); color: var(--text); }
.btn-clearance-export-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 2 5 5h-5V4zm-3 8v2h6v-2h-6zm0 4v2h6v-2h-6z'/%3E%3C/svg%3E") center/contain no-repeat;
    vertical-align: -0.15em;
}
.clearance-toolbar-search { display: flex; align-items: center; gap: 0.5rem; }
.clearance-search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 220px;
}
.clearance-table { margin-bottom: 0; }

/* All Students page (uses clearance-toolbar design) */
.all-students-card .clearance-toolbar { margin-bottom: 1.5rem; }

.fees-table-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; overflow-y: visible; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); -webkit-overflow-scrolling: touch; }
.card--fees .fees-table-wrap { border: none; box-shadow: none; border-radius: 0; background: transparent; margin-top: 0.5rem; }
.card--fees .fees-category-bar { margin-top: 0.25rem; margin-bottom: 0.5rem; }
.card--fees .students-filter-card .fees-month-picker-trigger { min-height: 38px; }
.card--charges .fees-table-wrap { border: none; box-shadow: none; border-radius: 0; background: transparent; margin-top: 0.5rem; }
.card--charges .fees-category-bar { margin-top: 0.25rem; margin-bottom: 0.5rem; }
.card--charges .students-filter-card .fees-month-picker-trigger { min-height: 38px; }
.fees-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.fees-table thead tr { background: var(--green); color: #fff; }
.fees-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; font-size: 0.85rem; white-space: nowrap; border: none; }
.fees-table tbody tr:nth-child(even) { background: #f8fafc; }
.fees-table tbody tr:nth-child(odd) { background: #fff; }
.fees-table tbody td { padding: 0.6rem 0.75rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.fees-table .cell-tuition .cell-sub,
.fees-table .cell-forwarded .cell-sub,
.fees-table .cell-outstanding .cell-sub { font-size: 0.8rem; color: var(--text-muted); }
.fees-table .cell-forwarded { color: var(--red); }
.fees-table .cell-green { color: var(--green); }
.cell-outstanding { color: var(--red); }
.fees-status { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.fees-status-paid { background: #dcfce7; color: #166534; }
.fees-status-partial { background: #fef3c7; color: #92400e; }
.fees-status-unpaid { background: #fee2e2; color: #991b1b; }
.fees-status-free { background: #e0e7ff; color: #3730a3; }
.fees-actions { white-space: nowrap; min-width: 120px; width: 1%; }
.fees-table thead th:last-child,
.fees-table tbody td.fees-actions { min-width: 120px; width: 120px; }
.btn-fees-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    color: #fff;
    margin-right: 0.35rem;
}
.btn-fees-icon:last-child { margin-right: 0; }
.btn-fees-info { background: var(--blue); }
.btn-fees-info:hover { background: #1d4ed8; color: #fff; }
.btn-fees-pay { background: var(--red); border: none; cursor: pointer; font-size: 1rem; }
.btn-fees-pay:hover { background: #b91c1c; color: #fff; }
.btn-fees-receipt { background: #7dd3fc; color: #0369a1; font-size: 1rem; text-decoration: none; }
.btn-fees-receipt:hover { background: #38bdf8; color: #0c4a6e; }
/* Record Payment modal – same design as reference (dark header, green sections) */
.payment-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1050; padding: 1rem; }
.payment-modal-overlay.payment-modal-open { display: flex !important; }
.payment-modal { position: relative; background: #fff; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-width: 720px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.payment-modal-header { background: #0f766e; color: #fff; padding: 0.85rem 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; }
.payment-modal-student-name { font-weight: 600; font-size: 1.05rem; }
.payment-modal-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.payment-modal-badge { background: var(--green); color: #fff; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.payment-modal-close { margin-left: auto; background: transparent; border: none; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0.25rem; opacity: 0.9; }
.payment-modal-close:hover { opacity: 1; }
.payment-modal-body { padding: 1rem; overflow-y: auto; flex: 1; }
.payment-modal-section { margin-bottom: 1rem; }
.payment-modal-section-border { border: 1px solid var(--green); border-radius: 6px; padding: 1rem; background: #fff; }
.payment-modal-section-title { color: var(--green); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; margin: 0 0 0.75rem; }
.payment-modal-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; }
.payment-modal-field { flex: 1; min-width: 100px; }
.payment-modal-field label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.payment-modal-net-wrap { align-self: flex-end; }
.payment-modal-net-value { display: inline-block; font-size: 1.1rem; font-weight: 700; color: var(--green); }
.payment-modal-input { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: #fff; }
.payment-modal-toggles { display: flex; gap: 0.5rem; align-items: center; }
.payment-modal-toggle { padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.85rem; cursor: default; }
.payment-modal-toggle.active { background: var(--green); color: #fff; }
.payment-modal-toggle:not(.active) { background: #e0f2fe; color: #0369a1; }
.payment-modal-balance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.payment-modal-balance-formula { font-size: 0.8rem; color: var(--text); flex: 1; min-width: 200px; }
.payment-modal-balance-formula .text-blue { color: #2563eb; }
.payment-modal-total-box { background: #1f2937; color: #fff; padding: 0.75rem 1.25rem; border-radius: 6px; text-align: right; }
.payment-modal-total-label { display: block; font-size: 0.75rem; opacity: 0.9; }
.payment-modal-total-value { font-size: 1.5rem; font-weight: 700; }
.payment-modal-tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.payment-modal-tab { padding: 0.5rem 1rem; background: none; border: none; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.payment-modal-tab.active { color: #0ea5e9; font-weight: 600; border-bottom-color: #0ea5e9; }
.payment-modal-tab-panel { margin-bottom: 0; }
.payment-modal-history-section { margin-bottom: 0; }
.payment-modal-history-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.payment-modal-history-header .payment-modal-section-title { margin: 0; }
.btn-print-history { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem; font-size: 0.85rem; color: #0ea5e9; background: #fff; border: 1px solid #0ea5e9; border-radius: 6px; cursor: pointer; }
.btn-print-history:hover { background: #f0f9ff; }
.payment-modal-history-table-wrap { overflow-x: auto; }
.payment-modal-history-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.payment-modal-history-table th { text-align: left; padding: 0.5rem 0.6rem; font-weight: 700; color: var(--text); border-bottom: 2px solid var(--border); }
.payment-modal-history-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.payment-modal-history-empty td { text-align: center; color: var(--text-muted); padding: 1rem; }
.payment-modal-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; background: #f8fafc; }
.payment-modal-btn-close { background: #e2e8f0; color: #1e293b; }
.payment-modal-btn-submit { background: var(--green); color: #fff; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; font-size: 0.85rem; text-decoration: none; color: #fff !important; margin-right: 0.25rem; transition: opacity 0.15s; border: none; }
.btn-icon svg { fill: currentColor; stroke: currentColor; }
.btn-icon:hover { opacity: 0.9; }
.btn-icon-edit { background: #2563eb !important; }
.btn-icon-view { background: #0d9488 !important; }
.btn-icon-delete { background: #dc2626 !important; }
.btn-icon-info { background: var(--blue); }

/* Discounts filter form */
.discounts-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.discounts-filter-form label { margin-right: 0.25rem; font-size: 0.9rem; }
.discounts-filter-form select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; }

/* Monthly Fees (reports) */
.monthly-fees-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .monthly-fees-cards { grid-template-columns: repeat(2, 1fr); } }
.mf-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.mf-card-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.25rem; }
.mf-card-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.mf-card-total .mf-card-value { color: var(--blue); }
.mf-card-paid .mf-card-value { color: var(--green); }
.mf-card-outstanding .mf-card-value { color: #d97706; }
.mf-card-overdue .mf-card-value { color: var(--red); }
.monthly-fees-filters { margin-bottom: 1rem; }
.mf-filters-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.mf-filter-label { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; }
.mf-filters-form select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); font-size: 0.9rem; min-width: 140px; }
.mf-clear { padding: 0.35rem 0.6rem; border-radius: 6px; background: var(--main-bg); color: var(--text-muted); font-size: 0.9rem; border: 1px solid var(--border); }
.mf-clear:hover { background: var(--border); color: var(--text); }
.monthly-fees-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.mf-section-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; background: var(--blue); color: #fff; font-weight: 700; font-size: 1rem; }
.mf-section-icon { font-size: 1.1rem; }
.mf-section-title { margin: 0; font-size: 1rem; font-weight: 700; }
.mf-table-wrap { overflow-x: auto; }
.mf-table { width: 100%; border-collapse: collapse; }
.mf-table thead tr { background: #dcfce7; color: #166534; }
.mf-table thead th { padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; font-size: 0.85rem; }
.mf-table tbody tr:nth-child(even) { background: #f8fafc; }
.mf-table tbody tr:nth-child(odd) { background: #fff; }
.mf-table tbody td { padding: 0.6rem 0.75rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.mf-student-name { display: block; font-weight: 600; }
.mf-student-id { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.mf-outstanding { color: var(--red); font-weight: 500; }
.mf-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500; }
.mf-badge-paid { background: rgba(22,163,74,0.15); color: #15803d; }
.mf-badge-pending { background: #fed7aa; color: #c2410c; }
.mf-actions { white-space: nowrap; }
.btn-mf { display: inline-block; padding: 0.4rem 0.65rem; border-radius: 6px; font-size: 0.85rem; font-weight: 500; text-decoration: none; margin-right: 0.35rem; }
.btn-mf-pay { background: var(--green); color: #fff; border: none; }
.btn-mf-pay:hover { background: #15803d; color: #fff; }
.btn-mf-receipt { background: #7dd3fc; color: #0369a1; border: none; }
.btn-mf-receipt:hover { background: #38bdf8; color: #0c4a6e; }

/* ========== Free Students Fee Management ========== */
.free-page { max-width: 100%; }

.free-school-select { margin-bottom: 1rem; }
.free-school-select .free-school-form { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.free-school-select .free-school-form label { font-size: 0.9rem; font-weight: 500; color: var(--text); margin: 0; }
.free-school-select .free-school-select-input {
    min-width: 220px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23111' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}
.free-school-select .free-school-select-input:hover { border-color: #9ca3af; }
.free-school-select .free-school-select-input:focus { outline: none; border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15); }

/* Students (and similar): show only the dropdown, no label — matches "Select school" design */
.free-school-select--input-only .free-school-select-label { display: none; }

.free-page-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.free-page-icon { font-size: 2rem; flex-shrink: 0; }
.free-page-title { margin: 0 0 0.2rem; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.free-page-subtitle { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.free-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.free-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}
.free-section-header-green { background: var(--green); }
.free-section-header-blue { background: var(--blue); }
.free-section-icon { font-size: 1.1rem; font-weight: 700; }
.free-section-body { padding: 1rem; }

.free-add-form .free-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.free-form-field {
    flex: 1 1 200px;
    min-width: 0;
}
.free-form-field-notes { flex: 2 1 260px; }
.free-form-field label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text); }
.free-form-field select,
.free-form-field input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card-bg);
}
.free-form-field input::placeholder { color: var(--text-muted); }
.free-form-actions { flex-shrink: 0; }
.btn-free-add {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-free-add:hover { background: #15803d; color: #fff; }

.free-empty-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    color: #0369a1;
    font-size: 0.95rem;
}
.free-empty-icon { font-size: 1.25rem; flex-shrink: 0; opacity: 0.9; }
.free-empty-state p { margin: 0; }

.free-table-wrap { overflow-x: auto; }
.free-table { width: 100%; border-collapse: collapse; }
.free-table th, .free-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.free-table th { background: var(--main-bg); color: var(--text-muted); font-weight: 600; }
.free-table tbody tr:hover { background: var(--main-bg); }

/* ========== Fee Collection Reports ========== */
.report-page { max-width: 100%; }
.report-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .report-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .report-cards { grid-template-columns: 1fr; } }
.report-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.report-card-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.25rem; }
.report-card-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.report-card-students .report-card-value { color: var(--blue); }
.report-card-collected .report-card-value { color: var(--green); }
.report-card-outstanding .report-card-value { color: #d97706; }
.report-card-rate .report-card-value { color: var(--red); }

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
/* Report type tabs (Select Report Type) */
.report-type-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.report-type-header .report-type-icon { width: 24px; height: 24px; opacity: 0.8; }
.report-type-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.report-type-tab {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 8px;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text); text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.report-type-tab:hover { background: var(--main-bg); border-color: var(--text-muted); }
.report-type-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.report-type-tab.active:hover { background: #1d4ed8; color: #fff; }
.report-type-tab.tab-students { border-color: var(--green); color: var(--green); }
.report-type-tab.tab-finance { border-color: #ea580c; color: #ea580c; }
.report-type-tab.tab-attendance { border-color: #0ea5e9; color: #0ea5e9; }
.report-type-tab.active.tab-students,
.report-type-tab.active.tab-finance,
.report-type-tab.active.tab-attendance { background: #2563eb; border-color: #2563eb; color: #fff; }
.report-type-tab.active.tab-students:hover,
.report-type-tab.active.tab-finance:hover,
.report-type-tab.active.tab-attendance:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.report-report-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.report-report-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
.report-report-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.report-report-title { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.btn-print-report { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 6px; background: #2563eb; color: #fff; border: none; font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn-print-report:hover { background: #1d4ed8; color: #fff; }
.report-summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .report-summary-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .report-summary-cards { grid-template-columns: 1fr; } }
.report-summary-card { border-radius: 8px; padding: 1.25rem; border: none; color: #fff; }
.report-summary-card .report-summary-value { display: block; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.report-summary-card .report-summary-label { font-size: 0.9rem; opacity: 0.95; }
.report-summary-card.card-blue { background: #2563eb; }
.report-summary-card.card-green { background: #166534; }
.report-summary-card.card-orange { background: #ea580c; }
.report-summary-card.card-lightblue { background: #0ea5e9; }

.report-export { display: flex; gap: 0.5rem; align-items: center; }
.btn-report-export {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
    text-decoration: none;
}
.report-export a.btn-report-export { color: #fff; text-decoration: none; }
.btn-report-export:hover { background: #15803d; color: #fff; }
.report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.report-filters label { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; }
.report-filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
    min-width: 120px;
}
.month-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    padding: 0 0.75rem 0 0.75rem;
    min-width: 160px;
}
.month-input-wrap input[type="month"] {
    border: none;
    background: transparent;
    padding: 0.5rem 0.25rem 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.month-input-wrap input[type="month"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.month-input-icon {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    pointer-events: none;
    margin-left: 0.25rem;
}
.report-clear {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: var(--main-bg);
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px solid var(--border);
}
.report-clear:hover { background: var(--border); color: var(--text); }

.report-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.report-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.report-section-icon { font-size: 1.1rem; }
.report-section-desc { margin: 0 0 0.75rem; font-size: 0.9rem; }
.report-chart-area { padding: 1rem; }
.report-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.report-legend-item { padding: 0.25rem 0.6rem; border-radius: 4px; }
.report-legend-total { background: var(--blue); color: #fff; }
.report-legend-collected { background: var(--green); color: #fff; }
.report-legend-outstanding { background: #d97706; color: #fff; }
.report-chart-placeholder {
    min-height: 200px;
    background: var(--main-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.report-chart-yaxis { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.report-chart-body { flex: 1; display: flex; align-items: center; }

.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table thead tr { background: var(--green); color: #fff; }
.report-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; font-size: 0.85rem; border: none; }
.table-transfers-header thead tr { background: var(--green); color: #fff; }
.table-transfers-header thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; font-size: 0.85rem; border: none; }
.report-table tbody tr:nth-child(even) { background: #f8fafc; }
.report-table tbody tr:nth-child(odd) { background: #fff; }
.report-table tbody td { padding: 0.6rem 0.75rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.report-table th.text-right,
.report-table td.text-right { text-align: right; }
.report-status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}
.report-status-pending { background: #fef08a; color: #854d0e; }
.report-status-paid { background: #dcfce7; color: #166534; }
.report-status-present { background: #dcfce7; color: #166534; }
.report-status-absent { background: #fee2e2; color: #991b1b; }
.report-status-late { background: #fef08a; color: #854d0e; }
.report-status-excused { background: #e0e7ff; color: #3730a3; }

/* Attendance report: Search & Filter card */
.results-filter-card { margin-bottom: 1rem; }
.results-filter-title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 700; color: var(--text); }
.results-filter-card label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; font-weight: 500; }
.results-filter-card select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; min-width: 200px; }

.report-attendance-filter-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.report-attendance-filter-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.report-attendance-filter-form .report-attendance-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.report-attendance-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.report-attendance-filter-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.report-attendance-filter-field input[type="text"],
.report-attendance-filter-field select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
    min-width: 140px;
}
.report-attendance-filter-field input::placeholder { color: var(--text-muted); }
.report-attendance-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-report-att-search,
.btn-report-att-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 6px;
    border: none;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
}
.btn-report-att-search { background: #2563eb; color: #fff; }
.btn-report-att-search:hover { background: #1d4ed8; color: #fff; }
.btn-report-att-clear { background: var(--main-bg); color: var(--text-muted); border: 1px solid var(--border); }
.btn-report-att-clear:hover { background: var(--border); color: var(--text); }

/* ========== Admission Dashboard ========== */
.admission-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .admission-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .admission-kpi-grid { grid-template-columns: 1fr; } }
.admission-kpi-card {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.admission-kpi-icon { display: block; font-size: 1.5rem; margin-bottom: 0.35rem; opacity: 0.95; }
.admission-kpi-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.admission-kpi-label { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.95; margin-top: 0.2rem; }
.admission-kpi-green { background: #16a34a; }
.admission-kpi-orange { background: #ea580c; }
.admission-kpi-gray { background: #374151; }
.admission-kpi-blue { background: #2563eb; }

/* Quick Actions */
.admission-quick-actions {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.admission-quick-actions-header {
    padding: 0.6rem 1rem;
    background: #374151;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.admission-quick-actions-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem;
    justify-content: center;
}
.admission-qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    min-width: 140px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.admission-qa-btn:hover { opacity: 0.95; transform: translateY(-1px); }
.admission-qa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.admission-qa-icon svg { flex-shrink: 0; }
.admission-qa-icon-dark { color: #1f2937; }
.admission-qa-label { color: #fff; }
.admission-qa-label-dark { color: #1f2937; }
.admission-qa-register { background: #2563eb; }
.admission-qa-students { background: #16a34a; }
.admission-qa-alumni { background: #06b6d4; }

/* ========== Students Management ========== */
.students-mgmt { max-width: 100%; }
.students-mgmt-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.students-mgmt-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.students-mgmt-subtitle { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.students-mgmt-school-filter { display: flex; align-items: center; gap: 0.5rem; }
.students-mgmt-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.students-mgmt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.students-mgmt-filter-label { font-size: 0.85rem; color: var(--text-muted); margin-right: 0.15rem; white-space: nowrap; }
.students-mgmt-search {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 220px;
}
.students-mgmt-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.9rem;
    min-width: 120px;
}
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-filter:hover { background: #1d4ed8; color: #fff; }
.btn-filter-icon { font-size: 1rem; }
.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: var(--main-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    text-decoration: none;
}
.btn-clear:hover { background: var(--border); color: var(--text); }
.btn-clear-icon { font-size: 0.9rem; }
.students-mgmt-export { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-export {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
}
.btn-export-excel { background: #16a34a; }
.btn-export-excel:hover { background: #15803d; color: #fff; }
.btn-export-word { background: #2563eb; }
.btn-export-word:hover { background: #1d4ed8; color: #fff; }
.btn-export-print { background: #1e3a8a; }
.btn-export-print:hover { background: #1e40af; color: #fff; }
.students-mgmt-table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.students-mgmt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.students-mgmt-table thead tr { background: var(--green); color: #fff; }
.students-mgmt-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border-bottom: 1px solid #374151; }
.students-mgmt-table tbody tr:nth-child(even) { background: #f8fafc; }
.students-mgmt-table tbody tr:nth-child(odd) { background: #fff; }
.students-mgmt-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.students-mgmt-actions { white-space: nowrap; }
.students-mgmt-actions .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    margin-right: 0.25rem;
    color: #fff;
    text-decoration: none;
}
.students-mgmt-actions .btn-action svg { flex-shrink: 0; }
.btn-action-view { background: #2563eb; }
.btn-action-view:hover { background: #1d4ed8; color: #fff; }
.btn-action-edit { background: #16a34a; }
.btn-action-edit:hover { background: #15803d; color: #fff; }
.btn-action-delete { background: var(--red); }
.btn-action-delete:hover { background: #b91c1c; color: #fff; }
.badge-success { background: rgba(22,163,74,0.2); color: #15803d; }
.badge-secondary { background: rgba(107,114,128,0.2); color: #374151; }
.badge-danger { background: rgba(239,68,68,0.2); color: #b91c1c; }
.badge-info { background: rgba(56,189,248,0.2); color: #0284c7; }

/* ========== Register New Student ========== */
.register-student-wrap {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
/* Add New Teacher page */
.register-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.register-teacher-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.register-teacher-card .register-student-section-grid { margin-bottom: 0; }
.btn-teacher-icon { display: inline-flex; align-items: center; margin-right: 0.35rem; }

.register-student-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--green);
    color: #fff;
    border-radius: 8px 8px 0 0;
}
.register-student-header-icon { display: flex; align-items: center; justify-content: center; }
.register-student-header-icon svg { flex-shrink: 0; }
.register-student-header-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.register-student-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
}
.register-student-form .alert { margin-bottom: 0.75rem; }
.register-student-section { margin-bottom: 1rem; }
.register-student-section:last-of-type { margin-bottom: 0; }
.register-student-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blue);
}
.register-student-section-icon { display: flex; align-items: center; color: var(--blue); }
.register-student-section-icon svg { flex-shrink: 0; width: 18px; height: 18px; }
.register-student-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
}
@media (max-width: 600px) { .register-student-section-grid { grid-template-columns: 1fr; } }
.register-student-form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.register-student-form-group.full { grid-column: 1 / -1; }
.register-student-form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.register-student-form-group input,
.register-student-form-group select,
.register-student-form-group textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card-bg);
    max-width: 100%;
    box-sizing: border-box;
}
.register-student-form-group input:focus,
.register-student-form-group select:focus,
.register-student-form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.register-student-form-group input.input-readonly {
    background: var(--main-bg);
    color: var(--text-muted);
    cursor: default;
}
.register-student-form-group textarea { resize: vertical; min-height: 60px; max-height: 120px; }
.register-student-next-id { display: block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--text-muted); }
.register-student-next-id strong { color: var(--text); font-weight: 600; }
.register-student-info-icon { margin-left: 0.25rem; font-size: 0.85rem; opacity: 0.8; cursor: help; }
.register-student-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.btn-register-student {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-register-student:hover { background: #1d4ed8; color: #fff; }
.btn-register-student-icon { display: flex; align-items: center; }
.btn-register-student-icon svg { flex-shrink: 0; width: 18px; height: 18px; }

/* ========== Alumni Students ========== */
.alumni-page { max-width: 100%; }
.alumni-page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.alumni-page-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.alumni-page-subtitle { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.btn-alumni-add {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}
.btn-alumni-add:hover { background: #1d4ed8; color: #fff; }
.alumni-school-filter { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.alumni-school-filter select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); }
.alumni-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.alumni-card-title { margin: 0 0 0.35rem; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.alumni-card-desc { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.alumni-mark-form { margin: 0; }
.alumni-mark-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.alumni-mark-field { display: flex; flex-direction: column; gap: 0.3rem; }
.alumni-mark-field label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.alumni-mark-field select,
.alumni-mark-field input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 180px;
}
.alumni-mark-identifier { flex: 1; min-width: 200px; }
.alumni-mark-identifier input { min-width: 100%; }
.alumni-mark-actions { flex-shrink: 0; }
.btn-alumni-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-alumni-mark:hover { background: #15803d; color: #fff; }
.btn-alumni-mark-icon { font-size: 1.1rem; }
.alumni-list-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.alumni-list-header-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.alumni-list-filters { margin-top: 1.25rem; margin-bottom: 1.5rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.alumni-table-wrap { margin-top: 0.5rem; }
.alumni-export { display: flex; gap: 0.5rem; flex-shrink: 0; }
.alumni-export .btn-export { padding: 0.4rem 0.75rem; font-size: 0.875rem; text-decoration: none; border-radius: 6px; font-weight: 500; }
.alumni-export .btn-export-excel { background: #16a34a; color: #fff; border: 1px solid #16a34a; }
.alumni-export .btn-export-excel:hover { background: #15803d; color: #fff; }
.alumni-export .btn-export-pdf { background: #1e40af; color: #fff; border: 1px solid #1e40af; }
.alumni-export .btn-export-pdf:hover { background: #1e3a8a; color: #fff; }
.alumni-create-wrap { max-width: 100%; width: 100%; box-sizing: border-box; }
.alumni-create-intro { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.alumni-create-section { margin-bottom: 1.5rem; padding: 1.25rem 1.5rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.alumni-create-section-title { margin: 0 0 0.35rem; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.alumni-create-section-desc { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.alumni-create-form .register-student-section-grid { margin-top: 0.5rem; }
@media (min-width: 900px) {
    .alumni-create-form .register-student-section-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
    .alumni-create-form .register-student-section-grid { grid-template-columns: repeat(4, 1fr); }
}
.teachers-list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.teachers-list-table thead tr { background: var(--green); color: #fff; }
.teachers-list-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.teachers-list-table tbody tr:nth-child(even) { background: #f8fafc; }
.teachers-list-table tbody tr:nth-child(odd) { background: #fff; }
.teachers-list-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.teacher-assignments-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.teacher-assignments-table thead tr { background: var(--green); color: #fff; }
.teacher-assignments-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.teacher-assignments-table tbody tr:nth-child(even) { background: #f8fafc; }
.teacher-assignments-table tbody tr:nth-child(odd) { background: #fff; }
.teacher-assignments-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.classes-list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.classes-list-table thead tr { background: var(--green); color: #fff; }
.classes-list-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.classes-list-table tbody tr:nth-child(even) { background: #f8fafc; }
.classes-list-table tbody tr:nth-child(odd) { background: #fff; }
.classes-list-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }

/* Classes page: card grid layout */
.classes-page { max-width: 100%; }
.classes-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.classes-page-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.classes-page-total { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.class-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.class-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.class-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2196F3;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.class-card-icon svg { width: 26px; height: 26px; }
.class-card-name { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.class-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem; color: var(--text);
}
.class-card-stats strong { color: var(--text); }
.class-card-exam { font-size: 0.9rem; color: var(--text-muted); }
.class-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}
.class-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.class-card-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.class-card-btn-view { background: #2196F3; color: #fff; }
.class-card-btn-view:hover { background: #1976D2; color: #fff; }
.class-card-btn-exams { background: var(--green); color: #fff; }
.class-card-btn-exams:hover { background: #15803d; color: #fff; }

.subjects-list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.subjects-list-table thead tr { background: var(--green); color: #fff; }
.subjects-list-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.subjects-list-table tbody tr:nth-child(even) { background: #f8fafc; }
.subjects-list-table tbody tr:nth-child(odd) { background: #fff; }
.subjects-list-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.exam-pending-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.exam-pending-table thead tr { background: var(--green); color: #fff; }
.exam-pending-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.exam-pending-table tbody tr:nth-child(even) { background: #f8fafc; }
.exam-pending-table tbody tr:nth-child(odd) { background: #fff; }
.exam-pending-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.exam-pending-class-group { margin-bottom: 1.5rem; }
.exam-pending-class-group:last-child { margin-bottom: 0; }
.exam-pending-class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}
.exam-pending-approve-all { margin-bottom: 1rem; }
.users-list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.users-list-table thead tr { background: var(--green); color: #fff; }
.users-list-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.users-list-table tbody tr:nth-child(even) { background: #f8fafc; }
.users-list-table tbody tr:nth-child(odd) { background: #fff; }
.users-list-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.parents-list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.parents-list-table thead tr { background: var(--green); color: #fff; }
.parents-list-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border: none; }
.parents-list-table tbody tr:nth-child(even) { background: #f8fafc; }
.parents-list-table tbody tr:nth-child(odd) { background: #fff; }
.parents-list-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.parents-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1rem; }
.parents-filter-form label { font-size: 0.9rem; color: var(--text-muted); margin-right: 0.25rem; }
.parents-filter-form input[type="text"],
.parents-filter-form select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; min-width: 140px; }
.teachers-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.teachers-export { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.teachers-export .btn-export { padding: 0.4rem 0.75rem; font-size: 0.875rem; text-decoration: none; border-radius: 6px; font-weight: 500; }
.teachers-export .btn-export-excel { background: #16a34a; color: #fff; border: 1px solid #16a34a; }
.teachers-export .btn-export-excel:hover { background: #15803d; color: #fff; }
.teachers-export .btn-export-pdf { background: #1e40af; color: #fff; border: 1px solid #1e40af; }
.teachers-export .btn-export-pdf:hover { background: #1e3a8a; color: #fff; }
.teachers-export .btn-export-word { background: #2563eb; color: #fff; border: 1px solid #2563eb; }
.teachers-export .btn-export-word:hover { background: #1d4ed8; color: #fff; }
.teachers-export .btn-export-print { background: #dc2626; color: #fff; border: 1px solid #dc2626; }
.teachers-export .btn-export-print:hover { background: #b91c1c; color: #fff; }
.card--students .students-mgmt-table-wrap { border: none; background: transparent; border-radius: 0; box-shadow: none; margin-top: 0.5rem; }
.card--alumni .alumni-table-wrap { border: none; background: transparent; border-radius: 0; box-shadow: none; margin-top: 0; }
.card--alumni .alumni-list-header { margin-top: 0.5rem; }
.card--classes .dashboard-title { display: flex; align-items: center; gap: 0.5rem; }
.card--classes .dashboard-title-icon { display: inline-flex; flex-shrink: 0; width: 1.5rem; height: 1.5rem; color: var(--text); }
.card--classes .dashboard-title-icon svg { width: 100%; height: 100%; }
.card--classes .classes-table-wrap { border: none; background: transparent; border-radius: 0; box-shadow: none; margin-top: 0.5rem; }
.classes-students-link { color: #2563eb; text-decoration: underline; font-weight: 500; }
.classes-students-link:hover { color: #1d4ed8; }
.alumni-list-note { font-size: 0.85rem; color: var(--text-muted); }
.alumni-table-wrap { overflow-x: auto; }
.alumni-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.alumni-table thead tr { background: var(--green); color: #fff; }
.alumni-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; font-size: 0.85rem; }
.alumni-table tbody tr:nth-child(even) { background: #f8fafc; }
.alumni-table tbody tr:nth-child(odd) { background: #fff; }
.alumni-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.alumni-empty { color: var(--text-muted); font-style: italic; text-align: center; padding: 1.5rem !important; }

/* ========== Students List Page (same design as reference) ========== */
.students-page { max-width: 100%; }
.students-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.students-page-header-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.students-page-header-icon svg { width: 100%; height: 100%; }
.students-page-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.students-page-header-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.students-filter-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.students-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}
.students-filter-group { display: flex; flex-direction: column; gap: 0.35rem; }
.students-filter-group label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.students-filter-group select,
.students-filter-group input[type="text"],
.students-filter-group input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card-bg);
    min-width: 180px;
}
.students-search-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.students-search-row input[type="text"] { min-width: 220px; }
.students-filter-btn { padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 0.9rem; cursor: pointer; }
.students-filter-btn:hover { background: var(--main-bg); }
.students-filter-btn-search { display: inline-flex; align-items: center; justify-content: center; }
.students-content-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Bulk Other Charges page */
.card--bulk-charges .bulk-charges-intro { margin-bottom: 1rem; max-width: 56em; line-height: 1.5; }
.bulk-charges-filter-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card--bulk-charges .bulk-charges-filters.students-filter-form { gap: 1rem 1.25rem; align-items: flex-end; }
.card--bulk-charges .bulk-charges-filters .students-filter-group select,
.card--bulk-charges .bulk-charges-filters .students-filter-group input.form-control,
.card--bulk-charges .bulk-charges-filters .students-filter-group input[type="text"],
.card--bulk-charges .bulk-charges-filters .students-filter-group input[type="number"],
.card--bulk-charges .bulk-charges-filters .students-filter-group input[type="date"] {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    min-width: 160px;
}
.bulk-charges-no-exams {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}
.bulk-charges-summary {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.bulk-charges-summary strong { color: #166534; }
.bulk-charges-apply-cell .btn { min-height: 40px; padding: 0.5rem 1.25rem; font-weight: 600; }

.students-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.students-empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    color: var(--text-muted);
    opacity: 0.7;
}
.students-empty-state-icon svg { width: 100%; height: 100%; }
.students-empty-state h3 { margin: 0 0 0.35rem; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.students-empty-state p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ========== Classes Page (table with Teachers column) ========== */
.classes-page { max-width: 100%; }
.classes-teachers-cell { display: flex; flex-direction: column; gap: 0.25rem; max-width: 220px; }
.classes-teachers-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--card-bg);
    min-height: 32px;
}
.classes-teachers-hint { font-size: 0.75rem; color: var(--text-muted); }
.classes-manage-link { font-size: 0.85rem; color: var(--blue); }
.classes-manage-link:hover { text-decoration: underline; }
.classes-actions-cell { white-space: nowrap; }
.classes-actions-cell .btn-icon { vertical-align: middle; }
.classes-actions-cell .btn-icon-edit { background: #1d4ed8 !important; color: #fff !important; }
.classes-actions-cell .btn-icon-view { background: #0f766e !important; color: #fff !important; }
.classes-actions-cell .btn-icon-edit svg,
.classes-actions-cell .btn-icon-view svg { fill: #fff !important; stroke: #fff !important; }

/* ========== Search Students (Passwords) ========== */
.search-students-page { max-width: 100%; }
.search-students-title { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.search-students-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.search-students-input {
    flex: 1;
    min-width: 220px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
}
.search-students-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.btn-search-students {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-search-students:hover { background: #1d4ed8; color: #fff; }
.btn-search-students-icon { font-size: 1.1rem; }
.search-students-school-filter { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.search-students-school-filter select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); }
.search-students-empty-row td { border-bottom: none; vertical-align: middle; }
.search-students-empty-cell {
    background: #fff !important;
    padding: 0;
    border-bottom: 1px solid var(--border);
}
.search-students-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 2rem;
    background: #fff;
    text-align: center;
}
.search-students-empty-icon { font-size: 4rem; opacity: 0.4; margin-bottom: 1rem; color: #6b7280; }
.search-students-empty-title { margin: 0 0 0.35rem; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.search-students-empty-desc { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.search-students-table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* Allow horizontal scroll on mobile so Reset Password column stays visible */
.search-students-table-wrap.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
/* Check Passwords: class filter, info box, password cell, View button */
.check-passwords-page .check-passwords-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.check-passwords-class-form { margin-bottom: 1rem; }
.check-passwords-class-label { margin-right: 0.5rem; font-weight: 500; color: var(--text); }
.check-passwords-class-select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; min-width: 180px; background: var(--card-bg); }
.check-passwords-info {
    background: #f0f9ff;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    margin-top: 1rem;
}
.check-passwords-info p { margin: 0; color: #666; font-size: 1rem; }
.check-passwords-count { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text); }
.check-passwords-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.check-passwords-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.check-passwords-table thead tr { background: var(--green); color: #fff; }
.check-passwords-table thead th { padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; border: 1px solid rgba(0,0,0,0.1); }
.check-passwords-table tbody td { padding: 0.6rem 0.75rem; border: 1px solid var(--border); }
.check-pw-value { font-family: monospace; margin-right: 0.5rem; }
.btn-view-pw {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn-view-pw:hover { background: #1d4ed8; color: #fff; }
.check-passwords-reset-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.check-passwords-new-pw {
    min-width: 120px;
    max-width: 160px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.search-students-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.search-students-table thead tr { background: var(--green); color: #fff; }
.search-students-table thead th { background: var(--green); color: #fff; padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; font-size: 0.85rem; border-bottom: 1px solid #374151; }
.search-students-table tbody tr:nth-child(even) { background: #f8fafc; }
.search-students-table tbody tr:nth-child(odd) { background: #fff; }
.search-students-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.search-students-password-cell { white-space: nowrap; }
.search-students-reset-form { display: inline-flex; align-items: center; gap: 0.35rem; }
.search-students-password-input {
    width: 120px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}
.btn-reset-password {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-reset-password:hover { background: #15803d; color: #fff; }

/* ========== WhatsApp Message Sender ========== */
.wa-class-form { margin-bottom: 0.5rem; }
.wa-form { margin-top: 1rem; }
.wa-form .register-student-form-group .wa-textarea {
    min-height: 120px;
    resize: vertical;
}
.wa-char-count { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.wa-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .wa-columns { grid-template-columns: 1fr; gap: 1rem; }
    .wa-form .register-student-form-group .wa-multi { min-height: 100px; }
    .wa-form-card { padding-bottom: 3rem; }
    .wa-form-submit-wrap { margin-bottom: 1.5rem; }
    .wa-form-submit-wrap .btn { width: 100%; max-width: 100%; }
}
.wa-col { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.wa-hint { margin: 0.25rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.wa-form .register-student-form-group .wa-multi {
    min-width: 0;
    min-height: 160px;
    padding: 0.4rem 0.6rem;
    width: 100%;
}
.wa-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.wa-form-submit-wrap {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}
.wa-btn-tpl { background: #0ea5e9; color: #fff; }
.wa-btn-tpl:hover { background: #0284c7; color: #fff; }
.wa-btn-tpl-yellow { background: #eab308; color: #1c1917; }
.wa-btn-tpl-yellow:hover { background: #ca8a04; color: #1c1917; }
.wa-btn-tpl-blue { background: #2563eb; color: #fff; }
.wa-btn-tpl-blue:hover { background: #1d4ed8; color: #fff; }
.wa-kpi-wrap { margin-top: 1.5rem; }
/* WhatsApp / Admission responsive: school filter and KPIs */
.alumni-school-filter--responsive {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.alumni-school-filter--responsive .alumni-school-filter__label { margin: 0; }
@media (max-width: 576px) {
    .alumni-school-filter--responsive { width: 100%; }
    .alumni-school-filter--responsive select { flex: 1; min-width: 0; }
}

.admission-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .admission-charts-row { grid-template-columns: 1fr; } }
.admission-chart-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.admission-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #374151;
    color: #fff;
}
.admission-panel-header h3 { margin: 0; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.02em; }
.admission-panel-actions { display: flex; gap: 0.25rem; }
.admission-panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: default;
    font-size: 0.9rem;
    opacity: 0.9;
}
.admission-panel-btn:hover { background: rgba(255,255,255,0.15); }

.admission-bar-chart-wrap {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    min-height: 220px;
}
.admission-bar-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.admission-bar-chart {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem 1rem;
    padding-bottom: 1.5rem;
}
.admission-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}
.admission-bar {
    width: 100%;
    max-width: 48px;
    min-height: 4px;
    background: #2563eb;
    border-radius: 4px 4px 0 0;
    transition: height 0.2s ease;
}
.admission-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}
.admission-enrollment-panel .admission-table-wrap { padding: 0 1rem 1rem; max-height: 400px; overflow-y: auto; }
.admission-enrollment-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admission-enrollment-table thead tr { background: var(--green); color: #fff; }
.admission-enrollment-table thead th { padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; font-size: 0.85rem; }
.admission-enrollment-table tbody tr:nth-child(even) { background: #f8fafc; }
.admission-enrollment-table tbody tr:nth-child(odd) { background: #fff; }
.admission-enrollment-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }

/* Promotion (end of year) */
/* Create Exam Scheme page */
.exam-scheme-create { max-width: 720px; }
.exam-scheme-create-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.exam-scheme-create-heading { flex: 1; min-width: 0; }
.exam-scheme-create-back { flex-shrink: 0; }
.card--exam-scheme-form {
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-top: 3px solid var(--green);
}
.exam-scheme-form { display: flex; flex-direction: column; gap: 0; }
.exam-scheme-form-row { margin-bottom: 1.25rem; }
.exam-scheme-form-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.exam-scheme-form-section--last { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.exam-scheme-form-section-title {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.exam-scheme-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}
@media (max-width: 600px) {
    .exam-scheme-form-grid { grid-template-columns: 1fr; }
    .card--exam-scheme-form { padding: 1.25rem 1.25rem; }
}
.exam-scheme-field { display: flex; flex-direction: column; gap: 0.4rem; }
.exam-scheme-field label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.exam-scheme-field input[type="text"],
.exam-scheme-field input[type="number"],
.exam-scheme-field select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.exam-scheme-field input:focus,
.exam-scheme-field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.exam-scheme-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.15rem;
}
.exam-scheme-field--checkbox { margin-bottom: 1rem; }
.exam-scheme-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}
.exam-scheme-checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--green);
    cursor: pointer;
}
.exam-scheme-form-actions { margin-top: 0.5rem; }
.exam-scheme-form-actions .btn--create-scheme {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

.promotion-page { max-width: 100%; width: 100%; box-sizing: border-box; }
.promotion-header { margin-bottom: 1.5rem; }
.promotion-title { margin: 0 0 0.35rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.promotion-subtitle { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.promotion-section { margin-bottom: 1.5rem; }
.promotion-section h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.promotion-hint { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); }
.promotion-form .form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.promotion-page .card { width: 100%; }
.promotion-form .form-row label { margin-right: 0.35rem; }
.promotion-form .form-row input[type="text"],
.promotion-form .form-row input[type="date"],
.promotion-form .form-row select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
.promotion-school-filter { margin-bottom: 1rem; }
.promotion-school-filter select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
.btn-promote { font-weight: 600; }
.promotion-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.promotion-table th, .promotion-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.promotion-table thead th { background: var(--green); color: #fff; }
.promotion-errors { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.promotion-errors ul { margin: 0.25rem 0 0 1.25rem; }
.report-table td select.promotion-result-select,
.report-table td .promotion-result-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--card-bg);
    min-width: 100px;
}

/* ========== Other Charges Modal ========== */
.other-charges-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.other-charges-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    cursor: pointer;
}
.other-charges-modal-content {
    position: relative;
    margin: auto;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.other-charges-modal-title {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}
.other-charges-form .form-group {
    margin-bottom: 1rem;
}
.other-charges-form .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.9rem;
}
.other-charges-form .form-error,
.other-charges-form .alert {
    font-size: 0.85rem;
    color: #b91c1c;
}
.other-charges-select,
.other-charges-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg);
}
.other-charges-form textarea.other-charges-input {
    min-height: 60px;
    resize: vertical;
}
.other-charges-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.other-charges-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #166534;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    font-weight: 500;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.other-charges-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========== Results / Grades Page ========== */
.results-grades-card .results-exam-select { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.results-exam-label { display: block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.25rem; font-weight: 500; }
.results-exam-select-input { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; min-width: 220px; background: var(--card-bg); }
.results-exam-heading { font-size: 1.05rem; color: var(--text); margin-bottom: 1rem; font-weight: 600; }
.results-section { margin-bottom: 2rem; }
.results-section-title { font-size: 1.15rem; margin-bottom: 0.75rem; color: var(--text); border-bottom: 2px solid var(--sidebar-green); padding-bottom: 0.35rem; }
.results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
.results-table, .results-class-table { width: 100%; border-collapse: collapse; min-width: 280px; }
.results-table th, .results-table td, .results-class-table th, .results-class-table td { padding: 0.6rem 0.75rem; text-align: left; border: 1px solid var(--border); }
.results-class-table th, .results-class-table td { text-align: center; }
.results-class-table th:first-child, .results-class-table td:first-child { text-align: center; width: 56px; }
.results-class-table th:nth-child(2), .results-class-table td:nth-child(2) { text-align: left; }
.results-summary { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 1rem; margin-top: 0.75rem; }
.results-summary span { white-space: nowrap; }

/* Highlight logged-in student in class table */
.results-row-me {
    background-color: #e8f5e9 !important;
    border-left: 4px solid #16a34a !important;
    font-weight: bold;
}
.results-rank-cell { font-weight: 600; }

/* Top 3 row styles and spacing */
.results-rank-1 { background: #fff8e1 !important; font-weight: bold; }
.results-rank-2 { background: #f1f1f1 !important; }
.results-rank-3 { background: #fff3e0 !important; }
.results-class-table tbody tr { margin-bottom: 8px; }
.results-class-table tbody tr td { vertical-align: middle; }

.results-management-filters .results-filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.results-management-filters .results-filter-group { display: flex; flex-direction: column; }
.results-management-filters .results-filter-actions { justify-content: flex-end; }

@media (max-width: 767.98px) {
    .results-table-wrap { margin-left: -0.5rem; margin-right: -0.5rem; }
    .results-table, .results-class-table { font-size: 0.875rem; }
    .results-table th, .results-table td, .results-class-table th, .results-class-table td { padding: 0.5rem 0.4rem; }
}
