@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* ☀️ MASTER LIGHT MODE DESIGN TOKENS */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-soft: #EEF2FF;
    --primary-light: #6366F1;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #F43F5E;
    --info: #0EA5E9;
    
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F1F5F9;
    --border-color: #E2E8F0;
    --border-focus: #4F46E5;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    --header-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --dark-nav-bg: #0F172A;
    
    --body-bg: #F8FAFC;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: #E2E8F0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --white-overlay-02: rgba(0, 0, 0, 0.02);
    --white-overlay-03: rgba(0, 0, 0, 0.03);
    --white-overlay-04: rgba(0, 0, 0, 0.04);
    --white-overlay-05: rgba(0, 0, 0, 0.05);
    --white-overlay-07: rgba(0, 0, 0, 0.07);
    --white-overlay-08: rgba(0, 0, 0, 0.08);
    --white-overlay-10: rgba(0, 0, 0, 0.1);
    --white-overlay-15: rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"], html[data-theme="dark"] {
    /* 🌙 MASTER DARK MODE DESIGN TOKENS */
    --bg-main: #0B0F19;
    --bg-surface: #151D30;
    --bg-surface-hover: #1E2942;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366F1;
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --header-bg: rgba(15, 23, 42, 0.95);
    --card-bg: #151D30;
    --sidebar-bg: #0D1322;
    --dark-nav-bg: #0B0F19;
    
    --body-bg: #0B0F19;
    --glass-bg: rgba(21, 29, 48, 0.95);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --white-overlay-02: rgba(255, 255, 255, 0.02);
    --white-overlay-03: rgba(255, 255, 255, 0.03);
    --white-overlay-04: rgba(255, 255, 255, 0.04);
    --white-overlay-05: rgba(255, 255, 255, 0.05);
    --white-overlay-07: rgba(255, 255, 255, 0.07);
    --white-overlay-08: rgba(255, 255, 255, 0.08);
    --white-overlay-10: rgba(255, 255, 255, 0.1);
    --white-overlay-15: rgba(255, 255, 255, 0.15);
}

/* ── PRODUCTION EDTECH DESIGN SYSTEM ────────────────────────────────── */
.profile-dropdown-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    padding: 0.75rem;
    width: 250px;
}
.profile-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.profile-dropdown-link:hover {
    background: var(--white-overlay-05, rgba(0,0,0,0.04));
    transform: translateX(4px);
}
.pdl-icon-blue { background: rgba(99, 102, 241, 0.12); color: #6366f1; border-radius: 0.6rem; padding: 0.5rem; display: inline-flex; align-items: center; justify-content: center; }
.pdl-icon-yellow { background: rgba(245, 158, 11, 0.12); color: #d97706; border-radius: 0.6rem; padding: 0.5rem; display: inline-flex; align-items: center; justify-content: center; }
.pdl-icon-red { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-radius: 0.6rem; padding: 0.5rem; display: inline-flex; align-items: center; justify-content: center; }

.hero-banner-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    border-radius: 1.75rem;
    padding: 2.25rem 2.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.25);
    margin-bottom: 2rem;
}
.hero-module-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.hero-module-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.game-poster-card {
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.game-poster-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 45px rgba(0,0,0,0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--body-bg) !important;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Global Aurora Mesh Orbs style fallback for all dashboards */
.bg-orbs {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(120px);
    opacity: 0.16; mix-blend-mode: var(--orb-mix-blend); animation: auroraOrbitGlobal 30s infinite linear;
}
.bg-orbs::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 80%);
    top: -10%; left: 15%;
}
.bg-orbs::after {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 80%);
    bottom: -5%; right: 10%;
    animation-duration: 25s; animation-direction: reverse;
}
@keyframes auroraOrbitGlobal {
  0% { transform: rotate(0deg) translate(0px, 0px) scale(1); }
  50% { transform: rotate(180deg) translate(40px, -20px) scale(1.1); }
  100% { transform: rotate(360deg) translate(0px, 0px) scale(1); }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #818cf8;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Header & Navigation */
header {
    background: var(--header-bg, rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Class Filter & Books Grid */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.book-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-xl);
}

.book-cover-wrapper {
    position: relative;
    padding-top: 133%; /* 3:4 aspect ratio */
    background: var(--bg-surface, #ffffff);
    overflow: hidden;
}

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.class-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Forms & Login Page */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #86efac;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Dashboards / Sidebar Layout */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius-md);
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
}

.main-content {
    flex-grow: 1;
    padding: 1.25rem 1.5rem 3rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CRUD Tables */
.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--white-overlay-02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-student { background: rgba(16, 185, 129, 0.15); color: #86efac; }
.badge-teacher { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-admin { background: rgba(245, 158, 11, 0.15); color: #fde047; }

/* Book Viewer specific styling */
.viewer-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #090d16;
}

.viewer-header {
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.viewer-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem;
    overflow: hidden;
}

.page-container {
    display: flex;
    gap: 1rem;
    max-width: 90%;
    max-height: 80vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    perspective: 1500px;
}

.viewer-page {
    background: white;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 78vh;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: left center;
}

.viewer-page img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(21, 29, 48, 0.8);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.25s ease;
}

.nav-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

.viewer-footer {
    height: 70px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 600px;
    height: 6px;
    background: var(--bg-main);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    width: 0%;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.page-input {
    width: 55px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #0f172a) !important;
    font-weight: 700;
    text-align: center;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--header-bg, rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem 3rem;
    width: 90%;
    max-width: 550px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: white;
}

/* Responsiveness */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    .main-content {
        padding: 1.5rem;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .page-container {
        flex-direction: column;
        align-items: center;
    }
    .viewer-page {
        max-height: 38vh;
    }
}

/* ==========================================================================
   Teacher Mode Layout & Annotations Overlay Styles
   ========================================================================== */

.viewer-layout-teach {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.viewer-layout-teach .viewer-container {
    flex: 1;
    height: 100%;
}

.teach-banner {
    background: #0c1220;
    border-bottom: 2px solid #10b981;
    color: #f8fafc;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.teach-banner span {
    color: #10b981;
    font-weight: 700;
}

.teach-sidebar {
    width: 320px;
    background: #0c1220;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Auto-hide by default: slide off right edge */
    transform: translateX(100%);
    margin-right: -320px;
    position: relative;
    z-index: 500;
}

/* When revealed */
.teach-sidebar.sidebar-open {
    transform: translateX(0) !important;
    margin-right: 0 !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.8) !important;
    height: 100vh !important;
}

.teach-sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.teach-sidebar-body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-section h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.color-picker {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease;
}

.color-swatch.active {
    border-color: #ffffff;
    transform: scale(1.15);
}

.btn-tool {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.btn-tool:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-muted);
}

.btn-tool.active {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

/* Page Overlay and Canvas style annotations */
.page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    transform-origin: top left;
}

.page-overlay.active-events {
    pointer-events: auto;
    cursor: crosshair;
}

/* Highlighter element */
.highlight-rect {
    position: absolute;
    opacity: 0.45;
    mix-blend-mode: multiply;
    pointer-events: none;
    border-radius: 2px;
}

/* Sticky notes */
.sticky-note-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    background: #fbbf24;
    border: 2px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    transform: translate(-50%, -100%) rotate(-45deg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    z-index: 12;
    transition: transform 0.15s ease;
}

.sticky-note-marker:hover {
    transform: translate(-50%, -100%) rotate(-45deg) scale(1.2);
}

.sticky-note-marker span {
    transform: rotate(45deg);
    font-size: 0.85rem;
    display: block;
}

.sticky-note-popup {
    position: absolute;
    background: #1e293b;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    z-index: 25;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    transform: translate(-50%, -115%);
}

.sticky-note-popup textarea {
    width: 100%;
    height: 65px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    resize: none;
    font-size: 0.8rem;
    font-family: inherit;
}

.sticky-note-popup textarea:focus {
    outline: none;
    border-color: var(--primary-light);
}

.sticky-note-popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

/* Laser pointer */
.laser-pointer-cursor {
    position: fixed;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 16px 8px rgba(239, 68, 68, 0.85);
    transform: translate(-50%, -50%);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.page-overlay.laser-active {
    pointer-events: auto;
    cursor: none !important;
}

.page-overlay.laser-active * {
    cursor: none !important;
}

/* Sidebar History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.history-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-muted);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 0.15rem;
}

.history-item-text {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Immersive Reader Controls Auto-Hide & Screen Protection
   ========================================================================== */

.viewer-header, .viewer-footer {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
}

.viewer-container.hide-controls .viewer-header,
.viewer-layout-teach.hide-controls .viewer-header {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.viewer-container.hide-controls .viewer-footer,
.viewer-layout-teach.hide-controls .viewer-footer {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Slide out teacher sidebar and collapse its column footprint manually */
.viewer-layout-teach.hide-sidebar .teach-sidebar {
    transform: translateX(100%) !important;
    margin-right: -320px !important;
}

/* Tongue button — FIXED to right edge, always visible including fullscreen */
.sidebar-tongue-btn {
    position: fixed !important;
    right: 0;
    top: 45%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, #10b981, #059669);
    color: white;
    border: none;
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 0.85rem 0.4rem;
    cursor: pointer;
    /* Above fullscreen layer */
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: -4px 4px 16px rgba(0,0,0,0.45);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease;
    width: 32px;
    line-height: 1.15;
    border-left: 2px solid rgba(255,255,255,0.2);
    border-top: 2px solid rgba(255,255,255,0.2);
    border-bottom: 2px solid rgba(255,255,255,0.2);
}
.sidebar-tongue-btn:hover {
    background: linear-gradient(180deg, #059669, #047857);
    box-shadow: -6px 4px 20px rgba(16,185,129,0.5);
}
.sidebar-tongue-btn span.tongue-v-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

/* Tongue position: sidebar OPEN → tongue sits at left edge of sidebar (320px from right) */
.sidebar-tongue-btn.sidebar-is-open {
    right: 320px;
}
/* Tongue position: sidebar CLOSED → tongue at screen right edge */
.sidebar-tongue-btn:not(.sidebar-is-open) {
    right: 0;
}

/* Book binder spiral rings center spine overlay */
.book-binder {
    position: absolute;
    top: 0;
    left: 50%;
    width: 14px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 15;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0.18) 100%);
}
.binder-ring {
    width: 24px;
    height: 8px;
    background: linear-gradient(180deg, #f3f4f6 0%, #9ca3af 45%, #4b5563 90%, #1f2937 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
    border: 1px solid #4b5563;
    position: absolute;
    left: -5px; /* center it */
}

/* Allow reader container flex space transitions */
.viewer-container {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, flex 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Blur textbook pages on browser window blur to prevent screenshot crops */
.page-container {
    transition: filter 0.25s ease !important;
}

/* Prevent text selections & drag actions globally inside book viewer */
body, img, .viewer-page, .page-overlay, .page-container {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    user-drag: none !important;
}

/* Roster student items */
.roster-student-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}
.roster-student-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary);
}
.roster-student-item.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
    font-weight: 600;
}

/* Glassmorphic Study Dashboard Modal Overlay */
.study-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}
.study-modal-content {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}
.study-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0c1220;
}
.study-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.study-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.15s ease;
}
.study-modal-close:hover {
    color: #ef4444;
}
.study-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.modal-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    text-align: center;
}
.modal-stat-card .stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}
.modal-stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.modal-action-bar {
    margin-top: 0.25rem;
}
.modal-books-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.modal-book-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    align-items: center;
    transition: background 0.15s ease;
}
.modal-book-card:hover {
    background: var(--bg-surface-hover);
}
.modal-book-cover {
    width: 48px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}
.modal-book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.modal-book-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-book-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ============================================================
   DESIGN SYSTEM EXPANSION — Joy Forever Education Portal
   ============================================================ */

/* ── Extended Tokens ─────────────────────────────────────── */
:root {
  --emerald:#10b981;--cyan:#06b6d4;--violet:#8b5cf6;--rose:#f43f5e;--amber:#f59e0b;--gold:#eab308;
  --grad-emerald:linear-gradient(135deg,#10b981,#059669);
  --grad-cyan:linear-gradient(135deg,#06b6d4,#0284c7);
  --grad-violet:linear-gradient(135deg,#8b5cf6,#6d28d9);
  --grad-rose:linear-gradient(135deg,#f43f5e,#e11d48);
  --grad-amber:linear-gradient(135deg,#f59e0b,#d97706);
  --grad-gold:linear-gradient(135deg,#eab308,#ca8a04);
  --sidebar-w:260px;--header-h:64px;
  --transition:all 0.25s cubic-bezier(0.4,0,0.2,1);
  --glass-bg:var(--bg-surface, #ffffff);
  --glass-border:var(--border-color);
  --glass-blur:blur(20px);
}

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
@keyframes fadeInDown{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideInLeft{from{opacity:0;transform:translateX(-30px)}to{opacity:1;transform:translateX(0)}}
@keyframes slideInRight{from{opacity:0;transform:translateX(30px)}to{opacity:1;transform:translateX(0)}}
@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
@keyframes pulseRing{0%{transform:scale(0.8);opacity:1}100%{transform:scale(2.4);opacity:0}}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
@keyframes spinAnim{to{transform:rotate(360deg)}}
@keyframes toastIn{from{opacity:0;transform:translateX(120%)}to{opacity:1;transform:translateX(0)}}
@keyframes toastOut{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(120%)}}
@keyframes rippleAnim{to{transform:scale(4);opacity:0}}
@keyframes gradShift{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes countUp{from{opacity:0;transform:scale(0.7)}to{opacity:1;transform:scale(1)}}
@keyframes orbFloat{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(30px,-20px) scale(1.05)}66%{transform:translate(-20px,15px) scale(0.97)}}

/* ── Animation Utilities ─────────────────────────────────── */
.fade-in-up{animation:fadeInUp 0.5s ease forwards;}
.fade-in-down{animation:fadeInDown 0.5s ease forwards;}
.slide-in-left{animation:slideInLeft 0.4s ease forwards;}
.slide-in-right{animation:slideInRight 0.4s ease forwards;}
.d1{animation-delay:.05s}.d2{animation-delay:.1s}.d3{animation-delay:.15s}
.d4{animation-delay:.2s}.d5{animation-delay:.25s}.d6{animation-delay:.3s}
.float-anim{animation:float 3s ease-in-out infinite;}
.spin{animation:spinAnim 1s linear infinite;}

/* ── Glass Card ─────────────────────────────────────────── */
.glass-card{
  background: linear-gradient(135deg, var(--white-overlay-03), rgba(255, 255, 255, 0.01)), var(--glass-bg);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  border:1px solid var(--glass-border);border-radius:1.25rem;
  transition:all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.glass-card:hover{
  border-color:rgba(255,255,255,0.14);
  transform:translateY(-3px);
  box-shadow:0 24px 48px rgba(0,0,0,0.45);
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card{
  background: linear-gradient(135deg, var(--white-overlay-03), rgba(255, 255, 255, 0.01)), var(--glass-bg);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  border:1px solid var(--glass-border);border-radius:1.25rem;padding:1.5rem;
  position:relative;overflow:hidden;
  transition:all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor:default;
}
.stat-card::before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,var(--white-overlay-03) 0%,transparent 100%);pointer-events:none;}
.stat-card:hover{
  transform:translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow:0 24px 50px rgba(0,0,0,0.45), 0 0 15px rgba(99, 102, 241, 0.1);
}
.stat-card-icon{width:48px;height:48px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:1.4rem;margin-bottom:1rem;background:var(--white-overlay-07);border: 1px solid rgba(255,255,255,0.06);}
.stat-card-value{font-size:2.2rem;font-weight:900;font-family:'Outfit',sans-serif;line-height:1;margin-bottom:.35rem;letter-spacing:-0.04em;}
.stat-card-label{font-size:.78rem;color:var(--text-secondary);font-weight:750;text-transform:uppercase;letter-spacing:.08em;}
.stat-card-change{font-size:.75rem;font-weight:700;margin-top:.6rem;display:flex;align-items:center;gap:.3rem;}
.stat-card-change.up{color:var(--emerald);}
.stat-card-change.down{color:var(--rose);}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.25rem;margin-bottom:2rem;}

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton{
  background:linear-gradient(90deg,var(--white-overlay-05) 25%,var(--white-overlay-10) 50%,var(--white-overlay-05) 75%);
  background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:var(--radius-md);
}
.skeleton-text{height:14px;margin-bottom:8px;}
.skeleton-title{height:24px;width:60%;margin-bottom:12px;}
.skeleton-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;}
.skeleton-card{height:120px;border-radius:1.25rem;}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container{position:fixed;bottom:1.5rem;right:1.5rem;z-index:9999;display:flex;flex-direction:column;gap:.6rem;pointer-events:none;}
.toast{
  display:flex;align-items:center;gap:.75rem;padding:.85rem 1.25rem;border-radius:1rem;
  font-size:.88rem;font-weight:600;min-width:280px;max-width:380px;
  backdrop-filter:blur(20px);border:1px solid var(--white-overlay-10);
  box-shadow:0 8px 32px rgba(0,0,0,0.4);
  animation:toastIn .35s cubic-bezier(0.16,1,.3,1) forwards;pointer-events:all;
}
.toast.hiding{animation:toastOut .3s ease forwards;}
.toast.success{background:rgba(16,185,129,.15);border-color:rgba(16,185,129,.3);color:#6ee7b7;}
.toast.error{background:rgba(239,68,68,.15);border-color:rgba(239,68,68,.3);color:#fca5a5;}
.toast.warning{background:rgba(245,158,11,.15);border-color:rgba(245,158,11,.3);color:#fcd34d;}
.toast.info{background:rgba(79,70,229,.15);border-color:rgba(79,70,229,.3);color:#a5b4fc;}
.toast-icon{font-size:1.1rem;flex-shrink:0;}
.toast-close{margin-left:auto;cursor:pointer;opacity:.6;font-size:1rem;border:none;background:none;color:inherit;}

/* ── Badges & Chips ─────────────────────────────────────── */
.badge{display:inline-flex;align-items:center;gap:.3rem;padding:.2rem .65rem;border-radius:50px;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.badge-success{background:rgba(16,185,129,.12);color:#10b981;border:1px solid rgba(16,185,129,.25);}
.badge-danger{background:rgba(239,68,68,.12);color:#ef4444;border:1px solid rgba(239,68,68,.25);}
.badge-warning{background:rgba(245,158,11,.12);color:#f59e0b;border:1px solid rgba(245,158,11,.25);}
.badge-primary{background:rgba(79,70,229,.12);color:#818cf8;border:1px solid rgba(79,70,229,.25);}
.badge-cyan{background:rgba(6,182,212,.12);color:#06b6d4;border:1px solid rgba(6,182,212,.25);}
.badge-violet{background:rgba(139,92,246,.12);color:#a78bfa;border:1px solid rgba(139,92,246,.25);}

/* ── Ripple Button ─────────────────────────────────────── */
.ripple{position:relative;overflow:hidden;}
.ripple-effect{position:absolute;border-radius:50%;background:rgba(255,255,255,0.3);transform:scale(0);animation:rippleAnim .6s linear;pointer-events:none;}

/* ── Modern Table ─────────────────────────────────────── */
.modern-table-wrap{overflow-x:auto;border-radius:1rem;border:1px solid var(--glass-border);}
.modern-table{width:100%;border-collapse:collapse;font-size:.85rem;}
.modern-table thead th{padding:1rem 1.25rem;text-align:left;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);background:rgba(255,255,255,.03);border-bottom:1px solid var(--glass-border);white-space:nowrap;}
.modern-table thead th.sortable{cursor:pointer;user-select:none;}
.modern-table thead th.sortable:hover{color:var(--text-primary);}
.modern-table tbody tr{border-bottom:1px solid rgba(255,255,255,.04);transition:background .15s;}
.modern-table tbody tr:last-child{border-bottom:none;}
.modern-table tbody tr:hover{background:rgba(255,255,255,.03);}
.modern-table td{padding:.85rem 1.25rem;color:var(--text-secondary);vertical-align:middle;}
.table-avatar{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem;color:#fff;flex-shrink:0;}
.table-user-cell{display:flex;align-items:center;gap:.75rem;}
.table-user-name{font-weight:600;color:var(--text-primary);font-size:.88rem;}
.table-user-sub{font-size:.72rem;color:var(--text-muted);}
.table-action-btn{width:32px;height:32px;border-radius:8px;border:1px solid var(--glass-border);background:rgba(255,255,255,.04);color:var(--text-secondary);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:.85rem;transition:var(--transition);}
.table-action-btn:hover{background:rgba(255,255,255,.1);color:var(--text-primary);}
.table-search-row{display:flex;gap:.75rem;margin-bottom:1.25rem;flex-wrap:wrap;}
.table-search-input{flex:1;min-width:200px;background:rgba(255,255,255,.04);border:1px solid var(--glass-border);color:var(--text-primary);border-radius:.75rem;padding:.6rem 1rem;font-size:.85rem;outline:none;font-family:inherit;}
.table-search-input:focus{border-color:var(--primary-light);}
.table-filter-select{background:rgba(255,255,255,.04);border:1px solid var(--glass-border);color:var(--text-primary);border-radius:.75rem;padding:.6rem .9rem;font-size:.85rem;outline:none;font-family:inherit;cursor:pointer;}
.table-filter-select option{background:var(--bg-surface, #ffffff);}

/* ── Verification Warning Bar ─────────────────────────── */
.verify-warning-bar{
  position:sticky;top:0;z-index:10000;
  background:linear-gradient(90deg,#dc2626,#b91c1c,#dc2626);
  background-size:200% 100%;animation:gradShift 3s ease infinite;
  color:#fff;text-align:center;padding:.6rem 1.5rem;font-size:.82rem;font-weight:600;
  display:flex;align-items:center;justify-content:center;gap:.75rem;
  box-shadow:0 2px 20px rgba(220,38,38,.4);
}
.verify-warning-bar a{color:#fff;text-decoration:underline;font-weight:700;}
.verify-warning-bar .days-left{background:rgba(255,255,255,.2);padding:.15rem .5rem;border-radius:50px;font-size:.75rem;}

/* ── App Sidebar Layout ─────────────────────────────────── */
.app-layout{display:flex;min-height:100vh;}
.app-sidebar{
  width:var(--sidebar-w);flex-shrink:0;height:100vh;
  position:sticky;top:0;overflow-y:auto;overflow-x:hidden;
  background:rgba(8, 12, 24, 0.88);backdrop-filter:blur(30px);
  border-right:1px solid var(--glass-border);
  display:flex;flex-direction:column;
  transition:width .3s ease;z-index:100;
}
.app-sidebar.collapsed{width:72px;}
.sidebar-logo{padding:1.4rem 1.25rem;border-bottom:1px solid var(--glass-border);display:flex;align-items:center;gap:.75rem;flex-shrink:0;min-height:64px;}
.sidebar-logo-icon{font-size:1.5rem;flex-shrink:0;}
.sidebar-logo-text{font-family:'Outfit',sans-serif;font-weight:900;font-size:1.1rem;background:linear-gradient(135deg,#4f46e5,#06b6d4);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;white-space:nowrap;overflow:hidden;transition:opacity .2s;letter-spacing:-0.02em;}
.app-sidebar.collapsed .sidebar-logo-text{opacity:0;width:0;}
.sidebar-nav{padding:1rem .75rem;flex:1;display:flex;flex-direction:column;gap:.25rem;}
.sidebar-section-label{font-size:.62rem;font-weight:800;text-transform:uppercase;letter-spacing:.12em;color:var(--text-muted);padding:.75rem .5rem .25rem;white-space:nowrap;overflow:hidden;transition:opacity .2s;}
.app-sidebar.collapsed .sidebar-section-label{opacity:0;}
.sidebar-link{display:flex;align-items:center;gap:.75rem;padding:.68rem .85rem;border-radius:.75rem;font-size:.875rem;font-weight:600;color:var(--text-secondary);transition:all 0.25s;text-decoration:none;white-space:nowrap;overflow:hidden;cursor:pointer;}
.sidebar-link:hover{background:rgba(255,255,255,.05);color:var(--text-primary);transform: translateX(3px);}
.sidebar-link.active{
  background:linear-gradient(135deg, rgba(79,70,229,.16), rgba(6,182,212,.08));
  border: 1px solid rgba(79,70,229,.22);
  color:#fff;
}
.sl-icon{font-size:1.15rem;flex-shrink:0;width:20px;text-align:center;}
.sl-label{flex:1;transition:opacity .2s;}
.app-sidebar.collapsed .sl-label,.app-sidebar.collapsed .sl-badge{opacity:0;width:0;overflow:hidden;}
.sl-badge{background:var(--rose);color:#fff;font-size:.62rem;font-weight:700;padding:.15rem .45rem;border-radius:50px;flex-shrink:0;}
.sidebar-user{padding:1rem .75rem;border-top:1px solid var(--glass-border);display:flex;align-items:center;gap:.75rem;flex-shrink:0;}
.sidebar-user-avatar{width:34px;height:34px;border-radius:50%;background:var(--primary-gradient);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.85rem;color:#fff;flex-shrink:0;box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);}
.sidebar-user-name{font-size:.82rem;font-weight:700;color:var(--text-primary);white-space:nowrap;overflow:hidden;transition:opacity .2s;}
.app-sidebar.collapsed .sidebar-user-name{opacity:0;width:0;}

/* ── App Header ─────────────────────────────────────────── */
.app-main{flex:1;min-width:0;display:flex;flex-direction:column;}
.app-header{
  height:68px;flex-shrink:0;
  background:var(--header-bg, rgba(255, 255, 255, 0.85));backdrop-filter:blur(30px) saturate(150%);
  border-bottom:1px solid var(--glass-border);
  display:flex;align-items:center;gap:1rem;
  padding:0 2rem;position:sticky;top:0;z-index:99;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.header-burger{width:36px;height:36px;border-radius:.6rem;background:none;border:1px solid var(--glass-border);color:var(--text-secondary);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.1rem;transition:var(--transition);flex-shrink:0;}
.header-burger:hover{background:rgba(255,255,255,.07);color:var(--text-primary);}
.app-header-search{flex:1;max-width:360px;display:flex;align-items:center;gap:.6rem;background:rgba(4,6,15,0.7);border:1px solid var(--glass-border);border-radius:.75rem;padding:0 .85rem;height:38px;}
.app-header-search input{background:none;border:none;outline:none;color:var(--text-primary);font-size:.85rem;flex:1;font-family:inherit;}
.app-header-search input::placeholder{color:var(--text-muted);}
.header-spacer{flex:1;}
.header-icon-btn{width:38px;height:38px;border-radius:.6rem;background:rgba(255,255,255,.05);border:1px solid var(--glass-border);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--transition);color:var(--text-secondary);font-size:1.05rem;position:relative;}
.header-icon-btn:hover{background:rgba(255,255,255,.09);color:var(--text-primary);}
.header-notif-badge{position:absolute;top:-4px;right:-4px;width:18px;height:18px;background:var(--rose);border-radius:50%;font-size:.6rem;font-weight:700;color:#fff;display:flex;align-items:center;justify-content:center;border:2px solid var(--bg-main);}
.header-profile-chip{display:flex;align-items:center;gap:.6rem;padding:.3rem .85rem .3rem .35rem;background:rgba(255,255,255,.04);border:1px solid var(--glass-border);border-radius:50px;cursor:pointer;transition:var(--transition);position:relative;}
.header-profile-chip:hover{background:rgba(255,255,255,.08);}
.header-profile-avatar{width:28px;height:28px;border-radius:50%;background:var(--primary-gradient);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.72rem;color:#fff;box-shadow: 0 0 8px rgba(99,102,241,0.35);}
.header-profile-name{font-size:.82rem;font-weight:700;color:var(--text-primary);}
.profile-dropdown{position:absolute;top:calc(100% + .5rem);right:0;background:rgba(10,16,29,0.96);backdrop-filter:blur(30px);border:1px solid var(--glass-border);border-radius:1rem;padding:.5rem;min-width:200px;box-shadow:0 25px 60px rgba(0,0,0,0.55);display:none;z-index:200;}
.profile-dropdown.open{display:block;animation:fadeInDown .2s ease;}
.profile-dropdown a{display:flex;align-items:center;gap:.6rem;padding:.6rem .85rem;border-radius:.65rem;font-size:.85rem;color:var(--text-secondary);text-decoration:none;transition:var(--transition);}
.profile-dropdown a:hover{background:rgba(255,255,255,.06);color:var(--text-primary);}
.profile-dropdown .divider{height:1px;background:var(--glass-border);margin:.3rem 0;}
.profile-dropdown .logout-link{color:var(--rose) !important;}

/* ── App Content ─────────────────────────────────────────── */
.app-content{flex:1;padding:2rem 1.75rem;overflow-y:auto;}
.page-header{margin-bottom:2rem;}
.page-title{font-size:1.75rem;font-weight:800;font-family:'Outfit',sans-serif;}
.page-subtitle{color:var(--text-secondary);font-size:.9rem;margin-top:.25rem;}
.tab-panel{display:none;}
.tab-panel.active{display:block;animation:fadeInUp .3s ease;}

/* ── Charts ─────────────────────────────────────────────── */
.charts-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;margin-bottom:2rem;}
.chart-card{background:var(--glass-bg);backdrop-filter:var(--glass-blur);border:1px solid var(--glass-border);border-radius:1.25rem;padding:1.5rem;}
.chart-card-title{font-size:.9rem;font-weight:700;margin-bottom:1.25rem;color:var(--text-primary);}

/* ── Kanban Board ─────────────────────────────────────────── */
.kanban-board{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;}
.kanban-col{background:rgba(255,255,255,.02);border:1px solid var(--glass-border);border-radius:1rem;padding:1rem;min-height:400px;}
.kanban-col-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:1px solid var(--glass-border);}
.kanban-col-title{font-weight:700;font-size:.88rem;display:flex;align-items:center;gap:.5rem;}
.kanban-col-count{background:rgba(255,255,255,.08);color:var(--text-secondary);font-size:.72rem;font-weight:700;padding:.15rem .5rem;border-radius:50px;}
.kanban-card{background:var(--glass-bg);backdrop-filter:blur(12px);border:1px solid var(--glass-border);border-radius:.85rem;padding:1rem;margin-bottom:.75rem;transition:var(--transition);cursor:pointer;}
.kanban-card:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.15);box-shadow:0 8px 24px rgba(0,0,0,.3);}
.kanban-card-title{font-weight:700;font-size:.9rem;color:var(--text-primary);margin-bottom:.4rem;}
.kanban-card-meta{font-size:.73rem;color:var(--text-muted);margin-bottom:.6rem;display:flex;gap:.75rem;flex-wrap:wrap;}
.kanban-progress{height:4px;background:rgba(255,255,255,.06);border-radius:50px;overflow:hidden;}
.kanban-progress-fill{height:100%;background:var(--primary-gradient);border-radius:50px;transition:width .5s ease;}
.kanban-add-btn{width:100%;padding:.65rem;border-radius:.75rem;border:1px dashed rgba(255,255,255,.1);background:none;color:var(--text-muted);cursor:pointer;font-size:.82rem;transition:var(--transition);display:flex;align-items:center;justify-content:center;gap:.4rem;}
.kanban-add-btn:hover{border-color:var(--primary-light);color:var(--primary-light);}

/* ── Profile Settings Page ─────────────────────────────────── */
.profile-page-layout{display:grid;grid-template-columns:280px 1fr;gap:2rem;}
.profile-sidebar-card{background:var(--glass-bg);backdrop-filter:var(--glass-blur);border:1px solid var(--glass-border);border-radius:1.25rem;padding:2rem;text-align:center;position:sticky;top:calc(var(--header-h) + 1.5rem);height:fit-content;}
.profile-avatar-large{width:90px;height:90px;border-radius:50%;background:var(--primary-gradient);display:flex;align-items:center;justify-content:center;font-size:2.2rem;font-weight:800;color:#fff;margin:0 auto 1rem;box-shadow:0 8px 24px rgba(79,70,229,.35);}
.profile-name{font-size:1.1rem;font-weight:700;margin-bottom:.3rem;}
.profile-nav{margin-top:1.5rem;text-align:left;display:flex;flex-direction:column;gap:.2rem;}
.profile-nav-link{display:flex;align-items:center;gap:.65rem;padding:.65rem .85rem;border-radius:.65rem;font-size:.85rem;font-weight:500;color:var(--text-secondary);transition:var(--transition);cursor:pointer;text-decoration:none;}
.profile-nav-link:hover{background:rgba(255,255,255,.06);color:var(--text-primary);}
.profile-nav-link.active{background:rgba(79,70,229,.12);color:#818cf8;font-weight:600;}
.profile-tab-content{display:none;}
.profile-tab-content.active{display:block;animation:fadeInUp .3s ease;}
.settings-section{background:var(--glass-bg);backdrop-filter:var(--glass-blur);border:1px solid var(--glass-border);border-radius:1.25rem;padding:1.75rem;margin-bottom:1.5rem;}
.settings-section-title{font-size:1rem;font-weight:700;margin-bottom:1.25rem;display:flex;align-items:center;gap:.6rem;color:var(--text-primary);}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;}
.form-grid.three{grid-template-columns:1fr 1fr 1fr;}
.form-grid.single{grid-template-columns:1fr;}
.form-group{display:flex;flex-direction:column;gap:.4rem;}
.form-label{font-size:.78rem;font-weight:600;color:var(--text-secondary);}
.form-input{background:rgba(255,255,255,.04);border:1px solid var(--glass-border);color:var(--text-primary);border-radius:.65rem;padding:.65rem .9rem;font-size:.88rem;outline:none;transition:var(--transition);font-family:inherit;width:100%;}
.form-input:focus{border-color:var(--primary-light);box-shadow:0 0 0 3px rgba(99,102,241,.12);}
.form-input.is-valid{border-color:var(--emerald);}
.form-input.is-invalid{border-color:var(--rose);}
.form-hint{font-size:.72rem;color:var(--text-muted);}
.form-error-text{font-size:.72rem;color:var(--rose);}

/* ── Password Strength Meter ─────────────────────────────── */
.password-strength{height:4px;border-radius:50px;background:rgba(255,255,255,.08);overflow:hidden;margin-top:.4rem;}
.password-strength-fill{height:100%;border-radius:50px;transition:width .3s ease,background .3s ease;width:0;}
.strength-weak{background:var(--rose);}
.strength-fair{background:var(--amber);}
.strength-good{background:var(--cyan);}
.strength-strong{background:var(--emerald);}
.strength-label{font-size:.7rem;font-weight:600;margin-top:.25rem;}

/* ── Toggle Switch ─────────────────────────────────────── */
.toggle-switch{display:flex;align-items:center;gap:.85rem;padding:.85rem 0;border-bottom:1px solid rgba(255,255,255,.05);}
.toggle-switch:last-child{border-bottom:none;}
.toggle-info{flex:1;}
.toggle-info-title{font-size:.88rem;font-weight:600;color:var(--text-primary);}
.toggle-info-desc{font-size:.75rem;color:var(--text-muted);margin-top:.15rem;}
.toggle{position:relative;width:42px;height:24px;flex-shrink:0;}
.toggle input{opacity:0;width:0;height:0;}
.toggle-slider{position:absolute;inset:0;background:rgba(255,255,255,.1);border-radius:50px;cursor:pointer;transition:var(--transition);}
.toggle-slider::before{content:'';position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:var(--transition);}
.toggle input:checked + .toggle-slider{background:var(--emerald);}
.toggle input:checked + .toggle-slider::before{transform:translateX(18px);}

/* ── Auth Pages (Login / Signup / Forgot Password) ─────── */
.auth-bg{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--bg-main);position:relative;overflow:hidden;padding:2rem 1rem;}
.auth-orb{position:absolute;border-radius:50%;filter:blur(80px);opacity:.15;animation:orbFloat 8s ease-in-out infinite;}
.auth-orb-1{width:500px;height:500px;background:radial-gradient(circle,#4f46e5,transparent);top:-100px;left:-150px;animation-delay:0s;}
.auth-orb-2{width:400px;height:400px;background:radial-gradient(circle,#06b6d4,transparent);bottom:-80px;right:-100px;animation-delay:3s;}
.auth-orb-3{width:300px;height:300px;background:radial-gradient(circle,#8b5cf6,transparent);top:50%;left:50%;animation-delay:5s;}
.auth-card{width:100%;max-width:440px;background:rgba(21,29,48,.85);backdrop-filter:blur(30px);border:1px solid rgba(255,255,255,.1);border-radius:1.75rem;padding:2.5rem;position:relative;z-index:2;box-shadow:0 32px 80px rgba(0,0,0,.5);}
.auth-logo{text-align:center;margin-bottom:2rem;}
.auth-logo-icon{font-size:2.5rem;display:block;margin-bottom:.6rem;}
.auth-logo-name{font-family:'Outfit',sans-serif;font-size:1.5rem;font-weight:800;background:linear-gradient(135deg,#4f46e5,#06b6d4);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;}
.auth-logo-sub{font-size:.8rem;color:var(--text-muted);margin-top:.2rem;}
.auth-title{font-size:1.35rem;font-weight:700;margin-bottom:.3rem;}
.auth-subtitle{font-size:.85rem;color:var(--text-secondary);margin-bottom:2rem;}
.auth-form-group{margin-bottom:1.1rem;position:relative;}
.auth-label{display:block;font-size:.78rem;font-weight:600;color:var(--text-secondary);margin-bottom:.4rem;}
.auth-input-wrap{position:relative;}
.auth-input-icon{position:absolute;left:.9rem;top:50%;transform:translateY(-50%);color:var(--text-muted);font-size:.95rem;pointer-events:none;}
.auth-input{width:100%;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);color:var(--text-primary);border-radius:.85rem;padding:.8rem 1rem .8rem 2.75rem;font-size:.9rem;outline:none;transition:var(--transition);font-family:inherit;}
.auth-input:focus{border-color:var(--primary-light);background:rgba(255,255,255,.07);box-shadow:0 0 0 3px rgba(99,102,241,.12);}
.auth-input.is-invalid{border-color:var(--rose);}
.auth-input.is-valid{border-color:var(--emerald);}
.auth-pw-toggle{position:absolute;right:.9rem;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:.9rem;padding:.2rem;}
.auth-pw-toggle:hover{color:var(--text-primary);}
.auth-error{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.25);color:#fca5a5;border-radius:.75rem;padding:.75rem 1rem;font-size:.83rem;margin-bottom:1rem;display:flex;align-items:center;gap:.6rem;}
.auth-success{background:rgba(16,185,129,.1);border:1px solid rgba(16,185,129,.25);color:#6ee7b7;border-radius:.75rem;padding:.75rem 1rem;font-size:.83rem;margin-bottom:1rem;display:flex;align-items:center;gap:.6rem;}
.auth-btn{width:100%;background:var(--primary-gradient);color:#fff;border:none;border-radius:.85rem;padding:.9rem;font-size:.95rem;font-weight:700;cursor:pointer;transition:var(--transition);font-family:'Outfit',sans-serif;margin-top:.5rem;}
.auth-btn:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(79,70,229,.45);}
.auth-btn:active{transform:translateY(0);}
.auth-footer{text-align:center;font-size:.82rem;color:var(--text-muted);margin-top:1.5rem;}
.auth-footer a{color:var(--primary-light);font-weight:600;}
.auth-divider{display:flex;align-items:center;gap:.75rem;margin:1.25rem 0;color:var(--text-muted);font-size:.78rem;}
.auth-divider::before,.auth-divider::after{content:'';flex:1;height:1px;background:var(--glass-border);}
.step-indicator{display:flex;align-items:center;gap:.5rem;margin-bottom:2rem;justify-content:center;}
.step-dot{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.15);transition:var(--transition);}
.step-dot.active{width:24px;border-radius:50px;background:var(--primary-gradient);}
.step-dot.done{background:var(--emerald);}
.otp-inputs{display:flex;gap:.65rem;justify-content:center;margin:1.5rem 0;}
.otp-input{width:52px;height:60px;text-align:center;font-size:1.5rem;font-weight:700;background:rgba(255,255,255,.05);border:2px solid rgba(255,255,255,.1);border-radius:.85rem;color:var(--text-primary);outline:none;transition:var(--transition);}
.otp-input:focus{border-color:var(--primary-light);box-shadow:0 0 0 3px rgba(99,102,241,.12);}

/* ── Notification Center ─────────────────────────────────── */
.notif-panel{position:absolute;top:calc(100% + .5rem);right:0;width:360px;background:rgba(21,29,48,.98);backdrop-filter:blur(20px);border:1px solid var(--glass-border);border-radius:1.25rem;box-shadow:0 20px 60px rgba(0,0,0,.5);display:none;z-index:300;}
.notif-panel.open{display:block;animation:fadeInDown .2s ease;}
.notif-header{padding:1rem 1.25rem;border-bottom:1px solid var(--glass-border);display:flex;align-items:center;justify-content:space-between;}
.notif-title{font-weight:700;font-size:.95rem;}
.notif-mark-all{font-size:.75rem;color:var(--primary-light);cursor:pointer;background:none;border:none;font-family:inherit;}
.notif-item{padding:.85rem 1.25rem;border-bottom:1px solid rgba(255,255,255,.04);display:flex;align-items:flex-start;gap:.85rem;transition:background .15s;cursor:pointer;}
.notif-item:hover{background:rgba(255,255,255,.03);}
.notif-item.unread{background:rgba(79,70,229,.04);}
.notif-item-icon{font-size:1.2rem;flex-shrink:0;margin-top:.1rem;}
.notif-item-title{font-size:.83rem;font-weight:600;color:var(--text-primary);}
.notif-item-msg{font-size:.75rem;color:var(--text-muted);margin-top:.15rem;}
.notif-item-time{font-size:.68rem;color:var(--text-muted);margin-top:.2rem;}
.notif-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--primary-light);flex-shrink:0;margin-top:.35rem;}

/* ── Book Viewer ─────────────────────────────────────────── */
.book-viewer-layout{display:flex;height:100vh;overflow:hidden;}
.book-viewer-sidebar{width:260px;flex-shrink:0;background:var(--header-bg, rgba(255, 255, 255, 0.85));border-right:1px solid var(--glass-border);display:flex;flex-direction:column;transition:width .3s ease;}
.book-viewer-sidebar.collapsed{width:0;overflow:hidden;}
.book-viewer-main{flex:1;display:flex;flex-direction:column;min-width:0;}
.book-toolbar{height:56px;background:var(--header-bg, rgba(255, 255, 255, 0.85));border-bottom:1px solid var(--glass-border);display:flex;align-items:center;gap:.5rem;padding:0 1rem;flex-shrink:0;}
.toolbar-btn{height:36px;padding:0 .75rem;border-radius:.6rem;border:1px solid var(--glass-border);background:rgba(255,255,255,.04);color:var(--text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem;font-size:.82rem;font-weight:500;transition:var(--transition);white-space:nowrap;}
.toolbar-btn:hover{background:rgba(255,255,255,.09);color:var(--text-primary);}
.toolbar-btn.active{background:rgba(79,70,229,.15);border-color:rgba(79,70,229,.3);color:#818cf8;}
.toolbar-sep{width:1px;height:22px;background:var(--glass-border);margin:0 .25rem;}
.toolbar-page-info{font-size:.82rem;font-weight:600;color:var(--text-secondary);white-space:nowrap;}
.book-viewer-frame{flex:1;overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:1.5rem;background:var(--bg-main);}
.book-viewer-frame.dark-paper{background:#1a1008;}
.book-viewer-frame.sepia{background:#f4e8c1;}
.book-viewer-frame.sepia iframe,.book-viewer-frame.sepia embed{filter:sepia(0.3);}
.book-thumbnail-strip{height:80px;background:var(--header-bg, rgba(255, 255, 255, 0.85));border-top:1px solid var(--glass-border);display:flex;align-items:center;gap:.5rem;padding:0 1rem;overflow-x:auto;}

/* ── Page Transition ─────────────────────────────────────── */
.page-transition{animation:fadeInUp .4s ease;}

/* ── Mobile Responsive ─────────────────────────────────────── */
@media(max-width:1200px){
  .charts-grid{grid-template-columns:1fr;}
  .kanban-board{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:900px){
  .profile-page-layout{grid-template-columns:1fr;}
  .profile-sidebar-card{position:static;}
}
@media(max-width:768px){
  .app-sidebar{position:fixed;left:-260px;width:260px;transition:left .3s ease;z-index:200;height:100vh;}
  .app-sidebar.mobile-open{left:0;}
  .sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:199;}
  .sidebar-overlay.show{display:block;}
  .app-content{padding:1rem;}
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:.75rem;}
  .stat-card-value{font-size:1.6rem;}
  .app-header{padding:0 1rem;}
  .app-header-search{max-width:none;flex:1;}
  .kanban-board{grid-template-columns:1fr;}
  .form-grid,.form-grid.three{grid-template-columns:1fr;}
  .charts-grid{grid-template-columns:1fr;}
  .book-viewer-sidebar{display:none;}
  .book-toolbar{gap:.25rem;padding:0 .5rem;}
  .toolbar-btn span{display:none;}
}
@media(max-width:480px){
  .stats-grid{grid-template-columns:1fr;}
  .auth-card{padding:1.75rem 1.25rem;border-radius:1.25rem;}
  .otp-input{width:42px;height:50px;font-size:1.2rem;}
}

/* ── PREMIUM REDESIGN TOKENS (APPLE + LINEAR + STRIPE) ── */
.premium-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Collapsible Sidebar styling */
.premium-sidebar {
  width: 250px;
  background: var(--sidebar-bg, #ffffff);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  z-index: 400;
  flex-shrink: 0;
}
.premium-sidebar.collapsed {
  width: 72px;
}
.sidebar-logo-container {
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin-left: 0.75rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s;
}
.premium-sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  pointer-events: none;
}
.sidebar-menu {
  list-style: none;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}
.sidebar-menu::-webkit-scrollbar {
  width: 3px;
}
.sidebar-item a {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.95rem;
  border-radius: 0.75rem;
  color: var(--text-secondary);
  font-weight: 550;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sidebar-item a:hover {
  background: var(--bg-surface-hover, #f1f5f9);
  color: var(--text-primary);
  transform: translateX(2px);
}
.sidebar-item.active a {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(6, 182, 212, 0.08));
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--primary, #4f46e5);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.06);
}
.sidebar-icon {
  font-size: 1.15rem;
  width: 24px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.sidebar-label {
  margin-left: 0.75rem;
  transition: opacity 0.2s;
}
.premium-sidebar.collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* Collapsible trigger */
.sidebar-toggle-btn {
  margin: auto 0.75rem 1rem;
  padding: 0.6rem;
  border-radius: 0.5rem;
  background: var(--white-overlay-03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.sidebar-toggle-btn:hover {
  background: var(--border-color);
  color: #fff;
}

/* Aurora backgrounds */
.aurora-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-main, #f8fafc);
}
.aurora-mesh::before, .aurora-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  mix-blend-mode: var(--orb-mix-blend);
  pointer-events: none;
  animation: auroraOrbit 25s infinite linear;
}
.aurora-mesh::before {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 80%);
  top: -10%;
  left: 20%;
}
.aurora-mesh::after {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 80%);
  bottom: 0%;
  right: 15%;
  animation-duration: 35s;
  animation-direction: reverse;
}
@keyframes auroraOrbit {
  0% { transform: rotate(0deg) translate(0px, 0px) scale(1); }
  50% { transform: rotate(180deg) translate(40px, -20px) scale(1.1); }
  100% { transform: rotate(360deg) translate(0px, 0px) scale(1); }
}

/* Premium Main layout content */
.premium-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* Student Avatar Glow & Online Badge */
.premium-avatar-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.avatar-glow-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4, #10b981);
  padding: 2px;
  animation: rotateGlowRing 8s linear infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes rotateGlowRing {
  100% { transform: rotate(360deg); }
}
.avatar-status-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #080c14;
  box-shadow: 0 0 8px #10b981;
}

/* 3D Book Cover Styles */
.book-3d-wrapper {
  position: relative;
  perspective: 900px;
  cursor: pointer;
}
.book-3d-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 0.6rem;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: -8px 8px 24px rgba(0, 0, 0, 0.5);
}
.book-3d-wrapper:hover .book-3d-card {
  transform: rotateY(-15deg) rotateX(5deg) translateZ(8px);
  box-shadow: -15px 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.2);
}
.book-3d-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color);
}
.book-3d-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-3d-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, var(--white-overlay-15) 100%);
  z-index: 10;
}
.book-3d-ribbon {
  position: absolute;
  top: 0;
  left: 12px;
  width: 22px;
  height: 38px;
  background: linear-gradient(to bottom, #f43f5e, #e11d48);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
}

/* Progress Ring Component (Duolingo Style) */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.progress-ring-circle {
  transition: stroke-dashoffset 0.6s ease-in-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Dashboard metric cards upgrade */
.metric-glow-card {
  position: relative;
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--white-overlay-03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}
.metric-glow-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.1), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.metric-glow-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.08);
}
.metric-glow-card:hover::after {
  opacity: 1;
}

@media(max-width: 992px) {
  .premium-sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    bottom: 0;
    transition: left 0.3s var(--ease);
  }
  .premium-sidebar.mobile-open {
    left: 0;
  }
  .premium-sidebar.collapsed {
    width: 250px;
    left: -250px;
  }
}

/* Global Topbar/Header Search Component style */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white-overlay-05);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  height: 36px;
  max-width: 280px;
  width: 100%;
  transition: all 0.2s ease;
}
.topbar-search:focus-within {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
  background: var(--bg-surface, #ffffff);
}
.topbar-search span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.topbar-search input {
  background: none !important;
  border: none !important;
  outline: none !important;
  color: var(--text-primary) !important;
  font-size: 0.8rem;
  width: 100%;
}
.topbar-search input::placeholder {
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HIGH-CONTRAST & ACCESSIBILITY OVERRIDES (CONTRAST SANITY GUARANTEE)
   ───────────────────────────────────────────────────────────────────────────── */

/* Enforce dark dropdown backgrounds & readable text on select & option elements */
select, select.fc, select.form-control, select.form-input, .fc, input.form-control, textarea.form-control {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

select option, select.fc option, select.form-control option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    padding: 10px !important;
}

/* Prevent browser auto-fill from producing white font on light auto-fill backgrounds */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    box-shadow: 0 0 0px 1000px #0f172a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Guarantee white containers have dark text, and dark containers have light text */
.bg-white, [style*="background:#fff"], [style*="background: #fff"], [style*="background: white"], [style*="background:#ffffff"], [style*="background: #ffffff"] {
    color: #0f172a !important;
}
.bg-white strong, [style*="background:#fff"] strong, [style*="background: #fff"] strong, [style*="background: white"] strong {
    color: #0f172a !important;
}

/* Modal boxes and Cards high-contrast text */
.modal-box, .glass-card, .table-card, .notif-panel, .notif-panel-dropdown, .profile-dropdown {
    color: #f8fafc !important;
}

/* Tables high-contrast text */
.modern-table th {
    color: #94a3b8 !important;
    background: rgba(15, 23, 42, 0.95) !important;
}
.modern-table td {
    color: #f8fafc !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   UNIVERSAL MOBILE RESPONSIVENESS & UI/UX ACCESSIBILITY MATRIX
   ───────────────────────────────────────────────────────────────────────────── */

/* Guarantee no horizontal overflow on mobile viewports */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Touch targets optimization */
button, input, select, textarea, .btn, .btn-sec, .btn-primary, .btn-dang, .sidebar-link, .nav-link, .filter-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Responsive Table Wrapper */
.modern-table-wrap, .table-card, .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 1rem;
}

/* Tablet & Mobile Media Queries (< 992px & < 768px) */
@media (max-width: 992px) {
    .app-layout, .dashboard-layout, .pricing-grid, .stats-grid {
        gap: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    /* App Layout */
    .app-layout, .dashboard-layout {
        flex-direction: column !important;
    }

    /* Sliding Drawer Navigation Sidebar */
    .app-sidebar, .sidebar, .premium-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 270px !important;
        height: 100vh !important;
        z-index: 99999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) !important;
    }

    .app-sidebar.mobile-open, .sidebar.mobile-open, .premium-sidebar.mobile-open {
        left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55) !important;
        z-index: 99990;
    }

    .sidebar-overlay.show, .sidebar-overlay.open {
        display: block !important;
    }

    /* Main Content Area Padding */
    .app-main, .main-content {
        padding: 1rem 0.75rem 3rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Top App Headers */
    .app-header, .content-header, .plans-nav {
        padding: 0.75rem 1rem !important;
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }

    .app-header-search, .topbar-search {
        max-width: 100% !important;
        width: 100% !important;
        order: 3;
    }

    .pulse-live-badge {
        font-size: 0.68rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    /* Titles & Subtitles */
    .page-title, h1 {
        font-size: 1.35rem !important;
        line-height: 1.25 !important;
    }

    .page-subtitle {
        font-size: 0.8rem !important;
    }

    /* Collapse Grid Layouts */
    .stats-grid, .charts-grid, .trust-grid, .plans-wrapper, .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Modals Responsiveness */
    .modal-box {
        max-width: 94vw !important;
        max-height: 88vh !important;
        padding: 1.25rem !important;
        border-radius: 1.25rem !important;
        box-sizing: border-box !important;
    }

    /* Table cells compact spacing */
    .modern-table th, .modern-table td {
        padding: 0.65rem 0.75rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* Buttons & Controls wrap */
    .table-search-row, .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .table-search-input, .table-filter-select, .filter-btn {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Extra Small Smartphones (< 480px) */
@media (max-width: 480px) {
    body {
        font-size: 0.9rem !important;
    }

    .btn, .btn-primary, .btn-sec, .btn-dang {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.78rem !important;
    }

    .stat-val {
        font-size: 1.5rem !important;
    }

    .modal-box h2 {
        font-size: 1.05rem !important;
    }
}

/* ── CRITICAL MOBILE HEADER & DRAWER OVERRIDE FIXES ───────────────────────── */
@media (max-width: 992px) {
    /* Header Container */
    .t-header, .app-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 99900 !important;
        padding: 0.4rem 0.65rem !important;
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
        background: #0d1527 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    html[data-theme="light"] .t-header,
    html[data-theme="light"] .app-header {
        background: #ffffff !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    }

    .t-header .logo-text, .app-header .logo-text {
        font-size: 0.95rem !important;
        white-space: normal !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }

    /* Actions area */
    .t-header-actions, .app-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        margin-left: auto !important;
        flex-wrap: wrap !important;
    }

    /* Icon Buttons inside Header (Notifications, Theme, Profile, Burger) */
    .t-header-actions .icon-btn,
    .app-header-actions .icon-btn,
    .burger-menu-btn,
    .t-burger,
    .app-burger,
    #mobileSidebarOpen {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 0.6rem !important;
        font-size: 1.15rem !important;
        flex-shrink: 0 !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;

    html[data-theme="light"] .burger-menu-btn, html[data-theme="light"] .header-burger {
        color: #0f172a !important;
        background: rgba(0, 0, 0, 0.05) !important;
        border-color: #cbd5e1 !important;
    }

    /* Hide long text titles on mobile topbar */
    .teacher-role-badge, .header-subtitle, .topbar-search {
        display: none !important;
    }

    .t-logo {
        font-size: 0.95rem !important;
        gap: 0.35rem !important;
    }

    .t-logo img {
        height: 22px !important;
        width: 22px !important;
    }

    .t-header-right {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        margin-left: auto !important;
    }

    /* Compact Cashback Pill on Mobile Topbar */
    .t-badge {
        margin-right: 0 !important;
        padding: 0.25rem 0.65rem !important;
        font-size: 0.72rem !important;
        border-radius: 50px !important;
    }

    .t-badge span span {
        display: none !important; /* Hide (>=₹50 to redeem) on small screens */
    }

    /* Mobile Off-Canvas Drawer Navigation Sidebar (Theme-Aware CSS Variables) */
    .t-sidebar, .app-sidebar, .sidebar, .premium-sidebar, #appSidebar {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 999999 !important;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.2) !important;
        overflow-y: auto !important;
        padding: 1.25rem 0.85rem 3rem !important;
        box-sizing: border-box !important;
        background: var(--bg-surface, #ffffff) !important;
        border-right: 1px solid var(--border-color, rgba(0, 0, 0, 0.08)) !important;
        color: var(--text-primary, #0f172a) !important;
    }

    .t-sidebar.mobile-open, .app-sidebar.mobile-open, .sidebar.mobile-open, .premium-sidebar.mobile-open, #appSidebar.mobile-open {
        left: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        z-index: 999999 !important;
    }

    /* Dynamic Theme Links inside Sidebar Drawer */
    .sidebar-link, .nav-link, .t-sidebar a, .sidebar-item, .sidebar-item a, .sidebar-section-title {
        color: var(--text-primary, #0f172a) !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        padding: 0.72rem 0.85rem !important;
        border-radius: 0.75rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        text-decoration: none !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 2 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }

    .premium-sidebar.collapsed .sidebar-label,
    .app-sidebar.collapsed .sidebar-label,
    .sidebar.collapsed .sidebar-label,
    .sidebar-label, .sidebar-item .sidebar-label {
        opacity: 1 !important;
        width: auto !important;
        display: inline !important;
        pointer-events: auto !important;
        color: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        margin-left: 0 !important;
        white-space: normal !important;
        overflow: visible !important;
    }

    .sidebar-icon, .sl-icon {
        font-size: 1.2rem !important;
        color: #38bdf8 !important;
        opacity: 1 !important;
        display: inline-flex !important;
        flex-shrink: 0 !important;
    }

    .sidebar-logo-text {
        color: #ffffff !important;
        font-weight: 800 !important;
        font-size: 1.05rem !important;
    }

    .sidebar-link:hover, .sidebar-link.active, .nav-link.active, .sidebar-item:hover, .sidebar-item.active, .sidebar-item.active a,
    html[data-theme="light"] .sidebar-link:hover, html[data-theme="light"] .sidebar-link.active, html[data-theme="light"] .sidebar-item.active, html[data-theme="light"] .sidebar-item.active a {
        background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4) !important;
        border-radius: 0.75rem !important;
    }

    /* Crisp Translucent Modern Mobile Overlay (No Blur Artifacting) */
    .sidebar-overlay {
        display: none;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(15, 23, 42, 0.55) !important;
        z-index: 99990 !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show, .sidebar-overlay.open, .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Prevent Dashboard cards from tucking under fixed mobile topbar */
    .t-page, .app-main, .main-content {
        margin-top: 0.5rem !important;
        padding: 0.75rem !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Fluid Responsive Typography & Squeezed Mobile Layouts */
    h1, .h1 { font-size: clamp(1.25rem, 4.5vw, 1.75rem) !important; line-height: 1.25 !important; }
    h2, .h2 { font-size: clamp(1.1rem, 3.8vw, 1.45rem) !important; line-height: 1.3 !important; }
    h3, .h3 { font-size: clamp(1rem, 3.2vw, 1.25rem) !important; }
    p, span, label, td, th { max-width: 100% !important; word-break: break-word !important; }

    /* Auto-squeezing Grid & Metrics Cards */
    .dash-grid, .stats-grid, .grid-3, .grid-4, .metrics-grid, .t-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .card, .scard, .t-card, .stat-card, .stat-card-new, .glass-card {
        padding: 0.95rem 0.85rem !important;
        border-radius: 0.9rem !important;
    }

    /* Table Auto-Squeeze & Touch Scroll */
    .table-responsive, .table-container, table {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* STRICT DESKTOP OVERLAY DISABLE (Prevents overlay from dimming desktop screen) */
@media (min-width: 993px) {
    .sidebar-overlay, #sidebarOverlay {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }
}

/* ── GAMES, QUIZZES, BOOK VIEWER & MESSAGING MOBILE MATRIX ─────────────────── */
@media (max-width: 768px) {
    /* Digital Book Reader Modal Responsive Layout */
    #digitalBookReaderModal {
        padding: 0 !important;
    }

    .reader-modal-card {
        max-width: 100vw !important;
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .reader-header-bar {
        flex-wrap: wrap !important;
        padding: 0.5rem 0.75rem !important;
        gap: 0.4rem !important;
    }

    .reader-controls-wrap {
        width: 100 !important;
        width: 100% !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }

    /* On mobile, Table of Contents becomes an off-canvas slide-out drawer so document reader has 100% full width! */
    .reader-toc-sidebar {
        position: absolute !important;
        left: -280px !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 250px !important;
        z-index: 100 !important;
        background: var(--bg-surface, #0f172a) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
        transition: left 0.3s ease !important;
    }

    .reader-toc-sidebar.open {
        left: 0 !important;
    }

    .reader-toc-sidebar #closeTocBtn {
        display: inline-block !important;
    }

    .reader-iframe-wrap {
        width: 100% !important;
        flex: 1 !important;
    }

    /* Book Viewer Mobile Layout */
    .viewer-header {
        padding: 0.5rem 0.75rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .viewer-page {
        height: auto !important;
        max-height: 68vh !important;
        max-width: 95vw !important;
        width: 100% !important;
        object-fit: contain !important;
    }

    .viewer-main-wrapper {
        padding: 0.5rem !important;
        overflow: auto !important;
    }

    .zoom-controls {
        margin-right: 0 !important;
        gap: 0.25rem !important;
    }

    .zoom-btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.78rem !important;
    }

    /* Quiz & Assessment Mobile Optimization */
    .quiz-container, .quiz-card, .question-card {
        padding: 1rem !important;
        margin: 0.5rem auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .quiz-option-card, .option-btn, .answer-btn {
        padding: 0.85rem 1rem !important;
        font-size: 0.88rem !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        margin-bottom: 0.65rem !important;
    }

    .quiz-timer-bar, .quiz-progress-bar {
        font-size: 0.78rem !important;
    }

    /* Subject Game & Gamification Mobile Matrix */
    .game-grid, .stages-grid, .subject-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 0.75rem !important;
    }

    .stage-card, .game-card {
        padding: 0.85rem !important;
        border-radius: 1rem !important;
    }

    .game-canvas-container canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 50vh !important;
    }

    /* Direct Messages Inbox Mobile Split */
    .chat-layout, .messages-container {
        grid-template-columns: 1fr !important;
    }

    .chat-sidebar {
        width: 100% !important;
    }

    .chat-thread-container.mobile-hidden {
        display: none !important;
    }
}

/* ──────────────────────────────────────────────────────────────────────────────
   EXPERT DASHBOARD MOBILE & TABLET COMPATIBILITY ENGINE
   (Covers Teacher, Student, Admin & Parent Portals, Cards, Widgets & Tables)
────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 992px) {
  /* Layout Containers */
  .t-main, .app-main, .main-content, .dashboard-container, .page-container {
    padding: 1rem 1.25rem !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 768px) {
  /* Fluid Typography for Mobile Viewports */
  h1, .page-title { font-size: 1.35rem !important; line-height: 1.25 !important; }
  h2, .section-title { font-size: 1.18rem !important; line-height: 1.25 !important; }
  h3, .card-title { font-size: 1.02rem !important; }
  h4 { font-size: 0.92rem !important; }
  p, .text-desc { font-size: 0.84rem !important; line-height: 1.55 !important; }

  /* Prevents iOS Safari Auto-Zoom on Input Focus */
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    font-size: 16px !important;
  }

  /* Compact Dashboard Cards & Widgets */
  .card, .dashboard-card, .stat-card, .panel-card, .widget-card, .t-card, .hero-module-card, .hero-banner-card {
    padding: 1rem 0.85rem !important;
    border-radius: 1.15rem !important;
    margin-bottom: 0.85rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .hero-banner-card {
    padding: 1.25rem 1rem !important;
    border-radius: 1.25rem !important;
  }

  /* 2-Column Responsive Stat & Metric Grids */
  .stats-grid, .metrics-grid, .grid-4, .grid-3, .t-stats-grid, .dashboard-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .stat-val, .metric-value, .stat-number, .t-stat-num {
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
  }

  .stat-lbl, .metric-label, .t-stat-lbl {
    font-size: 0.68rem !important;
    letter-spacing: 0.02em !important;
  }

  /* Touch-Scrollable Horizontal Dashboard Tab Bars */
  .tabs-bar, .tab-nav, .nav-tabs, .t-tabs, .subnav-tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding-bottom: 0.4rem !important;
    margin-bottom: 1rem !important;
    gap: 0.45rem !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .tabs-bar::-webkit-scrollbar, .tab-nav::-webkit-scrollbar, .t-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .tab-btn, .nav-tab, .t-tab {
    flex-shrink: 0 !important;
    padding: 0.5rem 0.95rem !important;
    font-size: 0.78rem !important;
  }

  /* Mobile Data Tables with Horizontal Scroll */
  .table-responsive, .table-container, .data-table-wrap, .t-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    display: block !important;
    border-radius: 0.85rem !important;
  }

  table {
    width: 100% !important;
    min-width: 540px !important;
  }

  th, td {
    padding: 0.55rem 0.65rem !important;
    font-size: 0.78rem !important;
  }

  /* Touch Target Optimizations for Buttons */
  .btn, .action-btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-dang {
    min-height: 42px !important;
    padding: 0.5rem 0.9rem !important;
    font-size: 0.82rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Full Width Forms & Modal Adjustments */
  .modal-box, .modal-content, .dialog-box {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 1.25rem 1rem !important;
    border-radius: 1.25rem !important;
    margin: 1rem auto !important;
    box-sizing: border-box !important;
  }

  /* Grid Layout Fallbacks to 1-Column for Form Rows */
  .form-row, .input-group-row, .filter-row {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra Small Devices (360px - 414px) */
  .stats-grid, .metrics-grid, .grid-4, .grid-3, .t-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .stat-val, .metric-value, .t-stat-num {
    font-size: 1.2rem !important;
  }
  .card, .dashboard-card, .t-card {
    padding: 0.85rem 0.75rem !important;
    border-radius: 1rem !important;
  }
  .t-header, .app-header {
    padding: 0.4rem 0.6rem !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────────
   UNIVERSAL APPLICATION-WIDE AUTO-ADJUSTING SCREEN ENGINE
   (Auto-adjusts all PHP pages: Auth, Book Viewer, Quizzes, Portals, Modals)
────────────────────────────────────────────────────────────────────────────── */

/* Global Fluid Reset */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

/* Auto-Adjusting Containers & Main Content Layouts */
.container, .main-content, .page-container, .auth-container, .dashboard-container,
.t-page, .app-main, .wrapper, .site-wrap, .layout-wrap {
  width: 100% !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Auto-Adjusting Media Elements */
img, video, canvas, iframe, object, embed {
  max-width: 100% !important;
  height: auto !important;
}

/* Auto-Adjusting Authentication Pages (login.php, signup.php, verify-otp.php, onboarding.php) */
@media (max-width: 640px) {
  .auth-card, .login-card, .signup-card, .otp-card, .onboarding-card, .forgot-card {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 1.5rem 1.1rem !important;
    margin: 1.25rem auto !important;
    border-radius: 1.25rem !important;
    box-sizing: border-box !important;
  }

  .auth-title, .login-title, .signup-title {
    font-size: 1.4rem !important;
    line-height: 1.25 !important;
  }
}

/* Auto-Adjusting Book Viewer & Quiz Interface (book-viewer.php, quiz.php, practice.php) */
@media (max-width: 768px) {
  .book-viewer-container, .flipbook-wrap, .reader-main, .viewer-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .viewer-body, .viewer-main-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100vh - 100px) !important;
    min-height: calc(100vh - 100px) !important;
    max-height: calc(100vh - 100px) !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
  }

  .viewer-page {
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    max-width: 100vw !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  .viewer-page img, .page-img, #flipbook canvas {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }

  .viewer-header {
    padding: 0.35rem 0.65rem !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    justify-content: space-between !important;
  }

  .viewer-logo-back {
    font-size: 0.78rem !important;
    padding: 0.25rem 0.5rem !important;
    white-space: nowrap !important;
  }

  .viewer-header h3 {
    font-size: 0.85rem !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .zoom-controls {
    margin-right: 0.35rem !important;
    gap: 0.25rem !important;
  }

  .zoom-btn, #fullscreen-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  .viewer-footer {
    height: auto !important;
    padding: 0.4rem 0.65rem !important;
    background: var(--bg-surface, #ffffff) !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
  }

  .controls-row {
    font-size: 0.8rem !important;
    color: var(--text-primary, #0f172a) !important;
    gap: 0.65rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .controls-row span, .controls-row div {
    color: var(--text-primary, #0f172a) !important;
    font-weight: 700 !important;
  }

  .page-input {
    background: var(--bg-surface, #ffffff) !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    color: var(--text-primary, #0f172a) !important;
    font-weight: 800 !important;
  }
}

  .quiz-card, .question-box, .practice-container {
    padding: 1rem 0.85rem !important;
    margin: 0.75rem auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .quiz-option-btn, .option-card, .answer-btn {
    min-height: 46px !important;
    padding: 0.75rem 0.85rem !important;
    font-size: 0.88rem !important;
    margin-bottom: 0.6rem !important;
  }
}

/* Mobile Fullscreen Active Fallback */
body.mobile-fullscreen-active .viewer-container {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: #0b0f17 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0.5rem !important;
}

body.mobile-fullscreen-active .viewer-page {
  height: calc(100vh - 100px) !important;
  max-height: 90vh !important;
}

/* Auto-Adjusting Modals & Overlay Dialogs across all PHP pages */
@media (max-width: 768px) {
  .modal, .modal-dialog, .modal-content, .modal-box, .popup-box, .dialog-card {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0.75rem auto !important;
    padding: 1.25rem 1rem !important;
    border-radius: 1.25rem !important;
    box-sizing: border-box !important;
  }
}

/* Auto-Adjusting Header & Navigation Bars across all PHP pages */
@media (max-width: 768px) {
  .header, .navbar, .t-header, .topbar, .app-header {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   UNIVERSAL MULTI-DEVICE DASHBOARD ENGINE
   (Auto-adjusting layouts, fluid fonts, smooth clickable interactivity for
    Student, Teacher, Parent, and Admin dashboards on Mobile/Tablet/Laptop/Desktop)
══════════════════════════════════════════════════════════════════════════════ */

/* 1. Fluid Typography with clamp() */
:root {
  --font-fluid-h1: clamp(1.4rem, 2.8vw + 0.5rem, 2.2rem);
  --font-fluid-h2: clamp(1.15rem, 2vw + 0.35rem, 1.6rem);
  --font-fluid-h3: clamp(0.95rem, 1.5vw + 0.25rem, 1.25rem);
  --font-fluid-stat: clamp(1.6rem, 3.2vw + 0.5rem, 2.4rem);
  --font-fluid-body: clamp(0.82rem, 0.4vw + 0.72rem, 0.95rem);
  --font-fluid-sm: clamp(0.72rem, 0.3vw + 0.64rem, 0.82rem);
}

.page-title, .hero-left h1, .welcome-title, .dash-header-inner h1 {
  font-size: var(--font-fluid-h1) !important;
  line-height: 1.2 !important;
}

.sec-title, .section-title, .card-title, .admin-section-title {
  font-size: var(--font-fluid-h2) !important;
}

.scard-val, .stat-card-new .stat-val-new, .stat-card-value, .t-stat-num, .stat-num {
  font-size: var(--font-fluid-stat) !important;
  line-height: 1.1 !important;
}

/* 2. Smooth Clickable Interactive Animations & Ripple */
.interactive-el, .scard, .stat-card-new, .stat-card, .glass-card, .t-card, .task-item, .book-item {
  transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.28s ease, border-color 0.28s ease !important;
  cursor: pointer;
}

.scard:hover, .stat-card-new:hover, .stat-card:hover, .glass-card:hover, .t-card:hover, .book-item:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.18) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.interactive-el:active, .btn:active, .action-btn:active, .hero-btn:active, .scard:active, .stat-card-new:active {
  transform: scale(0.985) !important;
}

/* Ripple effect styling */
.interactive-ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleExpand 0.55s linear;
  pointer-events: none;
}
@keyframes rippleExpand {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* 3. Touch-Target Accessibility on Mobile & Tablet */
.device-mobile button, .device-mobile .btn, .device-mobile .hero-btn,
.device-mobile .sidebar-link, .device-mobile .child-tab, .device-mobile .tab-btn,
.device-mobile .task-action, .device-mobile .book-cta,
.device-tablet button, .device-tablet .btn, .device-tablet .hero-btn,
.device-tablet .sidebar-link, .device-tablet .child-tab, .device-tablet .tab-btn,
.device-tablet .task-action, .device-tablet .book-cta {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  touch-action: manipulation;
}

/* 4. Horizontal Scroll Touch Bar for Tabs & Filters */
.child-selector-tabs, .tabs-bar, .tab-nav, .nav-tabs, .t-tabs, .subnav-tabs {
  display: flex !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding-bottom: 0.45rem !important;
  gap: 0.55rem !important;
}
.child-selector-tabs::-webkit-scrollbar, .tabs-bar::-webkit-scrollbar, .tab-nav::-webkit-scrollbar, .t-tabs::-webkit-scrollbar {
  display: none !important;
}

/* 5. Four-Tier Responsive Breakpoint Layout Architecture */

/* Desktop & Laptop Breakpoints (992px - 1199px) */
@media (max-width: 1199px) {
  .stats-grid, .t-stats, .stats-row, .metrics-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
  }
  .charts-grid, .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* Tablet Breakpoints (641px - 991px) */
@media (max-width: 991px) {
  .stats-grid, .t-stats, .stats-row, .metrics-grid, .grid-4, .t-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }
  .tasks-grid, .charts-grid, .dashboard-grid, .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .hero-banner {
    padding: 1.5rem !important;
    gap: 1.25rem !important;
  }
}

/* Mobile Phone Breakpoints (481px - 640px) */
@media (max-width: 640px) {
  .page-content, .main-content, .app-main, .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
  .hero-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1.25rem !important;
  }
  .hero-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.6rem !important;
  }
  .hero-btn {
    flex: 1 1 140px !important;
    text-align: center !important;
  }
}

/* Small Phone Auto-Adjust Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .stats-grid, .t-stats, .stats-row, .metrics-grid, .grid-4, .grid-3, .t-stats-grid, .tasks-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .scard, .stat-card-new, .stat-card, .t-card, .glass-card {
    padding: 1rem 0.95rem !important;
    border-radius: 1rem !important;
  }
  .bookshelf-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 0.85rem !important;
  }
  .topbar-search, .app-header-search {
    max-width: 150px !important;
    padding: 0.3rem 0.65rem !important;
  }
  .topbar-search input, .app-header-search input {
    font-size: 0.75rem !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE DATA TABLE TO RESPONSIVE CARD TRANSFORMATION (<= 768px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .table-responsive-cards table,
  .mobile-table-cards table,
  .data-table-wrap table {
    display: block !important;
    width: 100% !important;
  }
  .table-responsive-cards thead,
  .mobile-table-cards thead {
    display: none !important;
  }
  .table-responsive-cards tbody,
  .mobile-table-cards tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }
  .table-responsive-cards tr,
  .mobile-table-cards tr {
    display: block !important;
    background: var(--bg-surface, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  }
  .table-responsive-cards td,
  .mobile-table-cards td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.45rem 0 !important;
    border-bottom: 1px solid var(--white-overlay-05, rgba(0,0,0,0.04)) !important;
    font-size: 0.85rem !important;
  }
  .table-responsive-cards td:last-child,
  .mobile-table-cards td:last-child {
    border-bottom: none !important;
    padding-top: 0.65rem !important;
  }
  .table-responsive-cards td[data-label]::before,
  .mobile-table-cards td[data-label]::before {
    content: attr(data-label) !important;
    font-weight: 700 !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    margin-right: 0.75rem !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY & FOCUS VISIBLE INDICATORS
   ══════════════════════════════════════════════════════════════════════════════ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary, #4F46E5) !important;
  outline-offset: 2px !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGES — Login, Signup, OTP, Forgot Password, Verify Email
   ══════════════════════════════════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100vh;
  background: var(--bg-main, #F8FAFC);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-xl, 1.25rem);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0,0,0,0.1));
}
.auth-card-wide {
  max-width: 760px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
}
.auth-logo-mark {
  width: 42px;
  height: 42px;
  background: var(--primary, #4F46E5);
  border-radius: var(--radius-md, 0.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.2rem;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  flex-shrink: 0;
}
.auth-logo-text {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary, #0F172A);
  line-height: 1.1;
}
.auth-logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #64748B);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-heading {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}
.auth-subheading {
  font-size: 0.9rem;
  color: var(--text-muted, #64748B);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted, #64748B);
  font-size: 0.82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #E2E8F0);
}
.auth-form-group {
  margin-bottom: 1.1rem;
}
.auth-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-input {
  width: 100%;
  height: 48px;
  background: var(--bg-main, #F8FAFC);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0 1rem;
  font-size: 0.95rem;
  color: var(--text-primary, #0F172A);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: var(--primary, #4F46E5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: var(--bg-surface, #fff);
}
.auth-input::placeholder { color: var(--text-muted, #64748B); }
.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .auth-input {
  padding-right: 3rem;
}
.auth-input-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #64748B);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
}
.auth-btn {
  width: 100%;
  height: 50px;
  background: var(--primary, #4F46E5);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 0.5rem);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  margin-top: 0.25rem;
}
.auth-btn:hover {
  background: var(--primary-dark, #4338CA);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.auth-btn-outline {
  width: 100%;
  height: 48px;
  background: transparent;
  border: 1.5px solid var(--border-color, #E2E8F0);
  color: var(--text-primary, #0F172A);
  border-radius: var(--radius-sm, 0.5rem);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.auth-btn-outline:hover {
  border-color: var(--primary, #4F46E5);
  background: var(--primary-soft, #EEF2FF);
  color: var(--primary, #4F46E5);
}
.auth-alert-error {
  background: #FFF1F2;
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #be123c;
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.auth-alert-success {
  background: #ECFDF5;
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.auth-alert-info {
  background: #EFF6FF;
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0c4a6e;
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.auth-link {
  color: var(--primary, #4F46E5);
  font-weight: 700;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.87rem;
  color: var(--text-muted, #64748B);
}
.otp-grid {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  margin: 1rem 0;
}
.otp-box {
  width: 52px;
  height: 60px;
  background: var(--bg-main, #F8FAFC);
  border: 2px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-sm, 0.5rem);
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  font-family: var(--font-heading, 'Outfit', sans-serif);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-box:focus {
  outline: none;
  border-color: var(--primary, #4F46E5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.role-tab-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-main, #F8FAFC);
  padding: 0.3rem;
  border-radius: var(--radius-md, 0.75rem);
  border: 1px solid var(--border-color, #E2E8F0);
}
.role-tab-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 0.5rem);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted, #64748B);
  cursor: pointer;
  transition: all 0.2s;
}
.role-tab-btn.active {
  background: var(--bg-surface, #ffffff);
  color: var(--primary, #4F46E5);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}
@media (max-width: 520px) {
  .auth-card { padding: 1.75rem 1.25rem; border-radius: var(--radius-lg, 1rem); }
  .auth-heading { font-size: 1.35rem; }
  .otp-box { width: 42px; height: 52px; font-size: 1.3rem; }
  .otp-grid { gap: 0.45rem; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PUBLIC MARKETING PAGES — Homepage, About, Plans, Support
   ══════════════════════════════════════════════════════════════════════════════ */
.pub-shell {
  min-height: 100vh;
  background: var(--bg-main, #F8FAFC);
  color: var(--text-primary, #0F172A);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  padding: 0 2rem;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
[data-theme='dark'] .pub-nav {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(255,255,255,0.08);
}
.pub-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary, #0F172A);
}
.pub-nav-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--primary, #4F46E5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
}
.pub-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pub-nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  transition: color 0.2s;
}
.pub-nav-links a:hover { color: var(--primary, #4F46E5); }
.pub-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pub-btn-outline {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-full, 9999px);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  background: transparent;
  text-decoration: none;
  transition: all 0.2s;
}
.pub-btn-outline:hover {
  border-color: var(--primary, #4F46E5);
  color: var(--primary, #4F46E5);
}
.pub-btn-primary {
  padding: 0.5rem 1.35rem;
  background: var(--primary, #4F46E5);
  border-radius: var(--radius-full, 9999px);
  font-size: 0.87rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  border: none;
  cursor: pointer;
}
.pub-btn-primary:hover {
  background: var(--primary-dark, #4338CA);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.pub-hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}
.pub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-soft, #EEF2FF);
  color: var(--primary, #4F46E5);
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pub-hero-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  line-height: 1.15;
  margin: 0 0 1.25rem;
}
.pub-hero-title span { color: var(--primary, #4F46E5); }
.pub-hero-desc {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary, #475569);
  max-width: 600px;
  margin: 0 auto 2.25rem;
  line-height: 1.65;
}
.pub-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.pub-hero-btn {
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pub-hero-btn-primary {
  background: var(--primary, #4F46E5);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}
.pub-hero-btn-primary:hover { background: var(--primary-dark, #4338CA); transform: translateY(-2px); }
.pub-hero-btn-secondary {
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0F172A);
  border: 1.5px solid var(--border-color, #E2E8F0);
}
.pub-hero-btn-secondary:hover { border-color: var(--primary, #4F46E5); color: var(--primary, #4F46E5); }
.pub-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.pub-section-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.5rem;
}
.pub-section-subtitle {
  font-size: 1rem;
  color: var(--text-muted, #64748B);
  margin: 0 0 2.5rem;
  line-height: 1.6;
}
.pub-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.pub-stat-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.pub-stat-number {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary, #4F46E5);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.pub-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted, #64748B);
  font-weight: 600;
}
.pub-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.pub-feature-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.75rem 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pub-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.pub-feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-soft, #EEF2FF);
  border-radius: var(--radius-md, 0.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.pub-feature-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.5rem;
}
.pub-feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
  margin: 0;
}
.pub-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.pub-price-card {
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-xl, 1.25rem);
  padding: 2rem 1.75rem;
  position: relative;
}
.pub-price-card.featured {
  border-color: var(--primary, #4F46E5);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.pub-price-badge {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary, #4F46E5);
  color: #fff;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.pub-price-name {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}
.pub-price-amount {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary, #0F172A);
  margin: 0 0 1.5rem;
  line-height: 1;
}
.pub-price-amount span { font-size: 1rem; font-weight: 600; color: var(--text-muted, #64748B); }
.pub-price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.pub-price-features li {
  font-size: 0.87rem;
  color: var(--text-secondary, #475569);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}
.pub-price-features li::before {
  content: '✓';
  color: var(--success, #10B981);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.pub-footer {
  background: var(--text-primary, #0F172A);
  color: rgba(248, 250, 252, 0.7);
  padding: 3rem 2rem 1.5rem;
}
.pub-footer a { color: rgba(248, 250, 252, 0.6); text-decoration: none; font-size: 0.87rem; }
.pub-footer a:hover { color: #fff; }
.pub-mobile-menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-sm, 0.5rem);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  color: var(--text-primary, #0F172A);
  font-size: 1.2rem;
}
@media (max-width: 768px) {
  .pub-nav { padding: 0 1rem; }
  .pub-nav-links { display: none; }
  .pub-mobile-menu-toggle { display: flex; }
  .pub-hero { padding: 3rem 1.25rem 2.5rem; }
  .pub-section { padding: 2.5rem 1.25rem; }
  .pub-hero-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .pub-hero-actions { flex-direction: column; align-items: center; }
  .pub-hero-btn { width: 100%; max-width: 340px; justify-content: center; }
  .pub-features-grid { grid-template-columns: 1fr; }
  .pub-pricing-grid { grid-template-columns: 1fr; }
  .pub-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ERROR PAGES — 400, 401, 403, 404, 500
   ══════════════════════════════════════════════════════════════════════════════ */
.error-shell {
  min-height: 100vh;
  background: var(--bg-main, #F8FAFC);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}
.error-card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-xl, 1.25rem);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.error-emoji { font-size: 4rem; margin-bottom: 1rem; display: block; }
.error-code {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary, #4F46E5);
  margin: 0 0 0.25rem;
  line-height: 1;
}
.error-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.75rem;
}
.error-desc {
  color: var(--text-muted, #64748B);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 2rem;
}
.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.error-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.error-btn-primary {
  background: var(--primary, #4F46E5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.error-btn-primary:hover { background: var(--primary-dark, #4338CA); transform: translateY(-1px); }
.error-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--border-color, #E2E8F0);
  color: var(--text-secondary, #475569);
}
.error-btn-secondary:hover { border-color: var(--primary, #4F46E5); color: var(--primary, #4F46E5); }

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 2rem);
}
.toast {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 0.75rem);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--border-color, #E2E8F0);
  position: relative;
  overflow: hidden;
}
.toast.toast-success { border-left-color: var(--success, #10B981); }
.toast.toast-error { border-left-color: var(--danger, #F43F5E); }
.toast.toast-warning { border-left-color: var(--warning, #F59E0B); }
.toast.toast-info { border-left-color: var(--info, #0EA5E9); }
.toast.removing { animation: toastOut 0.25s ease forwards; }
.toast-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 0.05rem; }
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-weight: 700;
  font-size: 0.87rem;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.15rem;
}
.toast-msg {
  font-size: 0.82rem;
  color: var(--text-muted, #64748B);
  margin: 0;
  line-height: 1.45;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted, #64748B);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 120px; }
  to { opacity: 0; transform: translateX(100%); max-height: 0; padding: 0; margin: 0; }
}
@media (max-width: 480px) {
  #toast-container { bottom: 5rem; right: 0.75rem; left: 0.75rem; max-width: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
  display: block;
}
.empty-state-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.5rem;
}
.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted, #64748B);
  max-width: 320px;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}
.empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.35rem;
  background: var(--primary, #4F46E5);
  color: #fff;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.empty-state-action:hover { background: var(--primary-dark, #4338CA); }

/* ══════════════════════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ══════════════════════════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-hover, #F1F5F9) 25%, var(--bg-main, #F8FAFC) 50%, var(--bg-surface-hover, #F1F5F9) 75%);
  background-size: 2000px 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: var(--radius-sm, 0.5rem);
}
.skeleton-text {
  height: 0.85rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.skeleton-text.sm { height: 0.7rem; }
.skeleton-text.lg { height: 1.2rem; }
.skeleton-text.title { height: 1.5rem; margin-bottom: 0.75rem; }
.skeleton-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.5rem;
  overflow: hidden;
}
.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.skeleton-badge {
  height: 1.5rem;
  width: 5rem;
  border-radius: var(--radius-full, 9999px);
}
.skeleton-btn {
  height: 2.75rem;
  border-radius: var(--radius-full, 9999px);
}

/* ══════════════════════════════════════════════════════════════════════════════
   LEARNING PAGES — Leaderboard, Gamification, Practice, Assignments, Notifications
   ══════════════════════════════════════════════════════════════════════════════ */
.learn-shell {
  min-height: 100vh;
  background: var(--bg-main, #F8FAFC);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  padding: 1.5rem;
}
.learn-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.learn-page-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.2rem;
}
.learn-page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted, #64748B);
  margin: 0;
}
.learn-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm, 0.5rem);
  border: 1px solid var(--border-color, #E2E8F0);
  background: var(--bg-surface, #fff);
  transition: all 0.2s;
  white-space: nowrap;
}
.learn-back-btn:hover { border-color: var(--primary, #4F46E5); color: var(--primary, #4F46E5); }
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.leaderboard-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748B);
  padding: 0.75rem 1.25rem;
  background: var(--bg-main, #F8FAFC);
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  text-align: left;
}
.leaderboard-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  font-size: 0.9rem;
  color: var(--text-primary, #0F172A);
  vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: var(--bg-main, #F8FAFC); }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--bg-surface-hover, #F1F5F9);
  color: var(--text-secondary, #475569);
}
.rank-badge.gold { background: #FEF3C7; color: #92400E; }
.rank-badge.silver { background: #F1F5F9; color: #475569; }
.rank-badge.bronze { background: #FEF3C7; color: #92400E; }
.rank-1 .rank-badge { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.rank-2 .rank-badge { background: linear-gradient(135deg, #94A3B8, #64748B); color: #fff; }
.rank-3 .rank-badge { background: linear-gradient(135deg, #CD7F32, #A16207); color: #fff; }
.rank-me td { background: rgba(79, 70, 229, 0.04) !important; }
.rank-me td:first-child { border-left: 3px solid var(--primary, #4F46E5); }
.xp-bar-wrap {
  height: 6px;
  background: var(--border-color, #E2E8F0);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  width: 100%;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #4F46E5), var(--info, #0EA5E9));
  border-radius: var(--radius-full, 9999px);
  transition: width 0.6s ease;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.achievement-card {
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.35rem 1.25rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.achievement-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.achievement-card.earned { border-color: rgba(79, 70, 229, 0.35); background: var(--primary-soft, #EEF2FF); }
.achievement-card.locked { opacity: 0.45; filter: grayscale(1); }
.achievement-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.achievement-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary, #0F172A); margin: 0 0 0.35rem; }
.achievement-desc { font-size: 0.78rem; color: var(--text-muted, #64748B); margin: 0; line-height: 1.45; }
.notif-list { display: flex; flex-direction: column; gap: 0.65rem; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 0.75rem);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-main, #F8FAFC); }
.notif-item.unread { border-left: 3px solid var(--primary, #4F46E5); background: rgba(79, 70, 229, 0.02); }
.notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: var(--primary-soft, #EEF2FF);
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 0.875rem; color: var(--text-primary, #0F172A); margin: 0 0 0.2rem; }
.notif-msg { font-size: 0.82rem; color: var(--text-muted, #64748B); margin: 0 0 0.2rem; line-height: 1.4; }
.notif-time { font-size: 0.75rem; color: var(--text-muted, #64748B); }
.assign-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 700;
}
.assign-status.not-started { background: #F1F5F9; color: #475569; }
.assign-status.in-progress { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.assign-status.submitted { background: #EFF6FF; color: #1e40af; border: 1px solid #93C5FD; }
.assign-status.completed { background: #ECFDF5; color: #065f46; border: 1px solid #6EE7B7; }
.assign-status.overdue { background: #FFF1F2; color: #be123c; border: 1px solid #FCA5A5; }
.assign-status.due-soon { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.assign-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s;
}
.assign-card:hover { box-shadow: var(--shadow-md); }
.assign-card-body { flex: 1; min-width: 0; }
.assign-card-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary, #0F172A); margin: 0 0 0.35rem; }
.assign-card-meta { font-size: 0.8rem; color: var(--text-muted, #64748B); margin: 0 0 0.65rem; }
@media (max-width: 768px) {
  .learn-shell { padding: 1rem; }
  .learn-page-title { font-size: 1.35rem; }
  .achievement-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }
  .leaderboard-table thead { display: none !important; }
  .leaderboard-table, .leaderboard-table tbody, .leaderboard-table tr, .leaderboard-table td {
    display: block !important; width: 100% !important;
  }
  .leaderboard-table tr {
    background: var(--bg-surface, #fff) !important;
    border: 1px solid var(--border-color, #E2E8F0) !important;
    border-radius: 12px !important;
    padding: 0.85rem !important;
    margin-bottom: 0.75rem !important;
  }
  .leaderboard-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.35rem 0 !important;
    border-bottom: 1px solid var(--border-color, #E2E8F0) !important;
    font-size: 0.85rem !important;
  }
  .leaderboard-table td:last-child { border-bottom: none !important; }
  .leaderboard-table td[data-label]::before {
    content: attr(data-label) !important;
    font-weight: 700 !important;
    color: var(--text-muted, #64748B) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
  }
  .assign-card { flex-direction: column !important; gap: 0.75rem !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MESSAGES & CHAT — messages.php, chat-widget.php
   ══════════════════════════════════════════════════════════════════════════════ */
.chat-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main, #F8FAFC);
  overflow: hidden;
}
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.chat-contacts {
  border-right: 1px solid var(--border-color, #E2E8F0);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, #fff);
  overflow: hidden;
}
.chat-contacts-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #0F172A);
}
.chat-contacts-list { flex: 1; overflow-y: auto; }
.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
}
.chat-contact-item:hover, .chat-contact-item.active { background: var(--primary-soft, #EEF2FF); }
.chat-contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary, #4F46E5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  position: relative;
}
.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success, #10B981);
  border: 2px solid var(--bg-surface, #fff);
}
.chat-contact-name { font-weight: 700; font-size: 0.87rem; color: var(--text-primary, #0F172A); }
.chat-contact-preview { font-size: 0.78rem; color: var(--text-muted, #64748B); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread-badge {
  margin-left: auto;
  background: var(--primary, #4F46E5);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full, 9999px);
  flex-shrink: 0;
}
.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main, #F8FAFC);
}
.chat-main-header {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  background: var(--bg-surface, #fff);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.chat-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-bubble.sent {
  background: var(--primary, #4F46E5);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0F172A);
  border: 1px solid var(--border-color, #E2E8F0);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-input-bar {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color, #E2E8F0);
  background: var(--bg-surface, #fff);
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.chat-input-field {
  flex: 1;
  height: 44px;
  background: var(--bg-main, #F8FAFC);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-full, 9999px);
  padding: 0 1.1rem;
  font-size: 0.9rem;
  color: var(--text-primary, #0F172A);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}
.chat-input-field:focus { outline: none; border-color: var(--primary, #4F46E5); }
.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary, #4F46E5);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.chat-send-btn:hover { background: var(--primary-dark, #4338CA); transform: scale(1.05); }
@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr !important; }
  .chat-contacts { position: fixed !important; left: 0; top: 0; bottom: 0; width: 280px !important; z-index: 9000; transform: translateX(-100%); transition: transform 0.3s; box-shadow: var(--shadow-xl); }
  .chat-contacts.open { transform: translateX(0); }
  .chat-bubble { max-width: 85% !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PROFILE SETTINGS
   ══════════════════════════════════════════════════════════════════════════════ */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
}
.settings-nav {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 0.75rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm, 0.5rem);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  transition: all 0.15s;
}
.settings-nav-link:hover, .settings-nav-link.active {
  background: var(--primary-soft, #EEF2FF);
  color: var(--primary, #4F46E5);
}
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.settings-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  overflow: hidden;
}
.settings-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #0F172A);
  margin: 0;
}
.settings-card-body { padding: 1.5rem; }
@media (max-width: 768px) {
  .settings-layout { grid-template-columns: 1fr !important; }
  .settings-nav { position: static !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PAYMENT CENTER
   ══════════════════════════════════════════════════════════════════════════════ */
.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.payment-status.pending { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.payment-status.verified { background: #ECFDF5; color: #065f46; border: 1px solid #6EE7B7; }
.payment-status.rejected { background: #FFF1F2; color: #be123c; border: 1px solid #FCA5A5; }
.upi-qr-card {
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.75rem;
  text-align: center;
  max-width: 340px;
}
.upi-qr-card img { width: 100%; max-width: 200px; border-radius: var(--radius-md, 0.75rem); }

/* ══════════════════════════════════════════════════════════════════════════════
   GLOBAL BUTTON LOADING STATE
   ══════════════════════════════════════════════════════════════════════════════ */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE OVERFLOW SAFEGUARD (Global)
   ══════════════════════════════════════════════════════════════════════════════ */
html, body { overflow-x: hidden; max-width: 100vw; }
.container, .page-wrapper, .content-wrap {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
  box-sizing: border-box;
}
table { min-width: 0; }
img, video, iframe, canvas { max-width: 100%; }
input, select, textarea, button {
  max-width: 100%;
  box-sizing: border-box;
}

/* ------------------------------------------------------------------------------
   UNIVERSAL MOBILE DASHBOARD ENGINE — Teacher + Student All Tabs
   Full feature parity: mobile ? desktop for every section, form, table, card
   ------------------------------------------------------------------------------ */

/* --- Desktop base for Payments tab grids --- */
.pay-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.pay-upi-card { grid-column: 1 / 3; }
.upi-display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.pay-form-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}
.pay-record-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* --- Mobile Breakpoint = 768px --- */
@media (max-width: 768px) {

    /* === PAGE LAYOUT === */
    .t-page, .app-page {
        grid-template-columns: 1fr !important;
        padding-top: 64px !important;
    }
    .t-main, .app-main {
        padding: 0.85rem 0.65rem 5.5rem !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    .t-card, .dash-card, .app-card {
        border-radius: 1rem !important;
        padding: 0.9rem !important;
        overflow: hidden !important;
    }
    .t-card-head {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    .t-card-head h2 {
        font-size: 0.95rem !important;
    }

    /* === STATS GRID === */
    .t-stats, .t-stats-grid, .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }
    .t-stat { padding: 0.75rem 0.9rem !important; }
    .t-stat-val { font-size: 1.4rem !important; }
    .t-stat-lbl { font-size: 0.72rem !important; }

    /* === ALL MULTI-COLUMN GRIDS ? SINGLE COLUMN === */
    .pay-top-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 1rem !important;
    }
    .pay-upi-card {
        grid-column: auto !important;
    }
    .upi-display-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .pay-form-3col {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .pay-record-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.65rem !important;
    }

    /* === TABLES ? HORIZONTAL SCROLL === */
    .t-table-wrap, .table-responsive, .modern-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 0.75rem !important;
        margin: 0 -0.25rem !important;
    }
    .t-table, .modern-table {
        min-width: 580px !important;
        font-size: 0.78rem !important;
    }
    .t-table th, .t-table td,
    .modern-table th, .modern-table td {
        padding: 0.55rem 0.65rem !important;
        white-space: nowrap !important;
    }

    /* === FORMS === */
    .form-row, .form-grid-2, .form-grid-3, .form-grid-4 {
        grid-template-columns: 1fr !important;
    }
    .form-control, select.form-control, input.form-control, textarea.form-control {
        font-size: 0.9rem !important;
        padding: 0.55rem 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .form-group { margin-bottom: 0.65rem !important; }

    /* === BUTTONS === */
    .btn-submit, .btn-edit, .btn-delete, .btn-preview, .btn-sm, .btn-qi {
        font-size: 0.82rem !important;
        padding: 0.55rem 0.9rem !important;
        white-space: nowrap !important;
    }
    .btn-submit { min-height: 42px !important; }

    /* === SEARCH BARS === */
    .search-bar-row, .filter-row, .table-search-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    #feePaySearchInput, #bookshelfSearchInput, .search-input {
        width: 100% !important;
        min-width: unset !important;
        box-sizing: border-box !important;
    }

    /* === UPI DISPLAY CARD === */
    #upiDisplayContainer {
        grid-template-columns: 1fr !important;
    }
    #upiDisplayContainer > div:last-child {
        margin-top: 0.5rem !important;
    }
    #upiDisplayContainer img {
        max-width: 150px !important;
        width: 100% !important;
    }
    #upiEditFormContainer .pay-form-3col,
    #upiEditFormContainer form {
        grid-template-columns: 1fr !important;
    }

    /* === FEE LEDGER SEARCH ROW === */
    .t-card-head > div[style*="display:flex"] {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .t-card-head input[type="text"] {
        width: 100% !important;
        min-width: unset !important;
        box-sizing: border-box !important;
    }

    /* === SCHEDULE / CALENDAR CARDS === */
    .schedule-grid, .class-schedule-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .schedule-time-col { display: none !important; }

    /* === BOOKSHELF GRID === */
    .books-grid, .bookshelf-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    .book-card { padding: 0.65rem !important; }
    .book-cover { height: 120px !important; }

    /* === STUDENT TRACKER / PROGRESS === */
    .tracker-grid, .progress-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .student-list-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* === ANALYTICS TAB === */
    .analytics-grid, .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    canvas { max-width: 100% !important; height: auto !important; }

    /* === SUBSCRIPTION TAB === */
    .plans-grid, .subscription-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .plan-card { padding: 1rem !important; }

    /* === ASSIGNMENTS / QUIZZES === */
    .quiz-list, .assignment-list {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* === MODALS === */
    .modal-box, .modal-content, .modal-dialog {
        width: 96vw !important;
        max-width: 96vw !important;
        margin: 1.5rem auto !important;
        padding: 1rem !important;
        border-radius: 1rem !important;
        box-sizing: border-box !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    .modal-body { padding: 0.75rem !important; }

    /* === NOTES TAB === */
    .notes-grid { grid-template-columns: 1fr !important; }
    .note-card { padding: 0.85rem !important; }

    /* === FEES TAB === */
    .fees-overview-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }

    /* === STUDENT PROFILE / ADD FORM === */
    #addStudentForm, .add-student-form {
        grid-template-columns: 1fr 1fr !important;
    }
    #seatPaymentForm {
        grid-template-columns: 1fr !important;
    }
}

/* --- Extra Small Breakpoint = 480px --- */
@media (max-width: 480px) {
    .pay-record-grid {
        grid-template-columns: 1fr !important;
    }
    .t-stats, .t-stats-grid, .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .books-grid, .bookshelf-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    #addStudentForm, .add-student-form {
        grid-template-columns: 1fr !important;
    }
    .fees-overview-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .t-card-head {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .t-card-head h2 { font-size: 0.88rem !important; }
    .t-badge { font-size: 0.65rem !important; padding: 0.15rem 0.45rem !important; }

    /* Prevent horizontal overflow on very small screens */
    .tab-content {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    .t-table-wrap {
        margin: 0 !important;
    }
    .t-main {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* --- Student Dashboard Specific --- */
@media (max-width: 768px) {

    /* Student Stats Row */
    .student-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }

    /* Student Subject Cards */
    .subjects-grid, .subject-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }

    /* Student Quiz/Assignment list */
    .quiz-cards-grid, .assignment-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Payment QR for students */
    #studQrCodeImg {
        max-width: 160px !important;
        width: 100% !important;
    }

    /* Fee payment form in student dashboard */
    .student-fee-form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Leaderboard - full width */
    .leaderboard-list {
        max-height: none !important;
    }

    /* XP Progress bar */
    .xp-bar-wrap { width: 100% !important; }

    /* Tabs on student dashboard */
    .s-tabs-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        padding-bottom: 2px !important;
    }
    .s-tab-btn {
        flex-shrink: 0 !important;
        font-size: 0.78rem !important;
        padding: 0.45rem 0.75rem !important;
    }

    /* Student feed/card stack */
    .feed-card-grid {
        grid-template-columns: 1fr !important;
    }

    /* Achievement badges grid */
    .badges-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }
}

/* --- Touch/Pointer improvements --- */
@media (max-width: 992px) {
    /* All interactive elements: ensure minimum 44px tap target */
    .btn-sm, .btn-qi, .btn-submit, .btn-edit, .btn-delete,
    .sidebar-link, select.form-control,
    input[type="checkbox"], input[type="radio"] {
        min-height: 38px !important;
        cursor: pointer !important;
    }
    input[type="checkbox"], input[type="radio"] {
        min-height: unset !important;
        width: 18px !important;
        height: 18px !important;
    }

    /* Table action buttons - larger tap area */
    .t-table .btn-sm, .t-table .btn-qi {
        padding: 0.45rem 0.65rem !important;
        font-size: 0.78rem !important;
    }

    /* Prevent tiny text that is hard to tap */
    .form-label { font-size: 0.82rem !important; }
    select.form-control { font-size: 0.9rem !important; }

    /* Horizontal scroll hint on table wraps */
    .t-table-wrap::after {
        content: '';
        display: block;
        height: 2px;
        width: 100%;
    }

    /* Card heads wrap nicely */
    .t-card-head {
        flex-wrap: wrap !important;
        gap: 0.65rem !important;
        align-items: flex-start !important;
    }

    /* Footer nav stays above everything */
    .mobile-bottom-nav {
        z-index: 998 !important;
    }
}


/* ==========================================================================
   CK EDU CENTER — 2026 UI/UX ENHANCEMENT ENGINE (MODERN DESIGN SYSTEM)
   ========================================================================== */

/* 1. Vector Icons (Lucide) & Icon Alignment */
[data-lucide], .lucide {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2px;
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

/* 2. Topbar Quick Search Bar & Shortcut Kbd */
.topbar-search-wrapper {
  margin-left: 1rem;
  display: flex;
  align-items: center;
}
.topbar-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white-overlay-05, rgba(0,0,0,0.05));
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-search-trigger:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.15);
}
.topbar-search-kbd {
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .topbar-search-text, .topbar-search-kbd { display: none; }
  .topbar-search-trigger { padding: 0.4rem; border-radius: 50%; }
}

/* 3. Sidebar Glowing Active Indicator & Section Labels */
.nav-section-title {
  padding: 0.85rem 1rem 0.35rem 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  user-select: none;
}
.app-sidebar .nav-list li a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.25s ease;
}
.app-sidebar .nav-list li a:hover {
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateX(3px);
}
.app-sidebar .nav-list li a.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}
.app-sidebar .nav-list li a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--primary);
}

/* 4. Modern Buttons with Shimmer & Gradient Effects */
.btn-glow {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-glow:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.8s ease;
}
.btn-shimmer:hover::after {
  transform: rotate(30deg) translateX(100%);
}

/* 5. Modern Stat Cards with Trend Badges & Dynamic Glow */
.stat-card-modern {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}
.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.2rem;
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}
.stat-trend.trend-up {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}
.stat-trend.trend-down {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* 6. LMS Custom Widgets: SVG Progress Ring, Streak Counter, Completion Bar */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.progress-ring-svg circle {
  transition: stroke-dashoffset 0.8s ease-in-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.progress-ring-text {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #FF6B00 0%, #FF8800 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(255, 107, 0, 0.25);
  animation: streakPulse 2s infinite alternate ease-in-out;
}
@keyframes streakPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); box-shadow: 0 6px 14px rgba(255, 107, 0, 0.4); }
}

.completion-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--white-overlay-10);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.completion-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Action Button (FAB) */
.fab-quick-action {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
  z-index: 990;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.fab-quick-action:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.55);
}
@media (min-width: 769px) {
  .fab-quick-action { bottom: 2rem; }
}

/* 7. Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none !important;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
  }
  .mobile-nav-item i, .mobile-nav-item [data-lucide] {
    font-size: 1.25rem;
    width: 20px;
    height: 20px;
  }
  .mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
  }
}

/* 8. Tab Transition Animation & Skeleton Loading Shimmer */
.tab-panel.active {
  animation: fadeInUpTab 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes fadeInUpTab {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skeleton-box {
  background: linear-gradient(90deg, var(--white-overlay-05) 25%, var(--white-overlay-10) 50%, var(--white-overlay-05) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   DUAL-THEME GLASSMORPHISM & PREMIUM PILL BUTTON SYSTEM (WHITE & BLACK BG)
   ══════════════════════════════════════════════════════════════════════════════ */

/* 1. Dual-Theme Glassmorphism Cards & Panels */
.glass-card-premium {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1.25rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
  color: #0f172a;
}
.glass-card-premium:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 8px 20px -4px rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
}

[data-theme='dark'] .glass-card-premium,
body.dark-theme .glass-card-premium {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(99, 102, 241, 0.08);
  color: #f8fafc;
}
[data-theme='dark'] .glass-card-premium:hover,
body.dark-theme .glass-card-premium:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

/* 2. Glassmorphism Stat Cards */
.glass-stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.glass-stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--accent-glow, rgba(79,70,229,0.06)) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0.6;
}
.glass-stat-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 18px 36px -8px rgba(0,0,0,0.1), 0 0 20px var(--accent-glow, rgba(79,70,229,0.15));
}
.glass-stat-card:hover::before { opacity: 1; }

[data-theme='dark'] .glass-stat-card,
body.dark-theme .glass-stat-card {
  background: rgba(15, 23, 42, 0.80);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

/* 3. Glowing Icon Pods */
.stat-icon-pod {
  width: 52px;
  height: 52px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -4px var(--pod-shadow, rgba(79,70,229,0.3));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #ffffff;
}
.glass-stat-card:hover .stat-icon-pod {
  transform: scale(1.12) rotate(-4deg);
}

/* Pod Theme Variations */
.stat-icon-pod.pod-blue { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); --pod-shadow: rgba(14,165,233,0.35); }
.stat-icon-pod.pod-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); --pod-shadow: rgba(16,185,129,0.35); }
.stat-icon-pod.pod-indigo { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); --pod-shadow: rgba(99,102,241,0.35); }
.stat-icon-pod.pod-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); --pod-shadow: rgba(245,158,11,0.35); }
.stat-icon-pod.pod-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); --pod-shadow: rgba(139,92,246,0.35); }
.stat-icon-pod.pod-rose { background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%); --pod-shadow: rgba(244,63,94,0.35); }

/* 4. Modern Pill Buttons with Icon Discs (Reference Design Inspired) */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.5rem 1.35rem 0.5rem 0.6rem;
  border-radius: 9999px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  line-height: 1;
  white-space: nowrap;
}
.btn-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}
.btn-pill:active { transform: translateY(0) scale(0.98); }

.btn-pill-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.btn-pill:hover .btn-pill-icon {
  transform: scale(1.1) rotate(6deg);
}

/* Pill Button Color Presets */
.btn-pill-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}
.btn-pill-primary:hover {
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.45);
}

.btn-pill-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.btn-pill-success:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

.btn-pill-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35);
}
.btn-pill-danger:hover {
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.45);
}

.btn-pill-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}
.btn-pill-warning:hover {
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.45);
}

.btn-pill-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}
.btn-pill-info:hover {
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.45);
}

.btn-pill-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}
.btn-pill-purple:hover {
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.45);
}

.btn-pill-glass {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #0f172a !important;
}
[data-theme='dark'] .btn-pill-glass,
body.dark-theme .btn-pill-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
}
.btn-pill-glass .btn-pill-icon {
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
}

/* 5. Glass Tables & Panels */
.glass-table-wrap {
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
[data-theme='dark'] .glass-table-wrap,
body.dark-theme .glass-table-wrap {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
.glass-table th {
  background: rgba(241, 245, 249, 0.8);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #475569;
}
[data-theme='dark'] .glass-table th,
body.dark-theme .glass-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
}
.glass-table tbody tr {
  transition: background 0.2s ease;
}
.glass-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.05);
}
[data-theme='dark'] .glass-table tbody tr:hover,
body.dark-theme .glass-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.12);
}

/* ══════════════════════════════════════════════════════════════════════════════
   ULTRA-PREMIUM LIGHT MODE GLASSMORPHISM & VIBRANT GRADIENT SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */

/* Light Mode Input & Header Fixes */
:root[data-theme="light"] .app-header-search input,
html[data-theme="light"] .app-header-search input,
:root[data-theme="light"] #adminGlobalSearch {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 600;
}
:root[data-theme="light"] #adminGlobalSearch::placeholder {
  color: #64748b !important;
}

/* Light Mode Alert Banners */
:root[data-theme="light"] .pending-approvals-banner,
html[data-theme="light"] .pending-approvals-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%) !important;
  border: 1.5px solid rgba(244, 63, 94, 0.3) !important;
  box-shadow: 0 10px 30px -5px rgba(244, 63, 94, 0.12) !important;
}
:root[data-theme="light"] .pending-approvals-banner .banner-title {
  color: #9f1239 !important;
  font-weight: 900 !important;
}
:root[data-theme="light"] .pending-approvals-banner .banner-sub {
  color: #881337 !important;
  font-weight: 600 !important;
}

/* Light Mode Premium Glass Cards */
:root[data-theme="light"] .glass-card-premium,
html[data-theme="light"] .glass-card-premium {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1.5px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.03) !important;
  color: #0f172a !important;
}
:root[data-theme="light"] .glass-card-premium:hover,
html[data-theme="light"] .glass-card-premium:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 40px -8px rgba(79, 70, 229, 0.12), 0 8px 24px -4px rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
}

/* Light Mode Individual Stat Card Gradient Pastel Tints */
:root[data-theme="light"] .glass-stat-card.d1, html[data-theme="light"] .glass-stat-card.d1 {
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(16, 185, 129, 0.1) !important;
}
:root[data-theme="light"] .glass-stat-card.d2, html[data-theme="light"] .glass-stat-card.d2 {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
  border: 1.5px solid rgba(14, 165, 233, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(14, 165, 233, 0.1) !important;
}
:root[data-theme="light"] .glass-stat-card.d3, html[data-theme="light"] .glass-stat-card.d3 {
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%) !important;
  border: 1.5px solid rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(99, 102, 241, 0.1) !important;
}
:root[data-theme="light"] .glass-stat-card.d4, html[data-theme="light"] .glass-stat-card.d4 {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(245, 158, 11, 0.1) !important;
}
:root[data-theme="light"] .glass-stat-card.d5, html[data-theme="light"] .glass-stat-card.d5 {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%) !important;
  border: 1.5px solid rgba(139, 92, 246, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(139, 92, 246, 0.1) !important;
}
:root[data-theme="light"] .glass-stat-card.d6, html[data-theme="light"] .glass-stat-card.d6 {
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%) !important;
  border: 1.5px solid rgba(244, 63, 94, 0.25) !important;
  box-shadow: 0 10px 30px -4px rgba(244, 63, 94, 0.1) !important;
}

:root[data-theme="light"] .stat-card-value {
  color: #0f172a !important;
}
:root[data-theme="light"] .stat-card-label {
  color: #475569 !important;
  font-weight: 800 !important;
}

/* Light Mode Pill Buttons Contrast Enhancements */
:root[data-theme="light"] .btn-pill-info {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4) !important;
}
:root[data-theme="light"] .btn-pill-danger {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.4) !important;
}
:root[data-theme="light"] .btn-pill-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4) !important;
}
:root[data-theme="light"] .btn-pill-glass {
  background: rgba(241, 245, 249, 0.9) !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}
:root[data-theme="light"] .btn-pill-glass .btn-pill-icon {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}


/* ══════════════════════════════════════════════════════════════════════════════
   ULTRA-MODERN GLASS SEARCH BAR & HEADER BUTTON SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */

.header-glass-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1rem 0.45rem 0.9rem;
  border-radius: 9999px;
  background: rgba(241, 245, 249, 0.95);
  border: 1.5px solid rgba(203, 213, 225, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 320px;
  max-width: 450px;
  width: 100%;
}
.header-glass-search:focus-within {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.25), 0 0 0 4px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}
.header-glass-search .search-icon {
  font-size: 1rem;
  color: #64748b;
  transition: transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}
.header-glass-search:focus-within .search-icon {
  color: #6366f1;
  transform: scale(1.15);
}
.header-glass-search input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.header-glass-search input::placeholder {
  color: #64748b !important;
  font-weight: 600;
}
.header-glass-search .search-kbd-chip {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-heading, sans-serif);
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme='dark'] .header-glass-search,
body.dark-theme .header-glass-search {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
[data-theme='dark'] .header-glass-search:focus-within,
body.dark-theme .header-glass-search:focus-within {
  background: rgba(15, 23, 42, 0.95);
  border-color: #818cf8;
  box-shadow: 0 8px 24px -4px rgba(129, 140, 248, 0.3), 0 0 0 4px rgba(129, 140, 248, 0.15);
}
[data-theme='dark'] .header-glass-search input,
body.dark-theme .header-glass-search input {
  color: #f8fafc !important;
}
[data-theme='dark'] .header-glass-search input::placeholder,
body.dark-theme .header-glass-search input::placeholder {
  color: #94a3b8 !important;
}
[data-theme='dark'] .header-glass-search .search-kbd-chip,
body.dark-theme .header-glass-search .search-kbd-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}


/* ══════════════════════════════════════════════════════════════════════════════
   FUTURISTIC 3D HYPER-GLOSSY LIQUID GLASS DESIGN SYSTEM
   Inspired by Apple Aqua, Figma 3D Glass, & Tactile Neomorphic UI
   ══════════════════════════════════════════════════════════════════════════════ */

/* Ambient Liquid Mesh Background for Light Mode */
:root[data-theme="light"], html[data-theme="light"], body[data-theme="light"] {
  background-color: #f8fafc !important;
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 85% 20%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(244, 63, 94, 0.06) 0px, transparent 50%),
    radial-gradient(at 80% 85%, rgba(16, 185, 129, 0.07) 0px, transparent 50%) !important;
  background-attachment: fixed !important;
}

/* 3D HYPER-GLOSSY HEADER SEARCH BAR */
.header-glass-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem 0.4rem 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.85) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(15, 23, 42, 0.05),
    0 10px 25px -5px rgba(99, 102, 241, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 340px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

/* Glass Specular Gloss Arc Effect */
.header-glass-search::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.15) 100%);
  border-radius: 9999px 9999px 0 0;
  pointer-events: none;
}

.header-glass-search:focus-within {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 
    inset 0 2px 6px rgba(255, 255, 255, 1),
    0 14px 35px -5px rgba(99, 102, 241, 0.3),
    0 0 0 4px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px) scale(1.01);
}

.search-icon-pod {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  box-shadow: 
    inset 0 2px 3px rgba(255, 255, 255, 0.6),
    0 4px 10px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.header-glass-search:focus-within .search-icon-pod {
  transform: rotate(15deg) scale(1.1);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

.header-glass-search input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a !important;
  padding: 0 0.25rem !important;
  box-shadow: none !important;
  z-index: 2;
}

.header-glass-search input::placeholder {
  color: #64748b !important;
  font-weight: 600;
}

/* 3D Tactile KBD Chip */
.search-kbd-chip {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  border: 1px solid rgba(203, 213, 225, 0.9);
  color: #334155;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-heading, sans-serif);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 4px rgba(15, 23, 42, 0.1);
  z-index: 2;
  letter-spacing: 0.04em;
}

/* Dark Mode 3D Hyper-Glossy Search */
[data-theme='dark'] .header-glass-search,
body.dark-theme .header-glass-search {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    0 10px 25px -5px rgba(0, 0, 0, 0.4);
}
[data-theme='dark'] .header-glass-search::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.02) 100%);
}
[data-theme='dark'] .header-glass-search:focus-within {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 
    inset 0 1px 3px rgba(255, 255, 255, 0.3),
    0 14px 35px -5px rgba(129, 140, 248, 0.35),
    0 0 0 4px rgba(129, 140, 248, 0.2);
}
[data-theme='dark'] .header-glass-search input {
  color: #f8fafc !important;
}
[data-theme='dark'] .header-glass-search input::placeholder {
  color: #94a3b8 !important;
}
[data-theme='dark'] .search-kbd-chip {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 3D FUTURISTIC HYPER-GLOSSY PILL BUTTONS */
.btn-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.35rem 0.55rem 0.5rem;
  border-radius: 9999px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

/* Specular Reflection Gloss Overlay */
.btn-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-radius: 9999px 9999px 0 0;
  pointer-events: none;
}

.btn-pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #e2e8f0);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 
    inset 0 -2px 4px rgba(0, 0, 0, 0.15),
    0 3px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.btn-pill:hover {
  transform: translateY(-3px) scale(1.02);
}

.btn-pill:hover .btn-pill-icon {
  transform: scale(1.12) rotate(10deg);
}

.btn-pill:active {
  transform: translateY(0) scale(0.98);
}

/* Primary Indigo 3D Pill */
.btn-pill-primary {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 10px 25px -4px rgba(79, 70, 229, 0.45);
}
.btn-pill-primary:hover {
  box-shadow: 
    inset 0 1px 3px rgba(255, 255, 255, 0.7),
    0 14px 30px -4px rgba(79, 70, 229, 0.6);
}

/* Danger Crimson 3D Pill */
.btn-pill-danger {
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 10px 25px -4px rgba(225, 29, 72, 0.45);
}
.btn-pill-danger:hover {
  box-shadow: 
    inset 0 1px 3px rgba(255, 255, 255, 0.7),
    0 14px 30px -4px rgba(225, 29, 72, 0.6);
}

/* Success Emerald 3D Pill */
.btn-pill-success {
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 10px 25px -4px rgba(16, 185, 129, 0.45);
}

/* Info Aqua Cyan 3D Pill */
.btn-pill-info {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 10px 25px -4px rgba(2, 132, 199, 0.45);
}

/* Frosted Glass Pill */
.btn-pill-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.85) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  color: #0f172a !important;
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(15, 23, 42, 0.05),
    0 8px 20px -4px rgba(15, 23, 42, 0.08);
}
[data-theme='dark'] .btn-pill-glass {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    0 8px 20px -4px rgba(0, 0, 0, 0.4);
}
[data-theme='dark'] .btn-pill-glass .btn-pill-icon {
  background: radial-gradient(circle at 30% 30%, #334155, #1e293b);
  color: #ffffff;
}


/* ══════════════════════════════════════════════════════════════════════════════
   DESKTOP ALWAYS-VISIBLE SIDEBAR & COMPACT 3D GLASS SEARCH FIX
   ══════════════════════════════════════════════════════════════════════════════ */

/* COMPACT 3D GLASS SEARCH PILL */
.header-glass-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.85) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(15, 23, 42, 0.05),
    0 6px 18px -4px rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 250px !important;
  max-width: 250px !important;
  flex-shrink: 0;
  box-sizing: border-box;
}

.header-glass-search:focus-within {
  width: 320px !important;
  max-width: 320px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 
    inset 0 2px 6px rgba(255, 255, 255, 1),
    0 12px 28px -5px rgba(99, 102, 241, 0.25),
    0 0 0 3px rgba(99, 102, 241, 0.12);
}

.search-icon-pod {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.78rem !important;
}

.header-glass-search input {
  font-size: 0.82rem !important;
}

.search-kbd-chip {
  font-size: 0.65rem !important;
  padding: 0.18rem 0.45rem !important;
}

/* DESKTOP SIDEBAR ALWAYS VISIBLE ENFORCEMENT */
@media (min-width: 992px) {
  .app-sidebar, #appSidebar, .sidebar, .premium-sidebar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 100 !important;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.05) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .app-main {
    flex: 1 !important;
    width: calc(100% - 260px) !important;
    min-width: 0 !important;
  }
  .header-burger {
    display: none !important;
  }
}

/* MOBILE SIDEBAR SHOW FIX */
@media (max-width: 991px) {
  .app-sidebar, #appSidebar, .sidebar, .premium-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 270px !important;
    height: 100vh !important;
    z-index: 999999 !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
  }
  .app-sidebar.mobile-open, #appSidebar.mobile-open {
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}


/* ══════════════════════════════════════════════════════════════════════════════
   EXACT DESIGN FROM REFERENCE IMAGE 2: CAPSULE SEARCH WITH RIGHT GRADIENT BUTTON
   ══════════════════════════════════════════════════════════════════════════════ */

.header-search-capsule {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  width: 280px;
  max-width: 340px;
  padding: 0 0.25rem 0 1.1rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 1),
    0 4px 14px rgba(15, 23, 42, 0.06);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  overflow: hidden;
}

.header-search-capsule:focus-within {
  width: 360px;
  border-color: #06b6d4;
  box-shadow: 
    0 8px 24px -4px rgba(6, 182, 212, 0.25),
    0 0 0 3.5px rgba(6, 182, 212, 0.15);
}

.header-search-capsule input {
  flex: 1;
  width: 100%;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a !important;
  padding: 0 0.5rem 0 0 !important;
  box-shadow: none !important;
}

.header-search-capsule input::placeholder {
  color: #64748b !important;
  font-weight: 600;
}

.search-submit-btn {
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 60%, #84cc16 100%);
  border: none;
  color: #ffffff;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.search-submit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.5);
}

.search-submit-btn:active {
  transform: scale(0.97);
}

.search-submit-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.search-submit-kbd {
  font-size: 0.68rem;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-weight: 900;
}

/* Dark Mode Reference Capsule */
[data-theme='dark'] .header-search-capsule,
body.dark-theme .header-search-capsule {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .header-search-capsule input {
  color: #f8fafc !important;
}

[data-theme='dark'] .header-search-capsule input::placeholder {
  color: #94a3b8 !important;
}


/* ══════════════════════════════════════════════════════════════════════════════
   COMPACT CAPSULE FIX — ZERO RECTANGLE OUTLINE ON INPUT
   ══════════════════════════════════════════════════════════════════════════════ */

.header-search-capsule {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 38px !important;
  width: 230px !important;
  max-width: 280px !important;
  padding: 0 0.2rem 0 0.85rem !important;
  border-radius: 9999px !important;
  background: #ffffff !important;
  border: 1.5px solid #06b6d4 !important;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.12) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.header-search-capsule:focus-within {
  width: 290px !important;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25), 0 0 0 3px rgba(6, 182, 212, 0.15) !important;
}

.header-search-capsule input,
.header-search-capsule input:focus,
.header-search-capsule input:active,
.header-search-capsule input:hover {
  flex: 1 !important;
  width: 100% !important;
  border: none !important;
  border-style: none !important;
  background: transparent !important;
  background-color: transparent !important;
  outline: none !important;
  outline-style: none !important;
  box-shadow: none !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  color: #0f172a !important;
  padding: 0 0.35rem 0 0 !important;
  margin: 0 !important;
  height: 100% !important;
  line-height: normal !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.header-search-capsule input::placeholder {
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
}

.search-submit-btn {
  height: 30px !important;
  padding: 0 0.65rem !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  cursor: pointer !important;
  box-shadow: 0 3px 8px rgba(6, 182, 212, 0.35) !important;
  flex-shrink: 0 !important;
}

.search-submit-btn:hover {
  transform: scale(1.05) !important;
}


/* ══════════════════════════════════════════════════════════════════════════════
   STICKY LAYOUT ENFORCEMENT — SIDEBAR, TOPBAR HEADER, & FOOTER
   ══════════════════════════════════════════════════════════════════════════════ */

/* 1. Sticky Topbar Header */
.app-header, nav.pub-nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  background: var(--bg-surface, rgba(255, 255, 255, 0.95)) !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

/* 2. Fixed Left Sidebar on Desktop */
@media (min-width: 992px) {
  .app-sidebar, #appSidebar, .sidebar, .premium-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-right: 1px solid var(--border-color, #e2e8f0) !important;
  }

  .app-main {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* 3. Sticky Pinned Bottom Footer */
.app-footer, footer.app-footer {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 998 !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  background: var(--bg-surface, rgba(255, 255, 255, 0.95)) !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04) !important;
  margin-top: auto !important;
}
