/* IMPORT PREMIUM FONTS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('custom-select.css');

:root {
    /* PREMIUM COLOR PALETTE */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-dark: #4f46e5;
    /* Indigo 600 */
    --secondary: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --dark: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --white: #ffffff;
    --bg-soft: rgba(0, 0, 0, 0.05);

    /* SHADOWS & GLASS */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* BORDERS */
    --radius: 12px;
}

/* GLOBAL RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--dark);
    font-size: 15px;
    line-height: 1.6;
    /* Hide scrollbar for the page */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

* {
    scrollbar-width: none;
}

/* LAYOUT & CONTAINER */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.6s ease-out;
}

/* HEADER (Premium Navbar) */
.header {
    background: var(--white);
    color: var(--dark);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

/* =========================================
   SIDEBAR LAYOUT (Premium)
   ========================================= */
body {
    display: block;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    left: 20px;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    border-radius: 0 0 24px 24px;
    border: 1px solid var(--border-color);
    border-top: none;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    padding: 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.nav-item:hover i,
.nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.text-danger:hover {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-left-color: #ef4444 !important;
}

.text-danger i {
    color: #f87171 !important;
}

.main-content {
    width: 100%;
    margin-left: 0;
    padding-left: 320px;
    /* Offset by 320px to start after the 280px sidebar + 20px margin + 20px gap */
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: padding 0.4s ease;
}



.header {
    background: transparent;
    color: var(--dark);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border: none;
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.header div:first-child {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: #f1f5f9;
}

.header a:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

/* CARDS (Glassmorphism Effect) */
.card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.5s ease-out;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card h1,
.card h2,
.card h3,
.card h4 {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

/* PREMIUM GLASSMORPHIC CARDS */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(139, 92, 246, 0.2);
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(139, 92, 246, 0.4);
}

/* DASHBOARD GRID (Responsive) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Premium Class Cards */
.class-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.class-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .class-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    background: rgba(30, 41, 59, 0.9);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.class-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.glass-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: inline-block;
}

.class-icon-wrapper {
    background: linear-gradient(135deg, var(--primary-soft), transparent);
    color: var(--primary);
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.class-footer {
    border-top: 1px solid var(--grid-line);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.dashboard-stat {
    text-align: center;
}

.dashboard-stat p {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
    background: linear-gradient(135deg, var(--dark), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* MODERN INPUTS */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: none;
}

.input-group {
    position: relative;
    border-radius: 14px;
    background: var(--border-color);
    padding: 1px;
}

.input-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 120px at var(--x, 50%) var(--y, 50%), var(--primary), transparent 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.input-group:hover::before,
.input-group:focus-within::before {
    opacity: 1;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    pointer-events: none;
    transition: color 0.3s;
    z-index: 2;
}

.form-control {
    width: 100%;
    padding: 16px 20px 16px 55px;
    /* Space for icon */
    border: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    /* Explicitly visible border */
    border-radius: 13px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--bg-color);
    /* Use solid bg to prevent border glow bleeding */
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .form-control {
    border-color: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: transparent;
    /* Handled by interactive placeholder */
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
    /* Primary color */
}

@keyframes typingGlow {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 14px rgba(139, 92, 246, 0.9);
    }
}

.form-control.is-typing {
    animation: typingGlow 0.2s ease-out;
}

.form-control:focus+.input-icon,
.input-group:focus-within .input-icon {
    color: var(--primary);
}

/* Custom Webkit Styling for Native Date Picker */
::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}

::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

[data-theme="dark"] ::-webkit-calendar-picker-indicator {
    filter: invert(1) hue-rotate(180deg) brightness(1.5);
    opacity: 0.8;
}

[data-theme="dark"] ::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Custom Flatpickr Theme override for Glassmorphism UI */
.flatpickr-calendar {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    border-radius: 16px !important;
    padding: 15px 10px 10px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    font-family: 'Inter', sans-serif !important;
    color: var(--text-color) !important;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (max-width: 480px) {
    .flatpickr-calendar {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
}

[data-theme="dark"] .flatpickr-calendar {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4) !important;
    background: rgba(15, 23, 42, 0.85) !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
    display: none !important;
    /* Hide the ugly default borders arrow */
}

.flatpickr-months .flatpickr-month {
    color: var(--text-color) !important;
    fill: var(--text-color) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--text-color) !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.flatpickr-day {
    color: var(--text-color) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 500 !important;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--primary-soft) !important;
    border-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    transform: scale(1.05);
}

[data-theme="dark"] .flatpickr-day:hover,
[data-theme="dark"] .flatpickr-day:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3) !important;
    transform: scale(1.05);
    font-weight: 600 !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-muted) !important;
    opacity: 0.2 !important;
    background: transparent !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-muted) !important;
    opacity: 0.5 !important;
}

/* Custom Select Dropdowns for Date */
select[name^="dob_"],
select[name^="full_dob_"] {
    background-color: transparent;
    color: var(--text-color);
    outline: none;
    box-shadow: none;
}

select[name^="dob_"] option,
select[name^="full_dob_"] option {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 10px;
    font-size: 0.95rem;
}

[data-theme="dark"] select[name^="dob_"] option,
[data-theme="dark"] select[name^="full_dob_"] option {
    background-color: #1e293b;
    /* Dark mode dropdown bg */
    color: #f8fafc;
}

/* Force Native Dropdown Size Limits (WebKit) */
select[name^="dob_"]:focus option,
select[name^="full_dob_"]:focus option {
    max-height: 200px;
    overflow-y: auto;
}

select::-webkit-scrollbar {
    width: 6px;
}

select::-webkit-scrollbar-track {
    background: transparent;
}

select::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

select::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Interactive Placeholder */
.interactive-placeholder {
    position: absolute;
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 5;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

.shatter-text {
    display: flex;
}

.shatter-text span {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.float-text {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left top;
    padding: 0 4px;
    border-radius: 4px;
    position: relative;
}

.interactive-placeholder.focused .float-text {
    color: var(--primary);
    background: var(--card-bg);
    /* Match the modal's card-bg so it blends in */
    font-weight: 500;
}

.textarea-group .input-icon {
    top: 22px;
    transform: none;
}

.textarea-group .interactive-placeholder {
    top: 22px;
    transform: none;
    height: 22px;
}

/* Custom Dropdown */
.custom-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-color);
    /* Solid base */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 20px 12px 55px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 1px solid var(--grid-line);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option.selected {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.custom-option:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

.input-group.open .dropdown-icon {
    transform: translateY(-50%) rotate(180deg) !important;
    color: var(--primary) !important;
}

.custom-dropdown::-webkit-scrollbar {
    display: none;
}

.custom-dropdown {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom Select Dropdown - Native Fallback / Hidden by JS */
select.form-control {
    appearance: none;
    /* background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em; */
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.95rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn:hover {
    filter: brightness(110%);
    transform: translateY(-2px);
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: transparent;
}

[data-theme="dark"] .table-responsive {
    background: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    white-space: nowrap;
}

th {
    background: var(--sidebar-hover);
    padding: 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

tr:last-child td {
    border-bottom: none;
}

/* Table Dark Mode Overrides */
[data-theme="dark"] table {
    background: transparent;
}

[data-theme="dark"] th {
    background: rgba(30, 41, 59, 1);
    color: #94a3b8;
}

[data-theme="dark"] td {
    color: #f8fafc;
    border-color: #334155;
}

/* BADGES */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bg-active {
    background: #dcfce7;
    color: #166534;
}

.bg-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.bg-draft {
    background: #fef3c7;
    color: #92400e;
}

/* ALERTS */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #15803d;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: row;
        padding: 12px 15px;
    }

    /* Keep logo and logout on same line */
    .header div:first-child {
        font-size: 1.1rem;
    }

    .card {
        padding: 20px;
    }

    .btn {
        width: 100%;
        display: block;
        margin-bottom: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    table {
        font-size: 0.9rem;
    }
}

/* SKELETON LOADER FOR BROKEN IMAGES */
.skeleton-img {
    background: linear-gradient(90deg, var(--card-bg, #f1f5f9) 25%, var(--border-color, #e2e8f0) 50%, var(--card-bg, #f1f5f9) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius, 8px);
    display: inline-block;
    min-width: 40px;
    min-height: 40px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   PREMIUM SAAS PROFILE UI (Enterprise Grade)
   ========================================= */

/* Page Layout & Grid */
.saas-layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .saas-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Sticky Action Header */
.action-header {
    /* Removed sticky to prevent overlap with content */
    z-index: 90;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* IDENTITY CARD (Hero Element) */
.identity-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.id-card-top {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    padding: 40px 20px 30px;
    color: white;
    position: relative;
}

/* Holographic/Glass Effect Overlay */
.id-card-top::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    transform: rotate(45deg);
    pointer-events: none;
}

.logo-uploader {
    width: 140px;
    height: 140px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-uploader:hover {
    transform: scale(1.05);
}

.logo-uploader img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #f1f5f9;
}

.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(2px);
}

.logo-uploader:hover .upload-overlay {
    opacity: 1;
}

.id-school-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.id-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    backdrop-filter: blur(4px);
}

.id-card-body {
    padding: 25px;
}

.id-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

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

.id-label {
    color: var(--text-muted);
    font-weight: 500;
}

.id-value {
    color: var(--dark);
    font-weight: 600;
}

/* EDITABLE CARDS */
.settings-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.settings-card h3 {
    font-size: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modern Input Groups */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon {
    padding-left: 45px;
}

/* Branding Preview Section */
.branding-preview-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.mockup-mini {
    min-width: 160px;
    height: 100px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mockup-mini img {
    max-height: 30px;
    margin-bottom: 5px;
}

/* Table Avatar */
.table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 12px;
    border: 2px solid #f1f5f9;
}

/* =========================================
   DASHBOARD MODULES (Redesign)
   ========================================= */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.module-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: #f8fafc;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
    border: 1px solid var(--border-color);
}

.module-card:hover .module-icon {
    background: #e0e7ff;
    color: var(--primary);
    border-color: #c7d2fe;
}

.module-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.module-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nav-link {
    margin-left: 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

/* =========================================
   PREMIUM ATTENDANCE UI
   ========================================= */

/* 3D Calendar / Date Picker Bar */
.date-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    padding: 15px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.date-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pill Toggles for Attendance */
.att-toggle-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 50px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.att-btn {
    padding: 8px 16px;
    border-radius: 50px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.att-btn:hover {
    color: var(--dark);
}

/* Active States */
.att-btn input {
    display: none;
}

/* Hide radio */

.att-btn.active-present {
    background: var(--white);
    color: #10b981;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2);
}

.att-btn.active-absent {
    background: var(--white);
    color: #ef4444;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.2);
}

.att-btn.active-late {
    background: var(--white);
    color: #f59e0b;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.2);
}

.att-btn.active-leave {
    background: var(--white);
    color: #3b82f6;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
}

/* Analytics Cards */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.metric-card h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}

.metric-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.metric-card .trend {
    font-size: 0.8rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend.up {
    color: #10b981;
}

.trend.down {
    color: #ef4444;
}

/* Progress Bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Locked State */
.locked-overlay {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(1);
}

.lock-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================
   PREMIUM CLASS MANAGEMENT UI
   ========================================= */

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Animated Ready Button State */
.btn-primary.ready-btn {
    color: var(--primary);
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.3);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

[data-theme="dark"] .btn-primary.ready-btn {
    background: rgba(139, 92, 246, 0.15);
}

.btn-primary.ready-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    border-radius: 12px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
    background-size: 200% auto;
    animation: pingPongLight 1.5s linear infinite alternate;
    opacity: 0.6;
}

@keyframes pingPongLight {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 100% center;
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Class Hub Layout */
.hub-header {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hub-title h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hub-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Premium Tabs */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: none;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Section Cards */
.section-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.section-card:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

/* =========================================
   PREMIUM SUBJECTS UI
   ========================================= */

/* Subject Card */
.subject-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.subject-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.subject-type-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* Chips for Classes/Teachers */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.chip {
    background: #f1f5f9;
    color: var(--dark);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Multi-Select Box Style */
.multi-select-box {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
    background: #f8fafc;
}

.multi-select-item {
    display: block;
    padding: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.multi-select-item:hover {
    background: #e0e7ff;
    border-radius: 6px;
}

.multi-select-item input {
    margin-right: 10px;
}

/* =========================================
   ENTERPRISE DELETE & UNDO UI
   ========================================= */

/* Undo Toast */
.undo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 320px;
    justify-content: space-between;
}

.undo-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.undo-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

.undo-timer {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Recycle Bin */
.deleted-row {
    background: #fef2f2;
    opacity: 0.8;
}

.deleted-row:hover {
    opacity: 1;
}

.restore-btn {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.restore-btn:hover {
    text-decoration: underline;
}

/* =========================================
   GLOBAL ICON SYSTEM (Premium SVG)
   ========================================= */
.lucide {
    width: 1.2em;
    height: 1.2em;
    vertical-align: text-bottom;
    stroke-width: 2;
}

.btn .lucide {
    margin-right: 8px;
}

.module-icon .lucide {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

/* =========================================
   APP-LIKE PERFORMANCE UI (SPA FEEL)
   ========================================= */

/* Top Progress Bar */
#app-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.2s ease;
    box-shadow: 0 0 10px var(--primary);
}

/* Page Transition Animation */
.app-content-enter {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Skeleton Loading Overlay */
.app-skeleton-overlay {
    position: fixed;
    top: 70px;
    /* Below header */
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    background: var(--bg-body);
    z-index: 900;
    padding: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.app-skeleton-overlay.active {
    display: block;
    opacity: 1;
}

.skeleton-line {
    height: 20px;
    background: #e2e8f0;
    margin-bottom: 15px;
    border-radius: 4px;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #e2e8f0 4%, #f1f5f9 25%, #e2e8f0 36%);
    background-size: 1000px 100%;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* =========================================
   PREMIUM INVITE SYSTEM UI
   ========================================= */

.invite-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.invite-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.copy-box {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.copy-box:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.copy-box:active {
    transform: scale(0.98);
}

/* =========================================
   PREMIUM OFFLINE DETECTION UI
   ========================================= */

.offline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.offline-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Backdrop: Blur + Dim */
.offline-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    /* Dark Slate Dim */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* Glassmorphic Card */
.offline-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px 50px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white;
    position: relative;
    overflow: hidden;
    max-width: 90%;
    width: 400px;
}

.offline-overlay.active .offline-card {
    transform: scale(1) translateY(0);
}

/* Ambient Glow Animation */
.offline-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    animation: ambient-breathe 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ambient-breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* WiFi Icon Animation */
.wifi-loader {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.wifi-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.wifi-arc {
    position: absolute;
    border: 4px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}

.arc-1 {
    width: 24px;
    height: 24px;
    bottom: 4px;
    animation: wifi-flash 2s infinite 0.3s;
}

.arc-2 {
    width: 40px;
    height: 40px;
    bottom: 4px;
    animation: wifi-flash 2s infinite 0.6s;
}

.arc-3 {
    width: 56px;
    height: 56px;
    bottom: 4px;
    animation: wifi-flash 2s infinite 0.9s;
}

@keyframes wifi-flash {

    0%,
    100% {
        border-top-color: rgba(255, 255, 255, 0.1);
        filter: drop-shadow(0 0 0 transparent);
    }

    50% {
        border-top-color: #6366f1;
        filter: drop-shadow(0 0 8px #6366f1);
    }
}

/* Typography */
.offline-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.offline-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
}

.offline-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* =========================================
   HOMEWORK MODULE UI
   ========================================= */

/* File Upload Zone */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8fafc;
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: #e0e7ff;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Homework Cards (Student View) */
.hw-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.hw-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.hw-subject {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: #e0e7ff;
    padding: 4px 10px;
    border-radius: 20px;
}

.hw-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.hw-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.hw-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hw-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-top: 10px;
}

/* Due Date Badges */
.due-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.due-soon {
    background: #fef3c7;
    color: #b45309;
}

/* Yellow */
.due-today {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}

/* Orange */
.overdue {
    background: #fee2e2;
    color: #991b1b;
}

/* Red */
.future {
    background: #dcfce7;
    color: #166534;
}

/* Green */

/* Attachment Link */
.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f1f5f9;
    color: var(--dark);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.attachment-link:hover {
    background: var(--dark);
    color: white;
}

/* =========================================
   GLASSMORPHISM & PREMIUM FORM UI
   ========================================= */

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    padding: 30px;
    position: relative;
}

.glass-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 15px;
}

/* Floating Labels */
.form-floating {
    position: relative;
    margin-bottom: 20px;
}

.form-floating .form-control {
    height: 56px;
    padding: 24px 16px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-floating .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-floating label {
    position: absolute;
    top: 18px;
    left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.2s ease;
    transform-origin: 0 0;
}

.form-floating .form-control:focus~label,
.form-floating .form-control:not(:placeholder-shown)~label {
    transform: translateY(-10px) scale(0.85);
    color: var(--primary);
    font-weight: 600;
}

/* Modern Date Picker Styling */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    color: var(--dark);
    font-family: 'Poppins', sans-serif;
}

/* Button Glow */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.btn-glow:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* =========================================
   TIMETABLE & BELL UI
   ========================================= */

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* =========================================
   PREMIUM TIMELINE SYSTEM (STRUCTURED FLOW)
   ========================================= */

.timeline-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
    margin-bottom: 30px;
    /* Increased space for gap indicator */
    margin-left: 30px;
    /* Space for the spine */
    z-index: 1;
}

/* 1. MAIN AXIS (The Spine) */
.timeline-connector {
    position: absolute;
    left: -30px;
    /* Positioned relative to card margin-left */
    top: 0;
    bottom: -30px;
    /* Extend to cover margin */
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}

/* 2. START NODE (Top of First Bell) */
.timeline-item:first-child .timeline-connector {
    top: 20px;
    /* Start aligned with card center/top */
}

.timeline-item:first-child .timeline-connector::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -5px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px #e0e7ff;
    z-index: 2;
}

/* 3. END NODE (Bottom of Last Bell) */
.timeline-item:last-child .timeline-connector {
    bottom: auto;
    height: 100%;
    /* Stop at the bottom of the card */
}

.timeline-item:last-child .timeline-connector::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
}

/* 4. CONNECTOR NODE (Horizontal Link to Card) */
.timeline-node-connector {
    position: absolute;
    left: -30px;
    top: 50%;
    width: 30px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    transform: translateY(-50%);
}

.timeline-node-dot {
    position: absolute;
    left: -4px;
    /* On the spine */
    top: -3px;
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* 5. GAP INDICATOR */
.timeline-gap-badge {
    position: absolute;
    bottom: -24px;
    /* Position in the gap area */
    left: 10px;
    /* Offset from spine */
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 6. FLOW ARROW */
.timeline-arrow {
    position: absolute;
    bottom: -15px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #cbd5e1;
}

.timeline-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.timeline-item.break,
.timeline-item.lunch {
    border-left-color: var(--warning);
    background: #fffbeb;
}

.timeline-item.assembly {
    border-left-color: var(--secondary);
    background: #f0fdf4;
}

.timeline-item.custom {
    border-left-color: #8b5cf6;
    background: #f5f3ff;
}

/* Violet for Custom */

.time-col {
    font-family: monospace;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    width: 80px;
    color: var(--dark);
}

.time-col .end {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-col {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bell-badge {
    font-weight: 700;
    font-size: 1rem;
}

.type-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: #f1f5f9;
    color: var(--dark);
}

.type-badge.regular {
    background: #e0e7ff;
    color: var(--primary);
}

.type-badge.break,
.type-badge.lunch {
    background: #fef3c7;
    color: #b45309;
}

.type-badge.assembly {
    background: #dcfce7;
    color: #166534;
}

.type-badge.custom {
    background: #ede9fe;
    color: #7c3aed;
}

/* Violet for Custom */

.duration-badge {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
    margin-left: 10px;
}

.copy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.action-col {
    margin-left: auto;
}

.btn-icon-danger {
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-icon-danger:hover {
    color: var(--danger);
}

/* CONFLICT MODAL SPECIFIC */
.modal-overlay {
    z-index: 9999;
    /* Ensure it is above everything */
}

.modal-content {
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   SCROLLBAR UTILITIES (PREMIUM HIDDEN)
   ========================================= */
.tp-dropdown,
.multi-select-box,
.modal-content {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.tp-dropdown::-webkit-scrollbar,
.multi-select-box::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* =========================================
   PREMIUM TIME PICKER UI (FIXED)
   ========================================= */

.tp-container {
    position: relative;
    width: 100%;
    display: block;
    margin-bottom: 10px;
}

.tp-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.tp-wrapper {
    display: flex;
    gap: 10px;
}

.tp-box {
    flex: 1;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    /* Rounded 18px as requested */
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 0;
    /* Flexbox fix */
    box-shadow: var(--shadow-sm);
}

.tp-box:hover {
    border-color: var(--primary);
    background: var(--bg-soft);
}

.tp-box.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
    background: var(--bg-color);
}

.tp-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.tp-icon {
    width: 16px;
    color: var(--text-muted);
}

/* Dropdown Styling */
.tp-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.1),
        0 4px 10px -5px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    /* Ensure it's on top of everything */
    padding: 8px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tp-dropdown.show {
    display: grid;
}

/* Single Select Variant (For Period Type) */
.tp-dropdown.single-select {
    grid-template-columns: 1fr;
    padding: 6px;
}

.tp-dropdown.single-select .tp-option {
    text-align: left;
    padding: 12px 15px;
}

/* Upward Variant for Intelligent Positioning */
.tp-dropdown.up {
    top: auto;
    bottom: calc(100% + 8px);
    transform-origin: bottom center;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tp-option {
    padding: 10px 4px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-option:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
    transform: scale(1.05);
}

.tp-option.selected {
    background: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Validation States */
.tp-error .tp-box {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    /* Match danger background */
    animation: shake 0.4s ease-in-out;
}

.tp-error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 8px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 6px;
}

.tp-error .tp-error-message {
    display: flex;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* =========================================
   TIMETABLE GRID UI
   ========================================= */

.tt-grid-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CARD BASE */
.tt-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.tt-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

/* REGULAR CLASS CARD */
.tt-card-regular {
    border-left: 5px solid var(--primary);
}

/* SPECIAL CARD (Break/Lunch) */
.tt-card-special {
    background: #f8fafc;
    border-left: 5px solid var(--warning);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    min-height: 80px;
}

/* HEADER SECTION */
.tt-card-header {
    background: #f8fafc;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-card-special .tt-card-header {
    background: transparent;
    border-bottom: none;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.tt-bell-badge {
    font-weight: 700;
    color: var(--dark);
    font-size: 0.9rem;
}

.tt-time-badge {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* BODY SECTION */
.tt-card-body {
    padding: 20px;
}

.tt-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.tt-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-select {
    width: 100%;
}

/* SPECIAL CONTENT CENTERED */
.tt-special-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 auto;
}

.tt-special-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* WIZARD GRID */
.wizard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* WIZARD STEPS */
.step-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num {
    background: var(--dark);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.step-label-sm {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-badge-sm {
    background: #e2e8f0;
    color: var(--dark);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* MOBILE DESKTOP RECOMMENDATION OVERLAY */
#mobile-notice {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    color: white;
}

@media (max-width: 767px) {
    #mobile-notice {
        display: flex;
    }

    body:has(#mobile-notice) {
        overflow: hidden !important;
    }
}

.mobile-notice-content {
    max-width: 400px;
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.monitor-icon {
    position: relative;
    width: 90px;
    height: 90px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: #8b5cf6;
}

.monitor-icon i {
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.3);
    animation: pulseNotice 2s infinite;
}

.mobile-notice-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-notice-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.device-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.mini-icon {
    width: 14px;
    height: 14px;
}

@keyframes pulseNotice {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.3);
        opacity: 0;
    }

    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   EXTRACTED GLOBAL UI COMPONENTS
   ========================================= */

/* Grid Background Pattern */
.grid-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
}

/* Form Container */
.form-wrapper { 
    width: 100%; 
    max-width: 450px; 
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; 
    position: relative; 
    z-index: 10;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Form Elements */
.form-header { margin-bottom: 25px; text-align: center; }
.form-header p { color: var(--form-header-color); font-size: 0.95rem; font-weight: 400; }
.brand-logo { height: 120px; margin-bottom: 25px; transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.form-group { margin-bottom: 22px; position: relative; }

/* Interactive Particle Placeholder & Auth Input Glow (Missing from base style.css) */
.interactive-placeholder {
    position: absolute;
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    height: 22px;
    pointer-events: none;
    z-index: 5;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}
.shatter-text { display: flex; }
.shatter-text span {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.float-text {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left top;
    padding: 0 4px;
    border-radius: 4px;
    position: relative;
}
.interactive-placeholder.focused .float-text {
    color: var(--primary);
    background: transparent;
    font-weight: 500;
}

/* Active animated border state for ready-btn */
.btn.ready-btn, .btn-primary.ready-btn {
    color: #4f46e5;
    border-color: rgba(79, 70, 229, 0.4);
    background: rgba(79, 70, 229, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s;
}

[data-theme="dark"] .btn.ready-btn, [data-theme="dark"] .btn-primary.ready-btn {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.2);
}

.btn.ready-btn::before, .btn-primary.ready-btn::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    z-index: -1;
    border-radius: 15px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
    background-size: 200% auto;
    animation: pingPongLight 1.5s linear infinite alternate;
    opacity: 0.6;
}

@keyframes pingPongLight {
    0% { background-position: 0% center; }
    100% { background-position: 100% center; }
}

/* Custom Tooltip Validation */
.custom-error-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 20px);
    line-height: 1.4;
}
[data-theme="dark"] .custom-error-tooltip {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
}
.custom-error-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 1px solid rgba(239, 68, 68, 0.3);
    transform: rotate(45deg);
}
[data-theme="dark"] .custom-error-tooltip::before {
    background: rgba(239, 68, 68, 0.15);
}
.custom-error-tooltip.show { opacity: 1; transform: translateY(0); }
.input-group.has-error { box-shadow: 0 0 0 1px #ef4444; }
.input-group.has-error .input-icon { color: #ef4444; }

/* Alerts Ext */
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 24px; font-size: 0.9rem; display: flex; align-items: center; gap: 12px; font-weight: 500; animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; position: relative; overflow: hidden; transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease; }
.alert-error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert.fade-out { opacity: 0; max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }

.forgot-btn { font-size: 0.8rem; color: var(--text-muted); background: transparent; border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 10px; text-decoration: none; font-weight: 500; transition: all 0.3s; display: inline-flex; align-items: center; }
.forgot-btn:hover { background: var(--border-color); color: var(--text-color); }
.forgot-btn.highlight { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 15px -3px rgba(239, 68, 68, 0.3); animation: pulse-red 2s infinite ease-in-out alternate; }
[data-theme="dark"] .forgot-btn.highlight { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.15); }
@keyframes pulse-red { 0% { transform: scale(1); box-shadow: 0 4px 15px -3px rgba(239, 68, 68, 0.3); } 100% { transform: scale(1.05); box-shadow: 0 8px 20px -3px rgba(239, 68, 68, 0.5); } }

.toggle-password { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); transition: color 0.2s; z-index: 2;}
.toggle-password:hover { color: var(--primary); }

/* Dashboard Scalable Grid Support */
.dashboard-grid { display: flex !important; gap: 15px !important; flex-wrap: nowrap !important; overflow: visible !important; padding: 20px 0; }
.dashboard-stat { flex: 1; min-width: 200px; margin-bottom: 0 !important; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important; position: relative; }
.dashboard-stat:hover { transform: scale(1.03) !important; z-index: 50; box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important; }
@media (max-width: 1200px) { .dashboard-stat h3 { font-size: 0.9rem; } .dashboard-stat p { font-size: 1.8rem !important; } .btn-action { padding: 8px 12px !important; font-size: 0.75rem !important; } }

/* Shared Tab Styles (From Subjects) */
.tab-nav { display: inline-flex; background: var(--bg-soft); padding: 6px; border-radius: 14px; border: 1px solid var(--border-color); margin-bottom: 25px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.02); }
.tab-btn { background: transparent; border: none; padding: 12px 24px; cursor: pointer; color: var(--text-muted); font-weight: 600; font-family: 'Outfit', sans-serif; font-size: 0.95rem; border-radius: 10px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: flex; align-items: center; gap: 8px; }
.tab-btn:hover { color: var(--text-color); }
.tab-btn.active { color: var(--primary) !important; background: var(--bg-color); box-shadow: 0 4px 12px rgba(0,0,0,0.08); font-weight: 700; border: 1px solid var(--border-color); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.subject-card { background: var(--card-bg); border-radius: 12px; padding: 20px; border: 1px solid var(--border-color); position: relative; transition: all 0.3s; }
.subject-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.subject-type-badge { position: absolute; top: 15px; right: 15px; font-size: 0.65rem; padding: 4px 10px; border-radius: 20px; font-weight: 700; text-transform: uppercase; }
.subject-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.chip-container { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--sidebar-hover); border-radius: 8px; border: 1px solid var(--border-color); }
.multi-select-box { max-height: 200px; overflow-y: auto; background: var(--bg-color); padding: 12px; border-radius: 14px; border: 1px solid var(--border-color); box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }
.multi-select-item { display: flex; align-items: center; gap: 12px; padding: 10px 15px; cursor: pointer; font-size: 0.95rem; border-radius: 10px; transition: all 0.2s ease; border: 1px solid transparent; margin-bottom: 6px; background: var(--bg-soft); }
.multi-select-item:hover { background: var(--sidebar-hover); border-color: var(--border-color); transform: translateX(4px); }
.multi-select-item:has(input:checked) { background: rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.3); color: var(--primary); font-weight: 600; }
.multi-select-item input[type="checkbox"] { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--border-color); accent-color: var(--primary); cursor: pointer; margin: 0; }

/* =========================================
   AJAX LOADING & SPINNER ANIMATIONS
   ========================================= */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Page transition blur effect */
.page-transitioning {
    opacity: 0.7 !important;
    filter: blur(2px) !important;
    transition: opacity 0.2s ease, filter 0.2s ease !important;
    pointer-events: none !important;
}

/* Content area smooth fade in after load */
.main-content, #app-content {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Button disabled state during form submission */
button:disabled, input[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Skeleton breathing animation */
@keyframes skeleton-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.skeleton-breathe {
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-color) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton-breathe 1.5s ease-in-out infinite;
    border-radius: 8px;
}