/*
==================================================
        GLOBAL RESET & TYPOGRAPHY CONFIG
==================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Tiro+Bangla:ital@0;1&display=swap');

:root {
    --primary: #1B5E20;
    --primary-dark: #0D3311;
    --primary-light: #2E7D32;
    --primary-surface: #E8F5E9;
    --accent: #D97706;
    --accent-light: #FEF3C7;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --success: #059669;
    --success-light: #D1FAE5;
    --info: #2563EB;
    --info-light: #DBEAFE;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;

    --bg-main: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-surface: #F8FAFC;
    --border-color: #E2E8F0;
    --text-primary: #0F172A;
    --text-main: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --primary: #4ADE80;
    --primary-dark: #22C55E;
    --primary-light: #86EFAC;
    --primary-surface: rgba(74, 222, 128, 0.15);
    --bg-main: #0B1120;
    --bg-card: #1E293B;
    --bg-card-hover: #26354D;
    --bg-surface: #0F172A;
    --border-color: #334155;
    --text-primary: #F8FAFC;
    --text-main: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --accent: #FBBF24;
    --accent-light: rgba(245, 158, 11, 0.18);
    --danger: #F87171;
    --danger-light: rgba(239, 68, 68, 0.2);
    --success: #4ADE80;
    --success-light: rgba(34, 197, 94, 0.18);
    --info: #60A5FA;
    --info-light: rgba(59, 130, 246, 0.2);
    --purple: #C084FC;
    --purple-light: rgba(168, 85, 247, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/*
==================================================
      GLOBAL SCROLLBAR ELIMINATION PROTOCOL
==================================================
*/

/* Hide scrollbar for Chrome, Safari, Edge, Opera & Android WebView */
*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* Hide scrollbar for IE, legacy Edge and Firefox */
*,
html,
body {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    overscroll-behavior-y: none;
    overscroll-behavior: none;
}

body {
    font-family: 'Tiro Bangla', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    overscroll-behavior: none;
}

/*
==================================================
        STRICT SINGLE-LINE BUTTON PROTOCOL
==================================================
*/

button, 
.btn, 
.nav-btn, 
.action-btn, 
.badge, 
.tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(27, 94, 32, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #166534 0%, #15803D 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #22C55E !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #15803D 0%, #16a34a 100%) !important;
    color: #FFFFFF !important;
    border-color: #4ADE80 !important;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #F59E0B 100%);
    color: #FFFFFF;
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #FFFFFF;
}

.btn-success {
    background: var(--success);
    color: #FFFFFF;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

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

/*
==================================================
        TOP GREEN APP HEADER (SCREENSHOT MATCH)
==================================================
*/

.app-header-green {
    background-color: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-container-green {
    max-width: 1280px;
    margin: 0 auto;
    height: 58px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-icon-btn {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.14s ease, transform 0.12s ease;
    padding: 0;
}

.header-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.header-icon-btn:active {
    transform: scale(0.92);
}

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

/* BANGLADESH FLAG & BANGLA DROPDOWN PILL */
.lang-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 5px 12px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.14s ease, transform 0.1s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.lang-pill-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.lang-pill-btn:active {
    transform: scale(0.95);
}

.bd-flag-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #006A4E;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bd-flag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #F42A41;
}

.uk-flag-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: #012169;
}

.lang-text {
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.lang-arrow {
    color: rgba(255, 255, 255, 0.85);
    font-size: 8.5px;
    margin-left: 1px;
}

/*
==================================================
        BILINGUAL I18N TYPOGRAPHY CONTROL
==================================================
*/

body[data-lang="en"] {
    font-family: 'Inter', 'Tiro Bangla', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Strict Tiro Bangla font lock for institute identity & hero sections across all languages */
.institute-hero-block,
.institute-name,
.institute-subtitle,
.service-section-title,
.service-section-row,
.drawer-brand-title,
.drawer-subtitle,
#dashboard-institute-name,
#dashboard-institute-sub,
#guardian-institute-name,
#guardian-institute-sub,
body[data-lang="en"] .institute-hero-block,
body[data-lang="en"] .institute-name,
body[data-lang="en"] .institute-subtitle,
body[data-lang="en"] .service-section-title,
body[data-lang="en"] .service-section-row,
body[data-lang="en"] .drawer-brand-title,
body[data-lang="en"] .drawer-subtitle,
body[data-lang="en"] #dashboard-institute-name,
body[data-lang="en"] #dashboard-institute-sub,
body[data-lang="en"] #guardian-institute-name,
body[data-lang="en"] #guardian-institute-sub {
    font-family: 'Tiro Bangla', 'Kalpurush', serif !important;
}

/*
==================================================
        PULL TO REFRESH (CHROME STYLE HOT-RELOAD)
==================================================
*/

.ptr-indicator {
    position: fixed;
    top: -55px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.85);
    z-index: 1040;
    pointer-events: none;
    will-change: transform, opacity;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: transform 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.14s ease;
}

.ptr-indicator.pulling {
    transition: none;
}

.ptr-indicator.refreshing {
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.14s ease;
    transform: translate(-50%, 128px) scale(1) !important;
    opacity: 1 !important;
}

.ptr-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    color: var(--primary, #1B5E20);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}

.ptr-arrow-icon {
    display: block;
    color: var(--primary, #1B5E20);
    transform-origin: center center;
    transition: color 0.15s ease;
}

.ptr-indicator.ready .ptr-arrow-icon {
    color: var(--accent, #D97706);
}

.ptr-spinner {
    display: none;
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.8px solid rgba(27, 94, 32, 0.18);
    border-top-color: var(--primary, #1B5E20);
    border-radius: 50%;
    animation: ptr-spin 0.7s linear infinite;
}

[data-theme="dark"] .ptr-circle {
    background-color: var(--bg-card, #1E293B);
    border-color: var(--border-color, #334155);
    color: #4ADE80;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .ptr-arrow-icon {
    color: #4ADE80;
}

[data-theme="dark"] .ptr-indicator.ready .ptr-arrow-icon {
    color: #FBBF24;
}

[data-theme="dark"] .ptr-spinner {
    border-color: rgba(74, 222, 128, 0.2);
    border-top-color: #4ADE80;
}

.ptr-indicator.refreshing .ptr-arrow-icon {
    display: none;
}

.ptr-indicator.refreshing .ptr-spinner {
    display: block;
}

@keyframes ptr-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/*
==================================================
        SIDE NAVIGATION DRAWER & BACKDROP
==================================================
*/

.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition: opacity 0.15s cubic-bezier(0, 0, 0.2, 1), visibility 0.15s cubic-bezier(0, 0, 0.2, 1);
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    max-width: 82vw;
    height: 100vh;
    background: var(--bg-card);
    z-index: 1100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    transform: translate3d(-100%, 0, 0);
    -webkit-transform: translate3d(-100%, 0, 0);
    transition: transform 0.16s cubic-bezier(0, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    contain: layout paint;
}

.side-drawer.active {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.drawer-header {
    background: var(--primary);
    color: #FFFFFF;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-logo {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawer-title {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    white-space: nowrap;
}

.drawer-subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    white-space: nowrap;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    white-space: nowrap;
    touch-action: manipulation;
    transition: background 0.15s ease, transform 0.1s ease;
}

.drawer-close-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.15);
}

.drawer-menu {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    contain: content;
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.drawer-menu-item:hover {
    background: var(--primary-surface);
    color: var(--primary);
}

.drawer-menu-item:active {
    transform: scale(0.98);
    background: var(--primary-surface);
}

.drawer-menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/*
==================================================
           MAIN CONTENT CONTAINER SETUP
==================================================
*/

.main-content {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 14px;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

/*
==================================================
        INSTITUTE HERO TITLE & SUBTITLE BLOCK
==================================================
*/

.dashboard-hero-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.institute-hero-block {
    margin-bottom: 12px;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.institute-name {
    font-size: clamp(15px, 4.8vw, 21px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
    text-align: center;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.institute-subtitle {
    font-size: clamp(11.5px, 3.2vw, 13px);
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
    max-width: 100%;
}

.hero-pipe-divider {
    color: #CBD5E1;
    font-weight: 300;
}

/*
==================================================
              SERVICE SECTION TITLE
==================================================
*/

.service-section-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
}

.service-section-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: center;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 20px;
    background: var(--bg-card);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.2px;
}

[data-theme="dark"] .service-section-title {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/*
==================================================
      VERTICAL USER ROLE BADGE (SCREENSHOT MATCH)
==================================================
*/

.user-role-vertical-badge {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    min-height: 78px;
    max-height: 98px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.2s ease,
                border-color 0.2s ease;
}

.user-role-vertical-badge:hover {
    transform: translateY(-50%) scale(1.04);
}

.user-role-vertical-badge:active {
    transform: translateY(-50%) scale(0.96);
}

.role-vertical-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: 0.95;
    box-shadow: 0 0 5px currentColor;
}

.role-vertical-badge-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap !important;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1;
    display: inline-block;
    color: inherit;
    font-family: 'Tiro Bangla', 'Inter', sans-serif;
}

/* Role Modifier - Authority (কর্তৃপক্ষ: মুহতামিম / অপারেটর / প্রতিষ্ঠান এডমিন) */
.user-role-vertical-badge.role-authority {
    background: rgba(27, 94, 32, 0.08);
    border: 1.5px solid rgba(27, 94, 32, 0.32);
    color: #1B5E20;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.1);
}

[data-theme="dark"] .user-role-vertical-badge.role-authority {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.45);
    color: #4ADE80;
    box-shadow: 0 2px 10px rgba(74, 222, 128, 0.2);
}

/* Role Modifier - Super Admin (সুপার এডমিন: মাস্টার কন্ট্রোল হাব) */
.user-role-vertical-badge.role-super-admin {
    background: rgba(254, 243, 199, 0.7);
    border: 1.5px solid rgba(217, 119, 6, 0.4);
    color: #B45309;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.14);
}

[data-theme="dark"] .user-role-vertical-badge.role-super-admin {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.5);
    color: #FBBF24;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

/* Role Modifier - Teacher (শিক্ষক) */
.user-role-vertical-badge.role-teacher {
    background: rgba(219, 234, 254, 0.7);
    border: 1.5px solid rgba(37, 99, 235, 0.38);
    color: #1D4ED8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .user-role-vertical-badge.role-teacher {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.45);
    color: #60A5FA;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.22);
}

/* Role Modifier - Guardian (অভিভাবক) */
.user-role-vertical-badge.role-guardian {
    background: rgba(237, 233, 254, 0.7);
    border: 1.5px solid rgba(124, 58, 237, 0.38);
    color: #6D28D9;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] .user-role-vertical-badge.role-guardian {
    background: rgba(192, 132, 252, 0.15);
    border-color: rgba(192, 132, 252, 0.45);
    color: #C084FC;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.22);
}



/*
==================================================
        3-COLUMN SERVICES GRID (SCREENSHOT MATCH)
==================================================
*/

.services-3col-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 360px) {
    .services-3col-grid {
        gap: 8px;
    }
}

/* INDIVIDUAL SERVICE CARD */
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 6px 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.14s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.14s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.14s ease;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    touch-action: manipulation;
    min-height: 112px;
}

.service-card * {
    pointer-events: none;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-light);
}

.service-card:active {
    transform: scale(0.96);
}

/* ICON SQUIRCLE BOX */
.service-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.service-card:hover .service-icon-box {
    transform: scale(1.05);
}

.service-icon-box svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* CARD TITLE */
.service-card-title {
    margin-top: 9px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
    display: block;
    letter-spacing: 0.1px;
}

@media (max-width: 360px) {
    .service-card-title {
        font-size: 12px;
        margin-top: 7px;
    }
    .service-icon-box {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .service-icon-box svg {
        width: 24px;
        height: 24px;
    }
}



/*
==================================================
           VIEW PANELS & MODAL WINDOWS
==================================================
*/

.view-panel {
    display: none;
    animation: fadeIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.view-panel.active {
    display: block;
}

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

/*
==================================================
              PANEL HEADERS & TITLE
==================================================
*/

.panel-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    text-align: center;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    transform: none !important;
}

.panel-header-bar:active,
.panel-header-bar:focus {
    transform: none !important;
}

/* Header bars with action buttons (Super Admin Hub) */
.panel-header-bar:has(.panel-actions),
#view-superadmin .panel-header-bar {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    text-align: left;
    cursor: default;
}

.panel-header-bar:has(.panel-actions):active,
#view-superadmin .panel-header-bar:active {
    transform: none !important;
}

.panel-title-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    gap: 4px;
    min-width: 0;
    touch-action: manipulation;
    transform: none !important;
}

.panel-title-area:active,
.panel-title-area:focus {
    transform: none !important;
}

.panel-header-bar:has(.panel-actions) .panel-title-area,
#view-superadmin .panel-header-bar .panel-title-area {
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    width: auto;
    flex: 1 1 240px;
}

.panel-title {
    font-size: clamp(16px, 4.2vw, 21px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
    letter-spacing: -0.2px;
}

.panel-subtitle {
    font-size: clamp(12px, 3.2vw, 13.5px);
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    font-weight: 400;
}

.panel-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.section-heading {
    font-size: clamp(16px, 4.4vw, 22px);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap !important;
    text-overflow: ellipsis;
    overflow: hidden;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.2px;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    touch-action: manipulation;
    transform: none !important;
}

.section-heading:active,
.section-heading:focus {
    transform: none !important;
}

.back-home-btn {
    display: none !important;
}

@media (max-width: 640px) {
    .panel-header-bar {
        margin-bottom: 12px;
        padding: 12px 14px;
    }

    .panel-header-bar:has(.panel-actions),
    #view-superadmin .panel-header-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 14px;
        padding: 16px 14px;
    }

    .panel-header-bar:has(.panel-actions) .panel-title-area,
    #view-superadmin .panel-header-bar .panel-title-area {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .panel-header-bar:has(.panel-actions) .panel-actions,
    #view-superadmin .panel-header-bar .panel-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .panel-header-bar:has(.panel-actions) .sa-add-inst-btn,
    #view-superadmin .sa-add-inst-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/*
==================================================
             FORM CONTROLS & TABLES
==================================================
*/

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

/*
==================================================
           CARD SECTION HEADER STYLES
==================================================
*/

.card-section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary, #1B5E20);
    padding: 2px 10px;
    border-left: 4px solid var(--primary, #1B5E20);
    line-height: 1.35;
    letter-spacing: -0.2px;
    transition: color 0.18s ease, border-left-color 0.18s ease;
}

[data-theme="dark"] .card-section-title {
    color: #4ADE80;
    border-left-color: #4ADE80;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-section-title-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16.5px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(27, 94, 32, 0.08);
    color: var(--primary, #1B5E20);
    border: 1px solid rgba(27, 94, 32, 0.18);
    margin-bottom: 18px;
    line-height: 1.35;
    transition: all 0.18s ease;
}

[data-theme="dark"] .card-section-title-pill {
    background: rgba(74, 222, 128, 0.12);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}


.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 992px) {
    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-grid-2, .form-grid-3, .form-grid-4 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

select.form-control {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

.form-control:disabled,
select.form-control:disabled {
    background-color: var(--bg-surface-elevated, var(--bg-surface, #f1f5f9));
    color: var(--text-muted, #94a3b8);
    cursor: not-allowed;
    opacity: 0.75;
    border-color: var(--border-color);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-surface);
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.custom-table th {
    background: var(--bg-main);
    padding: 12px 14px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tr:hover {
    background: var(--bg-card-hover);
}

/*
==================================================
         VERTICAL STUDENTS REGISTER LIST
==================================================
*/

.students-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.student-vertical-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.student-vertical-card.is-expanded {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.student-vertical-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    cursor: pointer;
    user-select: none;
}

.student-vertical-main-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.student-vertical-roll-badge {
    min-width: 44px;
    height: 44px;
    background: var(--primary-surface);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    padding: 2px 6px;
    flex-shrink: 0;
}

.student-vertical-roll-badge .roll-lbl {
    font-size: 9.5px;
    font-weight: 600;
    opacity: 0.85;
}

.student-vertical-roll-badge .roll-num {
    font-size: 15px;
    font-weight: 800;
}

.student-vertical-name-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.student-vertical-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.student-vertical-subline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.student-class-tag {
    font-weight: 600;
    color: var(--primary);
}

.student-id-dot {
    color: var(--text-muted);
}

.student-id-tag {
    font-size: 11px;
    color: var(--text-muted);
}

.student-vertical-actions-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.student-vertical-type-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid transparent;
}

.student-vertical-type-badge.type-boarding,
.badge.type-boarding {
    background: #D1F2D9;
    color: #14532D;
    border-color: rgba(20, 83, 45, 0.3);
}

.student-vertical-type-badge.type-day,
.badge.type-day {
    background: #FEE2E2;
    color: #0F172A;
    border-color: rgba(239, 68, 68, 0.28);
}

.btn-student-info-toggle {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 0;
}

.btn-student-info-toggle:hover {
    background: var(--primary-surface);
    border-color: var(--primary);
    transform: scale(1.05);
}

.btn-student-info-toggle.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/*
==================================================
        STUDENT EDIT BUTTON STYLING
==================================================
*/
.btn-student-edit-action {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.btn-student-edit-action:hover {
    background: var(--primary-surface);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.student-vertical-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    animation: fadeInSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.student-vertical-card.is-expanded .student-vertical-details {
    display: block;
}

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

.student-vertical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 14px;
    background: var(--bg-main);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.student-vertical-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.student-vertical-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.student-vertical-val {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.student-vertical-phone-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    white-space: nowrap;
}

.student-vertical-phone-link:hover {
    text-decoration: underline;
}

/*
==================================================
       STUDENT REGISTER & CARDS DARK THEME
==================================================
*/

[data-theme="dark"] #admission-list-card h3,
[data-theme="dark"] .student-register-header h3 {
    color: #4ADE80 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #students-total-count-badge {
    background: rgba(74, 222, 128, 0.15) !important;
    color: #4ADE80 !important;
    border: 1px solid rgba(74, 222, 128, 0.35) !important;
}

[data-theme="dark"] #admission-form-card h3 {
    color: #4ADE80 !important;
}

[data-theme="dark"] #adm-step-tag {
    background: rgba(74, 222, 128, 0.15) !important;
    color: #4ADE80 !important;
    border: 1px solid rgba(74, 222, 128, 0.35) !important;
}

[data-theme="dark"] .student-vertical-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .student-vertical-card:hover,
[data-theme="dark"] .student-vertical-card.is-expanded {
    border-color: #4ADE80;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .student-vertical-roll-badge {
    background: rgba(74, 222, 128, 0.12) !important;
    border-color: rgba(74, 222, 128, 0.5) !important;
    color: #4ADE80 !important;
}

[data-theme="dark"] .student-vertical-roll-badge .roll-lbl {
    color: #86EFAC !important;
    opacity: 0.95 !important;
}

[data-theme="dark"] .student-vertical-roll-badge .roll-num {
    color: #FFFFFF !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .student-vertical-name {
    color: #F8FAFC !important;
}

[data-theme="dark"] .student-class-tag {
    color: #6EE7B7 !important;
}

[data-theme="dark"] .student-id-dot {
    color: #64748B !important;
}

[data-theme="dark"] .student-id-tag {
    color: #94A3B8 !important;
}

[data-theme="dark"] .student-vertical-type-badge.type-boarding,
[data-theme="dark"] .badge.type-boarding {
    background: rgba(34, 197, 94, 0.22) !important;
    color: #4ADE80 !important;
    border: 1px solid rgba(74, 222, 128, 0.4) !important;
}

[data-theme="dark"] .student-vertical-type-badge.type-day,
[data-theme="dark"] .badge.type-day {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #F87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .btn-student-edit-action {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: #6EE7B7 !important;
}

[data-theme="dark"] .btn-student-edit-action:hover {
    background: rgba(74, 222, 128, 0.18) !important;
    border-color: #4ADE80 !important;
    color: #86EFAC !important;
}

[data-theme="dark"] .btn-student-info-toggle {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: #6EE7B7 !important;
}

[data-theme="dark"] .btn-student-info-toggle:hover {
    background: rgba(74, 222, 128, 0.18) !important;
    border-color: #4ADE80 !important;
    color: #86EFAC !important;
}

[data-theme="dark"] .btn-student-info-toggle.active {
    background: #10B981 !important;
    border-color: #10B981 !important;
    color: #0F172A !important;
}

[data-theme="dark"] .student-vertical-details {
    border-top-color: #334155 !important;
}

[data-theme="dark"] .student-vertical-grid {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid #334155 !important;
    border-radius: 10px;
    padding: 12px 14px;
}

[data-theme="dark"] .student-vertical-label {
    color: #94A3B8 !important;
}

[data-theme="dark"] .student-vertical-val {
    color: #F1F5F9 !important;
}

[data-theme="dark"] .student-vertical-phone-link {
    color: #93C5FD !important;
}

/*
==================================================
      STUDENT REGISTER JAMAT FILTER DROPDOWN
==================================================
*/

.student-jamat-filter-bar {
    margin-bottom: 14px;
}

.jamat-filter-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.jamat-select-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 180px;
}

.jamat-select-icon {
    position: absolute;
    left: 12px;
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    user-select: none;
}

.jamat-filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-card, #FFFFFF);
    border: 1.5px solid var(--border-color, #E2E8F0);
    border-radius: 10px;
    padding: 8px 34px 8px 36px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary, #1E293B);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    line-height: 1.4;
}

.jamat-filter-select:hover {
    border-color: var(--primary, #1B5E20);
}

.jamat-filter-select:focus {
    outline: none;
    border-color: var(--primary, #1B5E20);
    box-shadow: 0 0 0 3px var(--primary-surface, rgba(27, 94, 32, 0.12));
}

.jamat-select-arrow {
    position: absolute;
    right: 12px;
    font-size: 9px;
    color: var(--text-muted, #64748B);
    pointer-events: none;
    z-index: 2;
    user-select: none;
}

.btn-clear-jamat-filter {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    color: var(--text-muted, #64748B);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease;
}

.btn-clear-jamat-filter:hover {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #DC2626;
}

/* Dark Mode Overrides */
[data-theme="dark"] .jamat-filter-select {
    background: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}

[data-theme="dark"] .jamat-filter-select:hover,
[data-theme="dark"] .jamat-filter-select:focus {
    border-color: var(--primary, #4ADE80);
}

[data-theme="dark"] .jamat-select-arrow {
    color: #94A3B8;
}

[data-theme="dark"] .btn-clear-jamat-filter {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}

[data-theme="dark"] .btn-clear-jamat-filter:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #EF4444;
    color: #F87171;
}

/* Legacy tag styles fallback */
.jamat-tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 9999px;
    border: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card, #FFFFFF);
    color: var(--text-primary, #334155);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    user-select: none;
    line-height: 1.2;
}

.jamat-tag-btn.active {
    background: var(--primary, #1B5E20);
    border-color: var(--primary, #1B5E20);
    color: #FFFFFF !important;
}

/*
==================================================
         SWIPE ATTENDANCE CARD ENGINE
==================================================
*/

.swipe-container {
    max-width: 480px;
    margin: 0 auto;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swipe-card-stack {
    width: 100%;
    height: 380px;
    position: relative;
    margin-bottom: 24px;
    touch-action: pan-y;
}

.swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
    transition: transform 0.14s ease, border-color 0.14s ease;
}

.swipe-card.dragging {
    cursor: grabbing;
    transition: none;
}

.swipe-card.swiping-right {
    border-color: var(--success);
    background: linear-gradient(180deg, var(--bg-card) 70%, var(--success-light) 100%);
}

.swipe-card.swiping-left {
    border-color: var(--danger);
    background: linear-gradient(180deg, var(--bg-card) 70%, var(--danger-light) 100%);
}

.swipe-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary-surface);
    color: var(--primary);
    font-size: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 3px solid var(--border-color);
}

.swipe-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.swipe-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.swipe-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.swipe-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.swipe-btn-absent {
    background: var(--danger-light);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.swipe-btn-undo {
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.swipe-btn-present {
    background: var(--success-light);
    color: var(--success);
    border: 2px solid var(--success);
}

/*
==================================================
           ATTENDANCE STATS SUMMARY BAR
==================================================
*/

.attendance-stats-summary-bar {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color, rgba(226, 232, 240, 0.4));
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.attendance-stat-item {
    white-space: nowrap !important;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    line-height: 1.5;
}

.attendance-stat-item .stat-num-primary {
    color: #16A34A;
    font-weight: 800;
}

[data-theme="dark"] .attendance-stat-item .stat-num-primary {
    color: #4ADE80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.25);
}

.attendance-stat-item .stat-num-accent {
    color: #D97706;
    font-weight: 800;
}

[data-theme="dark"] .attendance-stat-item .stat-num-accent {
    color: #FBBF24 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.attendance-stat-item .stat-num-present {
    color: #16A34A;
    font-weight: 800;
}

[data-theme="dark"] .attendance-stat-item .stat-num-present {
    color: #4ADE80 !important;
}

.attendance-stat-item .stat-num-absent {
    color: #DC2626;
    font-weight: 800;
}

[data-theme="dark"] .attendance-stat-item .stat-num-absent {
    color: #F87171 !important;
}

.attendance-stat-breakdown {
    color: var(--text-secondary);
    font-size: 13.5px;
}

[data-theme="dark"] .attendance-stat-breakdown {
    color: #CBD5E1;
}

@media (max-width: 576px) {
    .attendance-stats-summary-bar {
        font-size: 13.5px;
        gap: 5px;
    }
    .attendance-stat-breakdown {
        font-size: 13px;
    }
}

/*
==================================================
           ATTENDANCE FINAL REPORT STYLES
==================================================
*/

.attendance-top-control-card {
    border-radius: var(--radius-md, 12px);
    transition: all 0.2s ease;
}

.attendance-report-card {
    cursor: default !important;
    user-select: text !important;
    padding: 22px 18px !important;
    height: auto !important;
    min-height: 360px;
    border-color: rgba(34, 197, 94, 0.4) !important;
    box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.attendance-final-report-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-hover, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 14px;
    margin-top: 6px;
    text-align: left;
}

[data-theme="dark"] .attendance-final-report-grid {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.8);
}

.attendance-final-report-grid .report-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: var(--text-primary);
}

.attendance-final-report-grid .report-stat-item.full-width {
    width: 100%;
}

.attendance-final-report-grid .report-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.attendance-final-report-grid .report-val {
    font-weight: 800;
    font-size: 14.5px;
}

.attendance-final-report-grid .report-val.stat-primary {
    color: #16A34A;
}

[data-theme="dark"] .attendance-final-report-grid .report-val.stat-primary {
    color: #4ADE80;
}

.attendance-final-report-grid .report-val.stat-accent {
    color: #D97706;
}

[data-theme="dark"] .attendance-final-report-grid .report-val.stat-accent {
    color: #FBBF24;
}

.report-subline-container {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 3px;
}

.report-sub-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap !important;
}

.pill-present {
    background: rgba(22, 163, 74, 0.12);
    color: #15803D;
    border: 1px solid rgba(22, 163, 74, 0.25);
}

[data-theme="dark"] .pill-present {
    background: rgba(34, 197, 94, 0.18);
    color: #4ADE80;
    border-color: rgba(34, 197, 94, 0.35);
}

.pill-absent {
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

[data-theme="dark"] .pill-absent {
    background: rgba(239, 68, 68, 0.18);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.35);
}

.pill-boarding {
    background: #D1F2D9;
    color: #14532D;
    border: 1px solid rgba(20, 83, 45, 0.3);
}

[data-theme="dark"] .pill-boarding {
    background: rgba(34, 197, 94, 0.22);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.4);
}

.pill-dayscholar {
    background: #FEE2E2;
    color: #0F172A;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

[data-theme="dark"] .pill-dayscholar {
    background: rgba(239, 68, 68, 0.18);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.35);
}

/*
==================================================
   ATTENDANCE VIEW TOGGLE & TRELLO LIST SWIPE
==================================================
*/

.attendance-view-toggle-bar {
    display: flex;
    background: #E2E8F0;
    padding: 4px;
    border-radius: 12px;
    gap: 6px;
    margin-bottom: 16px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

[data-theme="dark"] .attendance-view-toggle-bar {
    background: #1E293B;
    border: 1px solid #334155;
}

.att-mode-toggle-btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748B);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.att-mode-toggle-btn.active {
    background: var(--bg-card, #FFFFFF);
    color: var(--primary, #1B5E20);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .att-mode-toggle-btn.active {
    background: #0F172A;
    color: #4ADE80;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Trello / List Attendance Container */
.attendance-trello-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.att-trello-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-card, #FFFFFF);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #E2E8F0);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

[data-theme="dark"] .att-trello-toolbar {
    background: #1E293B;
    border-color: #334155;
}

.att-trello-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.att-trello-tip {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Trello List Item / Card */
.att-trello-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.att-trello-row-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #F1F5F9;
    user-select: none;
    touch-action: pan-y;
}

[data-theme="dark"] .att-trello-row-wrapper {
    background: #0F172A;
}

.att-trello-swipe-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-weight: 800;
    font-size: 15px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.att-trello-swipe-bg .swipe-label-left,
.att-trello-swipe-bg .swipe-label-right {
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap !important;
    user-select: none;
}

.att-trello-swipe-bg.bg-right {
    background: #16A34A;
    color: #FFFFFF;
}

.att-trello-swipe-bg.bg-right .swipe-label-left {
    opacity: 1;
    transform: translateX(0);
}

.att-trello-swipe-bg.bg-left {
    background: #DC2626;
    color: #FFFFFF;
}

.att-trello-swipe-bg.bg-left .swipe-label-right {
    opacity: 1;
    transform: translateX(0);
}

/*
==================================================
        ATTENDANCE TRELLO & LIST VIEW STYLES
==================================================
*/

.att-trello-item {
    position: relative;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.12s ease-out, border-color 0.15s, background 0.15s;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
    z-index: 2;
}

.att-trello-item:active {
    cursor: grabbing;
}

[data-theme="dark"] .att-trello-item {
    background: #1E293B;
    border-color: #334155;
}

/*
==================================================
      TRELLO ATTENDANCE: PRESENT CARD STYLES
==================================================
*/
.att-trello-item.status-present {
    border: 1.5px solid #15803D !important;
    border-left: 6px solid #14532D !important;
    background: #16A34A !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25) !important;
}

.att-trello-item.status-present .att-trello-name {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.att-trello-item.status-present .att-trello-sub,
.att-trello-item.status-present .att-trello-sub span {
    color: #F0FDF4 !important;
    font-weight: 600 !important;
}

.att-trello-item.status-present .att-trello-roll-badge {
    background: #FFFFFF !important;
    color: #15803D !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] .att-trello-item.status-present {
    border-color: #14532D !important;
    border-left: 6px solid #14532D !important;
    background: #15803D !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .att-trello-item.status-present .att-trello-name {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .att-trello-item.status-present .att-trello-sub,
[data-theme="dark"] .att-trello-item.status-present .att-trello-sub span {
    color: #F0FDF4 !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .att-trello-item.status-present .att-trello-roll-badge {
    background: #FFFFFF !important;
    color: #15803D !important;
    font-weight: 800 !important;
}

/*
==================================================
       TRELLO ATTENDANCE: ABSENT CARD STYLES
==================================================
*/
.att-trello-item.status-absent {
    border: 1.5px solid #991B1B !important;
    border-left: 6px solid #7F1D1D !important;
    background: #DC2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
}

.att-trello-item.status-absent .att-trello-name {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.att-trello-item.status-absent .att-trello-sub,
.att-trello-item.status-absent .att-trello-sub span {
    color: #FEF2F2 !important;
    font-weight: 600 !important;
}

.att-trello-item.status-absent .att-trello-roll-badge {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] .att-trello-item.status-absent {
    border-color: #7F1D1D !important;
    border-left: 6px solid #7F1D1D !important;
    background: #B91C1C !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .att-trello-item.status-absent .att-trello-name {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .att-trello-item.status-absent .att-trello-sub,
[data-theme="dark"] .att-trello-item.status-absent .att-trello-sub span {
    color: #FEF2F2 !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .att-trello-item.status-absent .att-trello-roll-badge {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    font-weight: 800 !important;
}

.att-trello-student-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.att-trello-roll-badge {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #E2E8F0;
    color: #1E293B;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .att-trello-roll-badge {
    background: #334155;
    color: #F8FAFC;
}

.att-trello-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.att-trello-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary, #1E293B);
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

[data-theme="dark"] .att-trello-name {
    color: #F8FAFC;
}

.att-trello-sub {
    font-size: 12.5px;
    color: var(--text-muted, #64748B);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.att-trello-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.att-btn-pill {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    user-select: none;
    touch-action: manipulation;
}

.att-btn-pill-present {
    background: rgba(22, 163, 74, 0.12);
    color: #16A34A;
    border-color: rgba(22, 163, 74, 0.3);
}

.att-btn-pill-present:hover, .att-btn-pill-present.active {
    background: #16A34A;
    color: #FFFFFF;
    border-color: #16A34A;
}

.att-btn-pill-absent {
    background: rgba(220, 38, 38, 0.12);
    color: #DC2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.att-btn-pill-absent:hover, .att-btn-pill-absent.active {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
}

/* Circular Reset Button between Absent & Present */
.att-btn-reset {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #CBD5E1);
    background: var(--bg-card, #FFFFFF);
    color: var(--text-secondary, #64748B);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0 !important;
    padding: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.att-btn-reset:hover {
    background: #E2E8F0;
    color: #0F172A;
    border-color: #94A3B8;
    transform: rotate(-45deg);
}

.att-btn-reset:active {
    transform: scale(0.9) rotate(-120deg);
}

.att-btn-reset.is-empty {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

[data-theme="dark"] .att-btn-reset {
    background: #1E293B;
    border-color: #475569;
    color: #94A3B8;
}

[data-theme="dark"] .att-btn-reset:hover {
    background: #334155;
    color: #F8FAFC;
    border-color: #64748B;
}

/*
==================================================
   HIGH CONTRAST BUTTONS INSIDE TRELLO STATUS CARDS
==================================================
*/
/* Present Status Card Buttons */
.att-trello-item.status-present .att-btn-pill-present.active {
    background: #FFFFFF !important;
    color: #15803D !important;
    border: 1.5px solid #FFFFFF !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-present .att-btn-pill-present.active:hover {
    background: #F0FDF4 !important;
    color: #14532D !important;
}

.att-trello-item.status-present .att-btn-pill-absent:not(.active) {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #DC2626 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-present .att-btn-pill-absent:not(.active):hover {
    background: #FFFFFF !important;
    color: #B91C1C !important;
}

.att-trello-item.status-present .att-btn-reset {
    background: #FFFFFF !important;
    color: #15803D !important;
    border: 1.5px solid #FFFFFF !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-present .att-btn-reset:hover {
    background: #F0FDF4 !important;
    color: #14532D !important;
    transform: rotate(-45deg);
}

[data-theme="dark"] .att-trello-item.status-present .att-btn-pill-present.active {
    background: #FFFFFF !important;
    color: #15803D !important;
    border: 1.5px solid #FFFFFF !important;
}

[data-theme="dark"] .att-trello-item.status-present .att-btn-pill-absent:not(.active) {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #DC2626 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] .att-trello-item.status-present .att-btn-reset {
    background: #FFFFFF !important;
    color: #15803D !important;
    border: 1.5px solid #FFFFFF !important;
}

/* Absent Status Card Buttons */
.att-trello-item.status-absent .att-btn-pill-absent.active {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    border: 1.5px solid #FFFFFF !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-absent .att-btn-pill-absent.active:hover {
    background: #FEF2F2 !important;
    color: #991B1B !important;
}

.att-trello-item.status-absent .att-btn-pill-present:not(.active) {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #15803D !important;
    border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-absent .att-btn-pill-present:not(.active):hover {
    background: #FFFFFF !important;
    color: #14532D !important;
}

.att-trello-item.status-absent .att-btn-reset {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    border: 1.5px solid #FFFFFF !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.att-trello-item.status-absent .att-btn-reset:hover {
    background: #FEF2F2 !important;
    color: #7F1D1D !important;
    transform: rotate(-45deg);
}

[data-theme="dark"] .att-trello-item.status-absent .att-btn-pill-absent.active {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    border: 1.5px solid #FFFFFF !important;
}

[data-theme="dark"] .att-trello-item.status-absent .att-btn-pill-present:not(.active) {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #15803D !important;
    border: 1.5px solid rgba(255, 255, 255, 0.9) !important;
}

[data-theme="dark"] .att-trello-item.status-absent .att-btn-reset {
    background: #FFFFFF !important;
    color: #DC2626 !important;
    border: 1.5px solid #FFFFFF !important;
}

@media (min-width: 641px) {
    .att-trello-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .att-trello-student-info {
        flex: 1;
    }

    .att-trello-actions {
        width: auto;
        flex-shrink: 0;
    }

    .att-btn-pill {
        flex: initial;
        padding: 7px 14px;
    }
}

@media (max-width: 600px) {
    .att-trello-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .att-trello-toolbar-actions {
        justify-content: stretch;
    }
    .att-trello-toolbar-actions button {
        flex: 1;
    }
}

/*
==================================================
       ESC/POS THERMAL RECEIPT SLIP STYLES
==================================================
*/

.thermal-slip {
    width: 320px;
    background: #FFFFFF;
    color: #000000;
    padding: 20px 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    border: 1px dashed #CBD5E1;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.thermal-slip-center {
    text-align: center;
}

.thermal-slip-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.thermal-slip-divider {
    border-top: 1px dashed #000000;
    margin: 10px 0;
}

.thermal-slip-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

/* Print Only Formatting */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-area, #printable-area * {
        visibility: visible;
    }
    #printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .thermal-slip {
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/*
==================================================
           EXIT CONFIRMATION MODAL STYLES
==================================================
*/
.exit-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.exit-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.exit-modal-card {
    background: var(--bg-card, #FFFFFF);
    color: var(--text-primary, #1E293B);
    border-radius: 20px;
    max-width: 360px;
    width: 100%;
    padding: 24px 20px 20px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
    transform: scale(0.96) translateZ(0);
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.exit-modal-overlay.active .exit-modal-card {
    transform: scale(1) translateZ(0);
}

.exit-modal-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEE2E2;
    color: #DC2626;
}

.exit-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary, #1E293B);
}

.exit-modal-desc {
    font-size: 13.5px;
    color: var(--text-secondary, #64748B);
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.exit-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.exit-btn-cancel,
.exit-btn-confirm {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.exit-btn-cancel {
    background: var(--bg-surface, #F1F5F9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #CBD5E1);
}

.exit-btn-cancel:hover {
    background: #E2E8F0;
}

.exit-btn-confirm {
    background: #DC2626;
    color: #FFFFFF;
    border: none;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.exit-btn-confirm:hover {
    background: #B91C1C;
}

.exit-btn-cancel:active,
.exit-btn-confirm:active {
    transform: scale(0.97);
}

/*
==================================================
        ACADEMIC CONFIGURATION & MODAL STYLES
==================================================
*/
.academic-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 14px;
}

.academic-card-top-info {
    flex: 1;
    min-width: 240px;
}

.academic-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--primary);
}

[data-theme="dark"] .academic-card-title {
    color: #4ADE80;
}

.academic-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.academic-card-top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.academic-card-top-actions .btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 12.5px;
    padding: 8px 14px;
}

.academic-mgmt-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.academic-section-block {
    background: var(--bg-surface, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 18px 20px;
    transition: all 0.14s ease;
}

[data-theme="dark"] .academic-section-block {
    background: #141E30;
    border-color: #334155;
}

[data-theme="dark"] .academic-section-block h4 {
    color: #4ADE80 !important;
}

.academic-section-block:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.badge-primary {
    background: var(--primary-surface, #E8F5E9) !important;
    color: var(--primary, #1B5E20) !important;
    border: 1px solid rgba(27, 94, 32, 0.25) !important;
    padding: 3px 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

[data-theme="dark"] .badge-primary {
    background: rgba(74, 222, 128, 0.15) !important;
    color: #4ADE80 !important;
    border-color: rgba(74, 222, 128, 0.35) !important;
}

.academic-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.academic-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

[data-theme="dark"] .academic-header-title {
    color: #F8FAFC;
}

.academic-count-badge {
    background: var(--primary-surface, #E8F5E9);
    color: var(--primary, #1B5E20);
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border: 1px solid transparent;
}

[data-theme="dark"] .academic-count-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.25);
}

/*
==================================================
        ACADEMIC CHIP DRAG & DROP ANIMATIONS
==================================================
*/
.academic-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    min-height: 44px;
    align-items: center;
    position: relative;
}

.academic-reorder-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 8px;
    user-select: none;
}

.academic-reorder-toggle-btn.active {
    background: rgba(16, 185, 129, 0.14) !important;
    border-color: #10B981 !important;
    color: #059669 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] .academic-reorder-toggle-btn.active {
    background: rgba(74, 222, 128, 0.2) !important;
    border-color: #4ADE80 !important;
    color: #4ADE80 !important;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.35) !important;
}

.academic-chip {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #CBD5E1);
    color: var(--text-primary, #1E293B);
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease, border-color 0.15s ease;
    gap: 8px;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    position: relative;
    will-change: transform;
}

/* When reorder mode is active */
.reorder-mode-enabled .academic-chip {
    cursor: grab;
    touch-action: none;
}

.reorder-mode-enabled .academic-chip:active {
    cursor: grabbing;
}

[data-theme="dark"] .academic-chip {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}

.reorder-mode-enabled .academic-chip:hover {
    border-color: var(--primary, #1B5E20);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .reorder-mode-enabled .academic-chip:hover {
    border-color: #4ADE80;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.chip-drag-handle {
    cursor: pointer;
    color: var(--text-muted, #94A3B8);
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px 2px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: pan-y;
    opacity: 0.45;
    transition: color 0.15s, transform 0.15s, opacity 0.15s;
}

.reorder-mode-enabled .chip-drag-handle {
    opacity: 1;
    cursor: grab;
    touch-action: none;
    color: var(--primary, #1B5E20);
}

.reorder-mode-enabled .chip-drag-handle:hover {
    transform: scale(1.18);
}

[data-theme="dark"] .reorder-mode-enabled .chip-drag-handle {
    color: #4ADE80;
}

/* Floating avatar while dragging */
.academic-chip-floating {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    margin: 0 !important;
    opacity: 0.98 !important;
    cursor: grabbing !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--primary, #1B5E20) !important;
    transform: scale(1.06) rotate(1.5deg) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-color: var(--primary, #1B5E20) !important;
    background: var(--bg-card, #FFFFFF) !important;
    color: var(--text-primary, #1E293B) !important;
    will-change: left, top, transform;
    border-radius: 10px !important;
}

[data-theme="dark"] .academic-chip-floating {
    background: #1E293B !important;
    border-color: #4ADE80 !important;
    color: #F8FAFC !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px #4ADE80 !important;
}

/* Dynamic drop target placeholder */
.academic-chip-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 2px dashed var(--primary, #1B5E20);
    background: rgba(27, 94, 32, 0.08);
    color: var(--primary, #1B5E20);
    font-size: 12.5px;
    font-weight: 700;
    gap: 6px;
    pointer-events: none;
    box-sizing: border-box;
    animation: chipPlaceholderGlow 1.6s ease-in-out infinite alternate;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] .academic-chip-placeholder {
    border-color: #4ADE80;
    background: rgba(74, 222, 128, 0.12);
    color: #4ADE80;
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.18);
}

@keyframes chipPlaceholderGlow {
    0% {
        border-color: rgba(27, 94, 32, 0.45);
        background: rgba(27, 94, 32, 0.04);
        transform: scale(0.98);
    }
    100% {
        border-color: var(--primary, #1B5E20);
        background: rgba(27, 94, 32, 0.12);
        transform: scale(1.01);
    }
}

[data-theme="dark"] @keyframes chipPlaceholderGlow {
    0% {
        border-color: rgba(74, 222, 128, 0.4);
        background: rgba(74, 222, 128, 0.06);
        transform: scale(0.98);
    }
    100% {
        border-color: #4ADE80;
        background: rgba(74, 222, 128, 0.18);
        transform: scale(1.01);
    }
}

/* Post-drop settle animation */
.academic-chip.just-dropped {
    animation: chipDropSettle 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes chipDropSettle {
    0% {
        transform: scale(1.08);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    }
    50% {
        transform: scale(0.96);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
}

.academic-chip-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0 !important;
}

.chip-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748B);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.chip-action-btn:hover {
    background: #F1F5F9;
}

[data-theme="dark"] .chip-action-btn:hover {
    background: #334155;
    color: #F8FAFC;
}

.chip-action-btn.edit-btn:hover {
    color: var(--primary, #1B5E20);
}

.chip-action-btn.del-btn:hover {
    color: #DC2626;
    background: #FEE2E2;
}

[data-theme="dark"] .chip-action-btn.del-btn:hover {
    background: rgba(220, 38, 38, 0.2);
}

/*
==================================================
        ACADEMIC CHIP REORDER & ORDER BADGE
==================================================
*/
.academic-chip-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: var(--primary-surface, rgba(27, 94, 32, 0.09));
    color: var(--primary, #1B5E20);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(27, 94, 32, 0.16);
    user-select: none;
}

[data-theme="dark"] .academic-chip-order-badge {
    background: rgba(74, 222, 128, 0.15);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.25);
}

.chip-action-btn.move-btn {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    background: var(--bg-hover, #F1F5F9);
    border-radius: 5px;
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #CBD5E1);
    line-height: 1.2;
    transition: all 0.15s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.chip-action-btn.move-btn:hover:not(:disabled) {
    background: var(--primary, #1B5E20);
    color: #FFFFFF;
    border-color: var(--primary, #1B5E20);
    transform: scale(1.06);
}

.chip-action-btn.move-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

[data-theme="dark"] .chip-action-btn.move-btn {
    background: #334155;
    color: #CBD5E1;
    border-color: #475569;
}

[data-theme="dark"] .chip-action-btn.move-btn:hover:not(:disabled) {
    background: #16A34A;
    color: #FFFFFF;
    border-color: #16A34A;
}

/*
==================================================
           ACADEMIC CHIP ORDER INPUT
==================================================
*/
.chip-order-input {
    width: 32px;
    height: 20px;
    padding: 0 2px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary, #1E293B);
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #CBD5E1);
    border-radius: 5px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
    font-family: inherit;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    cursor: text;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    -moz-appearance: textfield;
}

.chip-order-input::-webkit-outer-spin-button,
.chip-order-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.chip-order-input:focus {
    border-color: var(--primary, #1B5E20);
    box-shadow: 0 0 0 2px rgba(27, 94, 32, 0.18);
    background: #FFFFFF;
}

.chip-order-input::placeholder {
    color: var(--text-muted, #94A3B8);
    font-weight: 500;
    opacity: 0.7;
}

[data-theme="dark"] .chip-order-input {
    background: #1E293B;
    color: #F8FAFC;
    border-color: #475569;
}

[data-theme="dark"] .chip-order-input:focus {
    border-color: #4ADE80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
    background: #0F172A;
}

[data-theme="dark"] .chip-order-input::placeholder {
    color: #64748B;
}

.academic-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.academic-input-row input {
    flex: 1;
    min-width: 0;
}

.academic-input-row .btn,
.academic-input-row button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

@media (max-width: 640px) {
    .data-card {
        padding: 16px 14px;
    }

    .academic-card-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .academic-card-top-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .academic-card-top-actions .btn {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px 14px;
        box-sizing: border-box;
    }

    .academic-section-block {
        padding: 14px 12px;
    }

    .academic-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .academic-input-row input {
        width: 100%;
        min-width: 0;
    }

    .academic-input-row .btn,
    .academic-input-row button {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 11px 16px;
        box-sizing: border-box;
    }
}

.academic-quick-btn {
    font-size: 11.5px;
    color: var(--primary, #1B5E20);
    background: var(--primary-light, #E8F5E9);
    border: 1px solid rgba(27, 94, 32, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.14s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.academic-quick-btn:hover {
    background: var(--primary, #1B5E20);
    color: #FFFFFF !important;
}

/*
==================================================
           ACADEMIC & ENTITY MODAL STYLES
==================================================
*/
.academic-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    overscroll-behavior: contain;
}

.academic-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.academic-modal-card,
.academic-modal-box {
    background: var(--bg-card, #FFFFFF);
    color: var(--text-primary, #1E293B);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
    transform: scale(0.96) translateZ(0);
    -webkit-transform: scale(0.96) translateZ(0);
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    overscroll-behavior: contain;
    isolation: isolate;
    will-change: transform;
}

.academic-modal-overlay.active .academic-modal-card,
.academic-modal-overlay.active .academic-modal-box {
    transform: scale(1) translateZ(0);
    -webkit-transform: scale(1) translateZ(0);
}

.academic-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.academic-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary, #1B5E20);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

[data-theme="dark"] .academic-modal-title {
    color: #4ADE80 !important;
}

.academic-modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.academic-modal-close:hover {
    background: #F1F5F9;
    color: #DC2626;
}

.academic-modal-tabs {
    display: flex;
    background: var(--bg-surface, #F1F5F9);
    padding: 6px;
    gap: 6px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
}

.academic-tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748B);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.14s ease;
    text-align: center;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.academic-tab-btn.active {
    background: var(--bg-card, #FFFFFF);
    color: var(--primary, #1B5E20);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.academic-modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
}

.academic-modal-body::-webkit-scrollbar {
    width: 6px;
}

.academic-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.academic-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color, #CBD5E1);
    border-radius: 999px;
}

.academic-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #94A3B8);
}

[data-theme="dark"] .academic-modal-body::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .academic-modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748B;
}

.academic-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-surface, #F8FAFC);
}

[data-theme="dark"] .academic-modal-tabs {
    background: #0F172A;
    border-color: #334155;
}

[data-theme="dark"] .academic-tab-btn {
    color: #94A3B8;
}

[data-theme="dark"] .academic-tab-btn.active {
    background: #1E293B;
    color: #4ADE80;
}

[data-theme="dark"] .academic-modal-footer {
    background: #0F172A;
    border-color: #334155;
}

[data-theme="dark"] .exit-btn-cancel {
    background: #1E293B;
    color: #CBD5E1;
    border-color: #334155;
}

[data-theme="dark"] .exit-btn-cancel:hover {
    background: #334155;
}

/*
==================================================
        LOGIN SCREEN & AUTH MODAL STYLES
==================================================
*/

.login-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

[data-theme="dark"] .login-overlay-container {
    background: linear-gradient(135deg, #022c22 0%, #0f172a 60%, #020617 100%);
}

.login-overlay-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: loginFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
    color: #F1F5F9;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) translateZ(0);
    }
}

.login-brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    font-size: 32px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.login-brand-icon:active {
    transform: scale(0.94);
}

.login-main-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

[data-theme="dark"] .login-main-title {
    color: #F8FAFC;
}

.login-sub-title {
    font-size: 13px;
    color: #64748B;
}

[data-theme="dark"] .login-sub-title {
    color: #94A3B8;
}

.login-input-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

[data-theme="dark"] .login-label {
    color: #CBD5E1;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #CBD5E1;
    font-size: 14px;
    font-family: inherit;
    background: #F8FAFC;
    color: #0F172A;
    transition: all 0.14s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #10B981;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .login-input {
    background: #0F172A;
    border-color: #334155;
    color: #F1F5F9;
}

[data-theme="dark"] .login-input:focus {
    background: #1E293B;
    border-color: #34D399;
}

.login-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.14s ease;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    margin-top: 8px;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.demo-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 14px 0;
    color: #94A3B8;
    font-size: 12px;
}

.demo-login-divider::before,
.demo-login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E2E8F0;
}

[data-theme="dark"] .demo-login-divider::before,
[data-theme="dark"] .demo-login-divider::after {
    border-color: #334155;
}

.demo-login-divider span {
    padding: 0 10px;
}

.demo-accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.demo-account-pill {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
    transition: all 0.14s ease;
}

.demo-account-pill:hover {
    background: #E2E8F0;
    border-color: #94A3B8;
}

[data-theme="dark"] .demo-account-pill {
    background: #0F172A;
    border-color: #334155;
    color: #CBD5E1;
}

[data-theme="dark"] .demo-account-pill:hover {
    background: #1E293B;
    border-color: #475569;
}

.demo-account-pill-full {
    grid-column: 1 / -1;
}

/*
==================================================
       SUPER ADMIN MASTER DASHBOARD STYLES
==================================================
*/

.sa-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.sa-kpi-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 14px;
}

[data-theme="dark"] .sa-kpi-card {
    background: #1E293B;
    border-color: #334155;
}

.sa-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.sa-kpi-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sa-kpi-lbl {
    font-size: 12px;
    color: var(--text-muted, #64748B);
}

.sa-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.sa-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sa-add-inst-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/*
==================================================
        SUPER ADMIN INSTITUTION CARDS & GRID
==================================================
*/

.sa-institutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .sa-institutions-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
    }
}

.sa-inst-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sa-inst-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .sa-inst-card {
    background: #1E293B;
    border-color: #334155;
}

@media (max-width: 640px) {
    .sa-inst-card {
        padding: 14px 12px;
    }
}

.sa-inst-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
    min-width: 0;
}

.sa-inst-top > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.sa-inst-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.sa-badge-madrasah {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.sa-badge-kg {
    background: rgba(2, 132, 199, 0.15);
    color: #0284C7;
}

.sa-badge-college {
    background: rgba(147, 51, 234, 0.15);
    color: #9333EA;
}

.sa-inst-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
}

[data-theme="dark"] .sa-inst-title {
    color: #F8FAFC;
}

.sa-inst-code {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    font-family: monospace;
    word-break: break-word;
}

.sa-inst-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color, #E2E8F0);
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    margin: 12px 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.sa-inst-stats-row > div {
    min-width: 0;
}

[data-theme="dark"] .sa-inst-stats-row {
    border-color: #334155;
}

.sa-stat-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .sa-stat-num {
    color: #F8FAFC;
}

.sa-stat-lbl {
    font-size: 11px;
    color: var(--text-muted, #64748B);
    white-space: nowrap;
}

.sa-inst-meta {
    font-size: 12px;
    color: var(--text-muted, #94A3B8);
    margin-bottom: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.45;
}

.sa-inst-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    box-sizing: border-box;
}

.sa-btn-switch {
    width: auto;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.sa-btn-switch:hover {
    box-shadow: 0 5px 14px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.sa-btn-package {
    width: auto;
    background: #F8FAFC;
    color: #0F172A;
    border: 1px solid #CBD5E1;
    padding: 7px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

[data-theme="dark"] .sa-btn-package {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

.sa-btn-package:hover {
    background: #E2E8F0;
    border-color: #94A3B8;
}

[data-theme="dark"] .sa-btn-package:hover {
    background: #1E293B;
}

.sa-btn-status {
    width: auto;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
    padding: 7px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.sa-btn-status:hover {
    background: #E2E8F0;
}

[data-theme="dark"] .sa-btn-status {
    background: #0F172A;
    border-color: #334155;
    color: #CBD5E1;
}

[data-theme="dark"] .sa-btn-status:hover {
    background: #1E293B;
}

@media (max-width: 640px) {
    .sa-inst-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .sa-btn-switch {
        width: auto !important;
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 14px !important;
        font-size: 12.5px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }

    .sa-btn-package,
    .sa-btn-status {
        width: auto !important;
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 7px 12px !important;
        font-size: 12px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }
}

/*
==================================================
        USER PROFILE & LOGOUT MODAL STYLES
==================================================
*/

.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.profile-modal-overlay.active {
    display: flex;
}

.profile-modal-box {
    background: var(--bg-card, #FFFFFF);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color, #E2E8F0);
}

[data-theme="dark"] .profile-modal-box {
    background: #1E293B;
    border-color: #334155;
}

.profile-avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 12px auto;
}

.profile-user-name {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary, #0F172A);
    margin-bottom: 2px;
}

[data-theme="dark"] .profile-user-name {
    color: #F8FAFC;
}

.profile-user-role {
    font-size: 13px;
    text-align: center;
    color: var(--text-muted, #64748B);
    margin-bottom: 16px;
}

.profile-info-list {
    background: var(--bg-surface, #F8FAFC);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
}

[data-theme="dark"] .profile-info-list {
    background: #0F172A;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
}

[data-theme="dark"] .profile-info-row {
    border-color: #334155;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.profile-logout-btn {
    flex: 1;
    min-width: 0;
    width: auto;
    background: #EF4444;
    color: #FFFFFF;
    border: none;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.14s ease;
}

.profile-logout-btn:hover {
    background: #DC2626;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.profile-logout-btn:disabled,
.login-submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/*
==================================================
             BUTTON SPINNER & LOADING
==================================================
*/
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: btnSpinnerRotate 0.7s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}

@keyframes btnSpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

.profile-close-btn {
    flex: 1;
    min-width: 0;
    width: auto;
    background: transparent;
    color: var(--text-muted, #64748B);
    border: 1px solid var(--border-color, #CBD5E1);
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.profile-close-btn:hover {
    background: var(--bg-surface, #F1F5F9);
    color: var(--text-primary, #0F172A);
    border-color: var(--border-color, #94A3B8);
}

[data-theme="dark"] .profile-close-btn {
    border-color: #334155;
    color: #94A3B8;
}

[data-theme="dark"] .profile-close-btn:hover {
    background: #1E293B;
    color: #F8FAFC;
    border-color: #475569;
}

.sa-switch-back-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FEF08A;
    color: #854D0E;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid #FDE047;
    animation: saPulse 2s infinite;
}

@keyframes saPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/*
==================================================
        ADMISSION MULTI-STEP WIZARD STYLES
==================================================
*/
.admission-stepper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    position: relative;
    user-select: none;
}

.step-indicator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    transition: var(--transition);
}

.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.step-text-wrapper {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
    transition: var(--transition);
}

.step-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.step-indicator-item.active .step-badge {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--primary-surface);
}

.step-indicator-item.active .step-title {
    color: var(--primary);
}

.step-indicator-item.completed .step-badge {
    background: var(--success);
    color: #FFFFFF;
}

.step-indicator-item.completed .step-title {
    color: var(--success);
}

.step-divider-line {
    flex: 0 0 48px;
    height: 2px;
    background: var(--border-color);
    margin: 0 16px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.step-divider-line.completed {
    background: var(--success);
}

.form-step-pane {
    animation: fadeInStep 0.22s ease-out;
}

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

@media (max-width: 600px) {
    .admission-stepper-header {
        padding: 10px 12px;
        gap: 6px;
    }
    .step-sub {
        display: none;
    }
    .step-divider-line {
        flex: 0 0 20px;
        margin: 0 6px;
    }
    .step-title {
        font-size: 12px;
    }
}

/*
==================================================
       ADMISSION VIEW UNIFIED HEADER & TABS
==================================================
*/
#view-admission .panel-header-bar {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}

#view-admission .panel-header-bar:active {
    transform: none;
}

#view-admission .panel-title-area:active {
    transform: none !important;
}

.admission-top-nav-tabs {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 6px;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.admission-top-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font-size: 14.5px;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    user-select: none;
}

.admission-top-tab-btn svg {
    flex-shrink: 0;
}

.admission-top-tab-btn:hover {
    color: var(--primary);
    background: var(--primary-surface);
}

.admission-top-tab-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.28);
}

[data-theme="dark"] .admission-top-nav-tabs {
    background: #0F172A;
    border-color: #334155;
}

[data-theme="dark"] .admission-top-tab-btn {
    color: #94A3B8;
}

[data-theme="dark"] .admission-top-tab-btn:hover {
    color: #4ADE80;
    background: rgba(74, 222, 128, 0.1);
}

[data-theme="dark"] .admission-top-tab-btn.active {
    background: linear-gradient(135deg, #166534 0%, #15803D 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #22C55E !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .admission-top-tab-btn.active svg {
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}

@media (max-width: 600px) {
    #view-admission .panel-header-bar {
        padding: 12px 14px;
        margin-bottom: 0;
    }

    .admission-top-nav-tabs {
        padding: 4px;
        gap: 4px;
        margin-bottom: 16px;
    }

    .admission-top-tab-btn {
        padding: 9px 10px;
        font-size: 13px;
        gap: 6px;
    }
}

/*
==================================================
        THEME COLOR PICKER & PALETTE SWATCHES
==================================================
*/

.theme-color-picker-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .theme-color-picker-box {
    background: #1E293B;
    border-color: #334155;
}

.theme-color-picker-box:focus-within {
    border-color: var(--primary, #1B5E20);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.12);
}

.color-preview-trigger-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-swatch-display-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 0 1px #CBD5E1;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch-display-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--primary, #1B5E20);
}

.color-native-hidden-input {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 200%;
    height: 200%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}

.color-hex-text-input {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.color-picker-custom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease;
}

[data-theme="dark"] .color-picker-custom-btn {
    background: #0F172A;
    border-color: #334155;
    color: #E2E8F0;
}

.color-picker-custom-btn:hover {
    background: #F1F5F9;
    border-color: var(--primary, #1B5E20);
    color: var(--primary, #1B5E20);
}

[data-theme="dark"] .color-picker-custom-btn:hover {
    background: #1E293B;
    border-color: #4ADE80;
    color: #4ADE80;
}

/* Palette swatches */
.preset-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #64748B);
    margin-bottom: 2px;
}

.preset-palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.preset-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    position: relative;
    padding: 0;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.preset-color-dot:hover {
    transform: scale(1.18);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px #94A3B8;
    z-index: 2;
}

.preset-color-dot.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2.5px #FFFFFF, 0 0 0 4.5px var(--primary, #1B5E20), 0 4px 10px rgba(0,0,0,0.25);
    z-index: 3;
}

.preset-color-dot.active::after {
    content: "✓";
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

@media (max-width: 600px) {
    .color-preview-trigger-row {
        flex-wrap: wrap;
    }
    .color-hex-text-input {
        min-width: 110px;
    }
}

/*
==================================================
           MADRASA SETTINGS MODULAR TABS
==================================================
*/

.settings-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 14px 16px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .settings-header-card {
        padding: 14px 12px 12px 12px;
        margin-bottom: 10px;
    }
}

.settings-tabs-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 14px;
    margin-bottom: 0;
}

[data-theme="dark"] .settings-tabs-nav {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
}

@media (min-width: 768px) {
    .settings-tabs-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

.settings-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: var(--text-muted, #64748B);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

@media (max-width: 420px) {
    .settings-tab-btn {
        padding: 8px 4px;
        font-size: 12px;
        gap: 4px;
        border-radius: 8px;
    }
    .settings-tab-btn .tab-btn-icon {
        font-size: 14px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .settings-tab-btn:hover:not(.active) {
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-color, #0F172A);
    }
    [data-theme="dark"] .settings-tab-btn:hover:not(.active) {
        background: rgba(255, 255, 255, 0.08);
        color: #F8FAFC;
    }
}

[data-theme="dark"] .settings-tab-btn {
    color: #94A3B8;
}

.settings-tab-btn.active {
    background: var(--primary, #1B5E20) !important;
    color: #FFFFFF !important;
    border-color: var(--primary, #1B5E20) !important;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35) !important;
    transform: none !important;
}

.settings-tab-btn .tab-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.settings-tab-btn .tab-btn-text {
    font-weight: 700;
}

.settings-tab-pane {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.settings-tab-pane.active {
    display: block;
    animation: settingsTabInstant 0.08s ease-out;
}

@keyframes settingsTabInstant {
    from {
        opacity: 0.85;
    }
    to {
        opacity: 1;
    }
}

.settings-card-pane {
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.settings-card-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color, #F1F5F9);
}

[data-theme="dark"] .settings-card-header {
    border-bottom-color: #334155;
}

.settings-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary, #1B5E20);
    margin-bottom: 6px;
}

.settings-card-desc {
    font-size: 13.5px;
    color: var(--text-muted, #64748B);
    margin: 0;
    line-height: 1.5;
}

.settings-pane-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #F1F5F9);
}

[data-theme="dark"] .settings-pane-actions {
    border-top-color: #334155;
}

/*
==================================================
     SETTINGS PREFERENCE ITEMS & RESPONSIVE RULES
==================================================
*/

.settings-preference-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #F8FAFC;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 16px 18px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .settings-preference-item {
    background: #1E293B;
    border-color: #334155;
}

.settings-preference-item:hover {
    border-color: var(--primary, #1B5E20);
}

.pref-icon-box {
    font-size: 24px;
    line-height: 1;
    background: rgba(27, 94, 32, 0.08);
    color: var(--primary, #1B5E20);
    padding: 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

[data-theme="dark"] .pref-icon-box {
    background: rgba(74, 222, 128, 0.12);
}

.pref-text-box {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pref-text-box .form-label {
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.pref-text-box select,
.pref-text-box .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.pref-desc {
    font-size: 13px;
    color: var(--text-muted, #64748B);
    margin: 0 0 8px 0;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 640px) {
    .settings-card-pane {
        padding: 16px 12px;
    }

    .settings-card-title {
        font-size: 16px;
        line-height: 1.35;
    }

    .settings-card-desc {
        font-size: 12.5px;
        line-height: 1.45;
    }

    .settings-preference-item {
        padding: 14px 12px;
        gap: 12px;
    }

    .pref-icon-box {
        font-size: 20px;
        padding: 8px;
        border-radius: 10px;
    }

    .pref-desc {
        font-size: 12px;
    }

    .settings-pane-actions {
        justify-content: stretch;
    }

    .settings-pane-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

/*
==================================================
        THEME PALETTES & INTERFACE MODE CARDS
==================================================
*/

.theme-palettes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    width: 100%;
}

.palette-chip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card, #FFFFFF);
    border: 1.5px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .palette-chip-item {
    background: #1E293B;
    border-color: #334155;
}

.palette-chip-item:hover {
    border-color: var(--primary, #1B5E20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.palette-chip-item.active {
    border-color: var(--primary, #1B5E20);
    background: var(--primary-surface, rgba(27, 94, 32, 0.08));
    box-shadow: 0 0 0 1px var(--primary, #1B5E20);
}

.palette-chip-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.palette-colors-duo {
    display: flex;
    align-items: center;
    position: relative;
    width: 38px;
    height: 26px;
    flex-shrink: 0;
}

.palette-dot-primary {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    position: absolute;
    left: 0;
    z-index: 1;
}

.palette-dot-accent {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    position: absolute;
    right: 0;
    z-index: 2;
}

.palette-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .palette-chip-name {
    color: #F8FAFC;
}

.palette-chip-check {
    font-size: 13px;
    color: var(--primary, #1B5E20);
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.palette-chip-item.active .palette-chip-check {
    opacity: 1;
}

/* Interface Mode Selector Cards */
.interface-mode-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card, #FFFFFF);
    border: 1.5px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .interface-mode-card {
    background: #1E293B;
    border-color: #334155;
}

.interface-mode-card:hover {
    border-color: var(--primary, #1B5E20);
    background: var(--bg-surface, #F8FAFC);
}

.interface-mode-card.active {
    border-color: var(--primary, #1B5E20);
    background: var(--primary-surface, rgba(27, 94, 32, 0.08));
    box-shadow: 0 0 0 1px var(--primary, #1B5E20);
}

.mode-card-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.mode-card-info {
    flex: 1;
    min-width: 0;
}

.mode-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin-bottom: 2px;
}

[data-theme="dark"] .mode-card-title {
    color: #F8FAFC;
}

.mode-card-sub {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    line-height: 1.35;
}

.mode-card-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color, #CBD5E1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    font-weight: 900;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.interface-mode-card.active .mode-card-radio {
    background: var(--primary, #1B5E20);
    border-color: var(--primary, #1B5E20);
    color: #FFFFFF;
}

@media (max-width: 640px) {
    .theme-palettes-grid {
        grid-template-columns: 1fr;
    }
}

/*
==================================================
           FEES MODULE TAB SWITCHER
==================================================
*/
.fee-view-toggle-bar {
    display: flex;
    background: #E2E8F0;
    padding: 4px;
    border-radius: 12px;
    gap: 6px;
    margin-bottom: 18px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .fee-view-toggle-bar {
    background: #1E293B;
    border: 1px solid #334155;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fee-mode-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748B);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}

.fee-mode-toggle-btn:hover {
    color: var(--text-primary, #0F172A);
}

.fee-mode-toggle-btn.active {
    background: var(--bg-card, #FFFFFF);
    color: var(--primary, #1B5E20);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .fee-mode-toggle-btn.active {
    background: #0F172A;
    color: #4ADE80;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.fee-tab-content {
    animation: feeFadeIn 0.22s ease-in-out;
}

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

/*
==================================================
        FEES TRANSACTIONS VERTICAL CARDS LIST
==================================================
*/

.fees-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.fee-transaction-vertical-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-theme="dark"] .fee-transaction-vertical-card {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.fee-transaction-vertical-card:hover {
    border-color: var(--primary, #1B5E20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .fee-transaction-vertical-card:hover {
    border-color: #4ADE80;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Card Top Bar */
.fee-trx-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color, #E2E8F0);
}

[data-theme="dark"] .fee-trx-top-bar {
    border-bottom-color: #334155;
}

.fee-trx-identity-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.fee-trx-avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-surface, #E8F5E9);
    color: var(--primary, #1B5E20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

[data-theme="dark"] .fee-trx-avatar-badge {
    background: rgba(74, 222, 128, 0.15);
    color: #4ADE80;
}

.fee-trx-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fee-trx-student-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .fee-trx-student-name {
    color: #F8FAFC;
}

.fee-trx-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #64748B);
    flex-wrap: wrap;
}

.fee-trx-class-tag {
    font-weight: 600;
    color: var(--primary, #1B5E20);
}

[data-theme="dark"] .fee-trx-class-tag {
    color: #4ADE80;
}

.fee-trx-dot {
    color: var(--text-muted, #94A3B8);
}

.fee-trx-roll-tag {
    color: var(--text-secondary, #64748B);
}

/* Status Pill */
.fee-trx-status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
}

.fee-trx-status-pill.status-paid {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #BBF7D0;
}

[data-theme="dark"] .fee-trx-status-pill.status-paid {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
    border-color: rgba(34, 197, 94, 0.3);
}

.fee-trx-status-pill.status-due {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

[data-theme="dark"] .fee-trx-status-pill.status-due {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Vertical Key-Value Details Stack */
.fee-trx-details-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #F8FAFC;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #F1F5F9;
}

[data-theme="dark"] .fee-trx-details-stack {
    background: #0F172A;
    border-color: #1E293B;
}

.fee-trx-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    gap: 12px;
}

.fee-trx-label {
    color: var(--text-secondary, #64748B);
    font-size: 12.5px;
    flex-shrink: 0;
}

[data-theme="dark"] .fee-trx-label {
    color: #94A3B8;
}

.fee-trx-val {
    color: var(--text-primary, #0F172A);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

[data-theme="dark"] .fee-trx-val {
    color: #E2E8F0;
}

.fee-invoice-code {
    background: #E2E8F0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    font-family: monospace;
    color: #334155;
}

[data-theme="dark"] .fee-invoice-code {
    background: #334155;
    color: #CBD5E1;
}

.fee-received-highlight {
    color: var(--success, #16A34A) !important;
    font-weight: 700 !important;
}

[data-theme="dark"] .fee-received-highlight {
    color: #4ADE80 !important;
}

/* Card Footer Action */
.fee-trx-footer-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 4px;
}

.fee-slip-action-btn {
    font-size: 12.5px;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.fees-empty-state {
    text-align: center;
    padding: 36px 16px;
    background: var(--bg-card, #FFFFFF);
    border: 1px dashed var(--border-color, #E2E8F0);
    border-radius: 12px;
}

[data-theme="dark"] .fees-empty-state {
    background: #1E293B;
    border-color: #334155;
}

.fees-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.fees-empty-text {
    font-size: 14px;
    color: var(--text-muted, #94A3B8);
    margin: 0;
}

/*
==================================================
       STUDENT 12-MONTH FEE STATUS TRACKER
==================================================
*/

.fee-student-status-box {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease-in-out;
}

[data-theme="dark"] .fee-student-status-box {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fee-status-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
}

[data-theme="dark"] .fee-status-summary-header {
    border-bottom-color: #334155;
}

.fee-status-student-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fee-status-avatar {
    font-size: 26px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-surface, #E8F5E9);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .fee-status-avatar {
    background: rgba(74, 222, 128, 0.15);
}

.fee-status-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
}

[data-theme="dark"] .fee-status-name {
    color: #F8FAFC;
}

.fee-status-meta {
    font-size: 12.5px;
    color: var(--text-secondary, #64748B);
    margin-top: 2px;
}

[data-theme="dark"] .fee-status-meta {
    color: #94A3B8;
}

.fee-status-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fee-legend-pill {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.fee-legend-pill.status-paid {
    background: #DCFCE7;
    color: #15803D;
}

.fee-legend-pill.status-partial {
    background: #FEF9C3;
    color: #A16207;
}

.fee-legend-pill.status-unpaid {
    background: #FEE2E2;
    color: #B91C1C;
}

[data-theme="dark"] .fee-legend-pill.status-paid {
    background: rgba(34, 197, 94, 0.2);
    color: #86EFAC;
}

[data-theme="dark"] .fee-legend-pill.status-partial {
    background: rgba(234, 179, 8, 0.2);
    color: #FDE047;
}

[data-theme="dark"] .fee-legend-pill.status-unpaid {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.fee-months-grid-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin: 14px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .fee-months-grid-title {
    color: #CBD5E1;
}

.fee-months-status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .fee-months-status-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .fee-months-status-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }

    .fee-month-card {
        padding: 8px 4px !important;
        border-radius: 8px !important;
    }

    .fee-month-card-name {
        font-size: 12px !important;
        margin-bottom: 2px !important;
    }

    .fee-month-card-badge {
        font-size: 9.5px !important;
        padding: 2px 4px !important;
        border-radius: 5px !important;
    }

    .fee-month-card-sub {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
}

.fee-month-card {
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card-alt, #F8FAFC);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    user-select: none;
}

.fee-month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.fee-month-card.is-selected {
    outline: 2px solid var(--primary, #1B5E20);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.2);
}

.fee-month-card.is-paid {
    background: #F0FDF4;
    border-color: #86EFAC;
}

[data-theme="dark"] .fee-month-card.is-paid {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(74, 222, 128, 0.35);
}

.fee-month-card.is-partial {
    background: #FEFCE8;
    border-color: #FDE047;
}

[data-theme="dark"] .fee-month-card.is-partial {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(250, 204, 21, 0.35);
}

.fee-month-card.is-unpaid {
    background: #FFF1F2;
    border-color: #FECDD3;
}

[data-theme="dark"] .fee-month-card.is-unpaid {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(251, 113, 133, 0.3);
}

.fee-month-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin-bottom: 4px;
}

[data-theme="dark"] .fee-month-card-name {
    color: #F1F5F9;
}

.fee-month-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1.2;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.fee-month-card.is-paid .fee-month-card-badge {
    background: #DCFCE7;
    color: #15803D;
}

.fee-month-card.is-partial .fee-month-card-badge {
    background: #FEF08A;
    color: #854D0E;
}

.fee-month-card.is-unpaid .fee-month-card-badge {
    background: #FFE4E6;
    color: #9F1239;
}

[data-theme="dark"] .fee-month-card.is-paid .fee-month-card-badge {
    background: rgba(34, 197, 94, 0.25);
    color: #86EFAC;
}

[data-theme="dark"] .fee-month-card.is-partial .fee-month-card-badge {
    background: rgba(234, 179, 8, 0.25);
    color: #FDE047;
}

[data-theme="dark"] .fee-month-card.is-unpaid .fee-month-card-badge {
    background: rgba(244, 63, 94, 0.2);
    color: #FDA4AF;
}

.fee-month-card-sub {
    font-size: 10.5px;
    color: var(--text-muted, #64748B);
    margin-top: 3px;
    line-height: 1.2;
}

[data-theme="dark"] .fee-month-card-sub {
    color: #94A3B8;
}

/*
==================================================
      DIRECTORY & FEATURE CARDS LAYOUT PROTOCOL
==================================================
*/

.features-3col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 680px) {
    .features-3col-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.stat-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 14px);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    transition: var(--transition);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-card, #1E293B);
    border-color: var(--border-color, #334155);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/*
==================================================
           PARENT DIRECTORY CARD PROTOCOL
==================================================
*/

.parent-directory-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 20px !important;
    border-radius: var(--radius-md, 14px) !important;
    background: var(--bg-card, #FFFFFF) !important;
    border: 1px solid var(--border-color, #E2E8F0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    margin-bottom: 0;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.parent-directory-card:hover {
    border-color: var(--primary-light, #2E7D32) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .parent-directory-card {
    background: var(--bg-card, #1E293B) !important;
    border-color: var(--border-color, #334155) !important;
}

.parent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
}

[data-theme="dark"] .parent-card-header {
    border-bottom-color: var(--border-color, #334155);
}

.parent-guardian-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary, #0F172A);
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .parent-guardian-name {
    color: #F8FAFC;
}

.parent-guardian-icon {
    font-size: 16px;
    opacity: 0.9;
}

.badge-boarding {
    background: #D1F2D9 !important;
    color: #14532D !important;
    border: 1px solid rgba(20, 83, 45, 0.3) !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

[data-theme="dark"] .badge-boarding {
    background: rgba(34, 197, 94, 0.22) !important;
    color: #4ADE80 !important;
    border-color: rgba(74, 222, 128, 0.4) !important;
}

.badge-dayscholar {
    background: #FEE2E2 !important;
    color: #0F172A !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

[data-theme="dark"] .badge-dayscholar {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #F87171 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

.parent-student-info {
    font-size: 13.5px;
    color: var(--text-secondary, #475569);
    line-height: 1.65;
    margin-bottom: 16px;
    background: var(--bg-surface, #F8FAFC);
    padding: 10px 12px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-color, #E2E8F0);
}

[data-theme="dark"] .parent-student-info {
    background: #0F172A;
    border-color: #334155;
    color: #CBD5E1;
}

.parent-student-row {
    margin-bottom: 4px;
}

.parent-info-label {
    color: var(--text-muted, #94A3B8);
}

.parent-roll-tag {
    font-size: 12px;
    color: var(--text-muted, #94A3B8);
    margin-left: 2px;
}

.parent-pipe-divider {
    color: var(--border-color, #CBD5E1);
    margin: 0 5px;
}

.parent-action-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 4px;
}

.parent-call-btn {
    flex: 1;
    text-decoration: none !important;
    padding: 9px 14px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: var(--radius-sm, 8px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.parent-sms-btn {
    text-decoration: none !important;
    padding: 9px 14px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: var(--radius-sm, 8px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/*
==================================================
       TEACHER MODULE TABS & NAVIGATION STYLES
==================================================
*/

.teacher-tabs-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 14px;
    margin-bottom: 8px;
}

[data-theme="dark"] .teacher-tabs-nav {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
}

.teacher-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: var(--text-secondary, #64748B);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .teacher-tab-btn:hover:not(.active) {
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-primary, #0F172A);
    }
    [data-theme="dark"] .teacher-tab-btn:hover:not(.active) {
        background: rgba(255, 255, 255, 0.08);
        color: #F8FAFC;
    }
}

[data-theme="dark"] .teacher-tab-btn {
    color: #94A3B8;
}

.teacher-tab-btn.active {
    background: var(--primary, #1B5E20) !important;
    color: #FFFFFF !important;
    border-color: var(--primary, #1B5E20) !important;
    box-shadow: 0 3px 10px rgba(27, 94, 32, 0.3) !important;
    transform: none !important;
}

[data-theme="dark"] .teacher-tab-btn.active {
    background: linear-gradient(135deg, #166534 0%, #15803D 100%) !important;
    color: #FFFFFF !important;
    border-color: #22C55E !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
}

.teacher-tab-btn .tab-btn-icon {
    font-size: 17px;
    line-height: 1;
}

.teacher-tab-btn .tab-btn-text {
    font-weight: 700;
    white-space: nowrap !important;
}

.teacher-tab-pane {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.teacher-tab-pane.active {
    display: block;
    animation: teacherTabInstant 0.1s ease-out;
}

@keyframes teacherTabInstant {
    from {
        opacity: 0.85;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 540px) {
    .teacher-tabs-nav {
        gap: 6px;
        padding: 5px;
    }
    .teacher-tab-btn {
        padding: 9px 8px;
        font-size: 12.5px;
        gap: 5px;
    }
    .teacher-tab-btn .tab-btn-icon {
        font-size: 15px;
    }
}

/*
==================================================
   MODULAR FUNCTIONS & SAAS PACKAGE QUOTA STYLES
==================================================
*/

/* Active Plan Badge Pill */
.package-plan-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(27, 94, 32, 0.12), rgba(255, 179, 0, 0.15));
    border: 1.5px solid rgba(27, 94, 32, 0.25);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary, #1B5E20);
}

.package-plan-badge-pill.plan-basic {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.3);
    color: #475569;
}

.package-plan-badge-pill.plan-standard {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563EB;
}

.package-plan-badge-pill.plan-premium {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.2));
    border-color: rgba(217, 119, 6, 0.4);
    color: #B45309;
}

/* Quota Overview Card */
.functions-quota-card {
    background: var(--bg-surface, #F8FAFC);
    border: 1.5px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.02));
}

.quota-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.quota-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quota-label {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
}

.quota-counter {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary, #1B5E20);
    background: var(--bg-card, #FFFFFF);
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #CBD5E1);
}

.quota-limit-box {
    display: flex;
    align-items: center;
}

.quota-limit-tag {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--bg-hover, #F1F5F9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #CBD5E1);
}

.quota-progress-track {
    width: 100%;
    height: 10px;
    background: var(--border-color, #E2E8F0);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.quota-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #1B5E20), var(--accent, #FFB300));
    border-radius: 10px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.35s ease;
}

.quota-progress-bar.limit-reached {
    background: linear-gradient(90deg, #F59E0B, #EF4444);
}

.quota-subtext {
    font-size: 12.5px;
    color: var(--text-muted, #64748B);
    margin: 0;
    line-height: 1.5;
}

/* Quota Alert Banner */
.function-quota-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #FFFBEB;
    border: 1.5px solid #FCD34D;
    border-left: 5px solid #F59E0B;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    animation: alertSlideDown 0.25s ease-out;
}

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

.alert-banner-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.alert-banner-content {
    flex: 1;
}

.alert-banner-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #B45309;
    margin: 0 0 4px 0;
}

.alert-banner-desc {
    font-size: 12.5px;
    color: #92400E;
    margin: 0;
    line-height: 1.5;
}

.alert-banner-close {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #92400E;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* Functions Grid Header */
.function-selection-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
}

.function-section-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin: 0 0 3px 0;
}

.function-section-desc {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    margin: 0;
}

.function-section-count-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(27, 94, 32, 0.1);
    color: var(--primary, #1B5E20);
    border: 1px solid rgba(27, 94, 32, 0.2);
}

/* Function Selection Grid */
.function-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* Individual Function Selection Card */
.function-select-card {
    background: var(--bg-card, #FFFFFF);
    border: 1.5px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.function-select-card:hover {
    border-color: var(--primary, #1B5E20);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0,0,0,0.04));
}

.function-select-card.active {
    border-color: var(--primary, #1B5E20);
    background: linear-gradient(180deg, var(--bg-card, #FFFFFF), rgba(27, 94, 32, 0.04));
    box-shadow: 0 0 0 1px var(--primary, #1B5E20);
}

.function-select-card.disabled-locked {
    opacity: 0.65;
    background: var(--bg-surface, #F8FAFC);
    cursor: not-allowed;
    border-style: dashed;
}

.function-select-card.disabled-locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color, #E2E8F0);
}

.function-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.function-card-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.function-card-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.function-card-title-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin: 0;
}

.function-card-desc {
    font-size: 12.5px;
    color: var(--text-secondary, #475569);
    line-height: 1.45;
    margin: 0 0 12px 0;
    flex: 1;
}

.function-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #F1F5F9);
}

.function-status-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #64748B);
}

.function-select-card.active .function-status-label {
    color: var(--primary, #1B5E20);
    font-weight: 700;
}

/* Modern iOS / Material Style Toggle Switch */
.function-switch-ui {
    position: relative;
    width: 44px;
    height: 24px;
    background: #CBD5E1;
    border-radius: 24px;
    transition: background-color 0.25s ease;
    flex-shrink: 0;
    pointer-events: none; /* Let parent card handle click */
}

.function-switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.function-select-card.active .function-switch-ui {
    background: var(--primary, #1B5E20);
}

.function-select-card.active .function-switch-handle {
    transform: translateX(20px);
}

/* Super Admin Package Badge & Controls */
.sa-pkg-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.sa-pkg-pill.sa-pkg-basic {
    background: #F1F5F9;
    color: #475569;
    border-color: #CBD5E1;
}

.sa-pkg-pill.sa-pkg-standard {
    background: #EFF6FF;
    color: #1D4ED8;
    border-color: #BFDBFE;
}

.sa-pkg-pill.sa-pkg-premium {
    background: #FEF3C7;
    color: #B45309;
    border-color: #FDE68A;
}
/* sa-btn-package unified in SUPER ADMIN INSTITUTION CARDS & GRID section */


@media (max-width: 640px) {
    .function-selection-grid {
        grid-template-columns: 1fr;
    }
    .quota-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/*
==================================================
       TARGETED NOTIFICATION SYSTEM STYLING
==================================================
*/

.notification-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.notification-bell-btn:active {
    transform: scale(0.92);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #1B5E20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.notif-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: notifFadeIn 0.2s ease-out;
}

@keyframes notifFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notif-modal-box {
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: notifSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

[data-theme="dark"] .notif-modal-box {
    background: #0F172A;
    border-color: #334155;
}

.notif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-surface, #FFFFFF);
    gap: 12px;
}

[data-theme="dark"] .notif-modal-header {
    background: #0F172A;
    border-color: #334155;
}

.notif-modal-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.notif-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.notif-modal-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}

.notif-modal-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 0;
}

.notif-modal-title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin: 0;
    white-space: nowrap !important;
    line-height: 1.3;
}

[data-theme="dark"] .notif-modal-title {
    color: #F8FAFC;
}

.notif-modal-subtitle {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    margin: 2px 0 0 0;
    white-space: nowrap !important;
    line-height: 1.3;
}

.notif-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notif-modal-actions .btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.notif-close-btn-mobile {
    display: none !important;
}

.notif-close-btn-desktop {
    display: flex !important;
}

@media (max-width: 540px) {
    #notification-modal .notif-modal-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    #notification-modal .notif-modal-header-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    #notification-modal .notif-modal-actions {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    #notification-modal .notif-close-btn-mobile {
        display: flex !important;
    }

    #notification-modal .notif-close-btn-desktop {
        display: none !important;
    }
}

.notif-close-btn {
    background: var(--bg-hover, #F1F5F9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-close-btn:hover {
    background: #EF4444;
    color: #FFFFFF;
}

[data-theme="dark"] .notif-close-btn {
    background: #1E293B;
    color: #94A3B8;
}

.notif-filter-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-hover, #F8FAFC);
    overflow-x: auto;
    scrollbar-width: none;
}

[data-theme="dark"] .notif-filter-tabs {
    background: #141E30;
    border-color: #334155;
}

.notif-tab-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #64748B);
    cursor: pointer;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease;
}

.notif-tab-btn.active {
    background: var(--primary, #1B5E20);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(27, 94, 32, 0.25);
}

[data-theme="dark"] .notif-tab-btn.active {
    background: #16A34A;
}

.notif-items-scroll {
    padding: 12px 18px;
    overflow-y: auto;
    max-height: calc(85vh - 150px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: none;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.notif-item:hover {
    border-color: var(--primary, #1B5E20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .notif-item {
    background: #1E293B;
    border-color: #334155;
}

.notif-item.unread {
    background: #F0FDF4;
    border-color: #86EFAC;
}

[data-theme="dark"] .notif-item.unread {
    background: rgba(22, 163, 74, 0.15);
    border-color: #16A34A;
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
}

.notif-item-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover, #F1F5F9);
}

[data-theme="dark"] .notif-item-icon {
    background: #0F172A;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.notif-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin: 0;
}

[data-theme="dark"] .notif-item-title {
    color: #F8FAFC;
}

.notif-item-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.notif-item-badge.urgent {
    background: #FEE2E2;
    color: #DC2626;
}

.notif-item-badge.fees {
    background: #FEF3C7;
    color: #B45309;
}

.notif-item-badge.exam {
    background: #E0E7FF;
    color: #4338CA;
}

.notif-item-badge.general {
    background: #E2E8F0;
    color: #475569;
}

.notif-item-msg {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin: 0 0 6px 0;
    line-height: 1.45;
}

[data-theme="dark"] .notif-item-msg {
    color: #CBD5E1;
}

.notif-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted, #94A3B8);
}

.send-notif-box {
    max-width: 520px;
}

.send-notif-form {
    padding: 16px 20px;
}

/*
==================================================
        GUARDIAN PORTAL DEDICATED STYLING
==================================================
*/

.guardian-child-card {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    border-radius: 18px;
    padding: 20px;
    color: #FFFFFF;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(27, 94, 32, 0.25);
}

.guardian-child-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guardian-child-avatar {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.guardian-child-info {
    flex: 1;
}

.guardian-child-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #FFFFFF;
}

.guardian-child-meta {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 8px 0;
    opacity: 0.95;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guardian-child-meta .meta-line {
    display: block;
    white-space: nowrap;
}

.guardian-child-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.guardian-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

@media (max-width: 640px) {
    .guardian-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .guardian-kpi-card {
        padding: 12px 10px;
        gap: 10px;
    }
    .guardian-kpi-icon {
        width: 38px;
        height: 38px;
        font-size: 19px;
    }
    .guardian-kpi-label {
        font-size: 11px;
    }
    .guardian-kpi-val {
        font-size: 15px;
    }
}

.guardian-kpi-card {
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .guardian-kpi-card {
    background: #141E30;
    border-color: #334155;
}

.guardian-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.guardian-kpi-label {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    display: block;
    margin-bottom: 4px;
}

.guardian-kpi-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    margin: 0;
}

[data-theme="dark"] .guardian-kpi-val {
    color: #F8FAFC;
}

.guardian-actions-section {
    margin-bottom: 24px;
}

.guardian-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.guardian-action-btn {
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.guardian-action-btn:hover {
    border-color: var(--primary, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .guardian-action-btn {
    background: #141E30;
    border-color: #334155;
}

.guardian-action-icon {
    font-size: 28px;
}

.guardian-action-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

[data-theme="dark"] .guardian-action-text {
    color: #F8FAFC;
}

.guardian-action-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.25);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

[data-theme="dark"] .guardian-action-badge {
    background: rgba(59, 130, 246, 0.22);
    color: #93C5FD;
    border-color: rgba(147, 197, 253, 0.3);
}

.guardian-recent-alerts-box {
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 22px;
}

[data-theme="dark"] .guardian-recent-alerts-box {
    background: #141E30;
    border-color: #334155;
}

.guardian-alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.guardian-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/*
==================================================
        GUARDIAN DEDICATED CHILD MODALS CSS
==================================================
*/

.guardian-modal-box {
    max-width: 620px;
}

.guardian-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    max-height: calc(85vh - 130px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Attendance Quick KPI Chips */
.guardian-att-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 540px) {
    .guardian-att-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.guardian-att-kpi-chip {
    background: var(--bg-hover, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

[data-theme="dark"] .guardian-att-kpi-chip {
    background: #1E293B;
    border-color: #334155;
}

.guardian-att-kpi-chip.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}

.guardian-att-kpi-chip.success .kpi-chip-val {
    color: #10B981;
}

.guardian-att-kpi-chip.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.guardian-att-kpi-chip.danger .kpi-chip-val {
    color: #EF4444;
}

.guardian-att-kpi-chip.highlight {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.guardian-att-kpi-chip.highlight .kpi-chip-val {
    color: #3B82F6;
}

.kpi-chip-label {
    font-size: 11.5px;
    color: var(--text-muted, #64748B);
    white-space: nowrap !important;
}

.kpi-chip-val {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    white-space: nowrap !important;
}

[data-theme="dark"] .kpi-chip-val {
    color: #F8FAFC;
}

/* Fees Summary Cards */
.guardian-fees-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 560px) {
    .guardian-fees-summary-grid {
        grid-template-columns: 1fr;
    }
}

.guardian-fee-card {
    background: var(--bg-hover, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

[data-theme="dark"] .guardian-fee-card {
    background: #1E293B;
    border-color: #334155;
}

.guardian-fee-card.highlight {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.fee-card-label {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    white-space: nowrap !important;
}

.fee-card-amount {
    font-size: 16.5px;
    font-weight: 800;
    margin: 0;
    white-space: nowrap !important;
}

/* Guardian List Section & Scroll Area */
.guardian-list-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guardian-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guardian-section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    margin: 0;
}

[data-theme="dark"] .guardian-section-title {
    color: #F8FAFC;
}

.guardian-date-badge {
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bg-hover, #E2E8F0);
    color: var(--text-secondary, #475569);
    font-weight: 600;
}

[data-theme="dark"] .guardian-date-badge {
    background: #334155;
    color: #CBD5E1;
}

.guardian-scroll-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.guardian-record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 10px;
    gap: 10px;
}

[data-theme="dark"] .guardian-record-item {
    background: #141E30;
    border-color: #334155;
}

.record-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.record-item-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.record-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    white-space: nowrap !important;
}

[data-theme="dark"] .record-item-title {
    color: #F8FAFC;
}

.record-item-sub {
    font-size: 11.5px;
    color: var(--text-muted, #64748B);
    white-space: nowrap !important;
}

.record-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.guardian-status-tag {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap !important;
}

.guardian-status-tag.present {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.guardian-status-tag.absent {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.guardian-status-tag.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.guardian-status-tag.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.guardian-status-tag.resolved {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

/* Exam Marks Table */
.guardian-marks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.guardian-marks-table th,
.guardian-marks-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #E2E8F0);
    text-align: left;
}

[data-theme="dark"] .guardian-marks-table th,
[data-theme="dark"] .guardian-marks-table td {
    border-color: #334155;
}

.guardian-marks-table th {
    background: var(--bg-hover, #F8FAFC);
    font-weight: 700;
    color: var(--text-secondary, #475569);
    white-space: nowrap !important;
}

[data-theme="dark"] .guardian-marks-table th {
    background: #1E293B;
    color: #CBD5E1;
}

.admit-card-preview-box {
    background: var(--bg-surface, #FFFFFF);
    border: 2px dashed var(--border-color, #CBD5E1);
    border-radius: 14px;
    padding: 16px;
}

[data-theme="dark"] .admit-card-preview-box {
    background: #141E30;
    border-color: #334155;
}

