/**
 * School Bell Management System - Modern Design System (v2.0)
 * Modern, responsive, accessible, and fast stylesheet
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

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

:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.22);

    --secondary: #64748b;
    --secondary-hover: #475569;
    --secondary-light: #f1f5f9;

    --success: #10b981;
    --success-hover: #059669;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;
    --success-glow: rgba(16, 185, 129, 0.25);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;

    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;

    --info: #0284c7;
    --info-hover: #0369a1;
    --info-light: #f0f9ff;
    --info-border: #bae6fd;

    --purple: #8b5cf6;
    --purple-hover: #7c3aed;
    --purple-light: #f5f3ff;
    --purple-border: #ddd6fe;

    /* Neutrals */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-surface-hover: #e2e8f0;

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #818cf8;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.18);

    /* Typography */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

    /* Compatibility variables (preserve backward compatibility) */
    --primary-color: var(--primary);
    --primary-dark: var(--primary-hover);
    --success-color: var(--success);
    --danger-color: var(--danger);
    --warning-color: var(--warning);
    --info-color: var(--info);
    --secondary-color: var(--secondary);
    --bg-color: var(--bg-body);
    --card-bg: var(--bg-card);
    --text-color: var(--text-main);
    --border-color: var(--border);
    --shadow: var(--shadow-sm);
}

/* Base Body Styles */
body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    width: 100%;
}

/* Header Banner */
header {
    background: linear-gradient(135deg, #090d16 0%, #17153a 50%, #2e266e 100%);
    color: var(--text-white);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0) 70%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0) 70%);
    pointer-events: none;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 18px;
}

.school-logo {
    max-height: 64px;
    max-width: 160px;
    object-fit: contain;
    background: #ffffff;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-fast);
}

.school-logo:hover {
    transform: scale(1.02);
}

.header-title-wrapper {
    display: flex;
    flex-direction: column;
}

.system-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    width: fit-content;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
}

.system-badge .badge-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
}

header h1 {
    font-size: clamp(1.25rem, 2.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.92rem;
    color: #94a3b8;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Audio Status Pill */
#playerStatus {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff !important;
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    user-select: none;
}

#playerStatus:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.18);
}

#playerIcon {
    font-size: 1rem;
    line-height: 1;
}

#playerText {
    color: inherit !important;
    letter-spacing: 0.01em;
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    backdrop-filter: blur(6px);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
}

.user-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logout-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logout-link:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Quick Stats Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

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

.stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.purple {
    background: var(--purple-light);
    color: var(--purple);
}

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

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

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-clock-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Filter and Actions Section */
.filter-section {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-section select {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font-main);
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.filter-section select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font-main);
    color: var(--text-main);
    background: var(--bg-surface);
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    pointer-events: none;
    font-size: 0.85rem;
}

.filter-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--text-white);
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 4px 12px var(--success-glow);
    transform: translateY(-1px);
}

.btn-purple {
    background: var(--purple);
    color: var(--text-white);
}

.btn-purple:hover {
    background: var(--purple-hover);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-white);
}

.btn-warning:hover {
    background: var(--warning-hover);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    border-color: var(--border);
    transform: translateY(-1px);
}

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

.btn-icon.btn-edit:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Today's Schedule Card */
.today-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.today-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.today-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

#currentUaeTime {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid #c7d2fe;
}

#currentUaeTime .time-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

#uaeTimeDisplay {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Today's Schedule Colorful Small Grid */
.today-schedule-grid,
.schedule-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.today-bell-tile {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 14px 11px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.today-bell-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.today-bell-tile.type-class-start {
    border-top: 4px solid #4f46e5;
    background: linear-gradient(180deg, #f5f7ff 0%, #ffffff 65%);
}
.today-bell-tile.type-break {
    border-top: 4px solid #f59e0b;
    background: linear-gradient(180deg, #fffdf5 0%, #ffffff 65%);
}
.today-bell-tile.type-lunch {
    border-top: 4px solid #0284c7;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 65%);
}
.today-bell-tile.type-class-end {
    border-top: 4px solid #f43f5e;
    background: linear-gradient(180deg, #fff5f6 0%, #ffffff 65%);
}
.today-bell-tile.type-assembly {
    border-top: 4px solid #10b981;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 65%);
}
.today-bell-tile.type-other {
    border-top: 4px solid #8b5cf6;
    background: linear-gradient(180deg, #f8f6ff 0%, #ffffff 65%);
}

.today-bell-tile.next {
    border-color: var(--success);
    border-top: 4px solid var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25), 0 8px 20px rgba(16, 185, 129, 0.2);
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 70%);
    animation: tilePulse 2.5s infinite alternate;
}

@keyframes tilePulse {
    from {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(16, 185, 129, 0.15);
    }
    to {
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 8px 24px rgba(16, 185, 129, 0.25);
    }
}

.today-bell-tile.past {
    opacity: 0.6;
    background: #f8fafc;
    border-top-color: #94a3b8;
}

.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.tile-type-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.tile-audio-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.tile-time {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 4px 0;
}

.tile-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
}

.tile-status-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tile-status-tag.next {
    color: var(--success);
}

.tile-status-tag.past {
    color: var(--text-light);
}

.tile-status-tag.upcoming {
    color: var(--primary);
}

/* Fallback for legacy schedule item */
.schedule-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    transition: all var(--transition-base);
    position: relative;
    gap: 16px;
}

.schedule-item:hover {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.schedule-item.next {
    background: #f0fdf4;
    border-color: var(--success-border);
    border-left-color: var(--success);
    box-shadow: 0 4px 14px var(--success-glow);
}

.schedule-item.past {
    opacity: 0.6;
    background: #f8fafc;
    border-left-color: var(--secondary);
}

.schedule-time {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 110px;
    letter-spacing: -0.02em;
}

.schedule-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-type {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.next-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.no-schedule {
    text-align: center;
    color: var(--text-muted);
    padding: 36px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
    font-size: 0.92rem;
    font-weight: 500;
    grid-column: 1 / -1;
}

/* All Configured Schedules Modern Grid */
.schedules-modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    padding: 20px;
}

.schedule-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.schedule-card.inactive {
    opacity: 0.7;
    background: #fbfbfc;
}

.schedule-card-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.schedule-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.schedule-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.card-time-display {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.card-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-auto-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--purple-light);
    color: var(--purple);
    border: 1px solid var(--purple-border);
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 1.4em;
    line-height: 1.4;
}

.card-audio-container {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
}

.card-audio-player {
    width: 100%;
    height: 32px;
    border-radius: var(--radius-full);
}

.card-no-audio {
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-main);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-card-action:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-card-action.edit:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

.btn-card-action.toggle:hover {
    background: var(--warning-light);
    color: var(--warning-hover);
    border-color: var(--warning-border);
}

.btn-card-action.delete {
    margin-left: auto;
    color: var(--danger);
    border-color: transparent;
}

.btn-card-action.delete:hover {
    background: var(--danger-light);
    color: var(--danger-hover);
    border-color: var(--danger-border);
}

/* View Switcher */
.view-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}

.view-btn:hover:not(.active) {
    color: var(--text-main);
}

/* Schedules Table Container */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header-info {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-scroll-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background: var(--bg-surface);
}

th {
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
    vertical-align: middle;
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: #f8fafc;
}

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

tbody tr.inactive {
    opacity: 0.65;
    background: #fbfbfc;
}

.loading,
.no-data {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c7d2fe;
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-hover);
    border: 1px solid var(--warning-border);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-hover);
    border: 1px solid var(--info-border);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-hover);
    border: 1px solid var(--danger-border);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-hover);
    border: 1px solid var(--success-border);
}

.badge-secondary {
    background: var(--secondary-light);
    color: var(--secondary-hover);
    border: 1px solid #cbd5e1;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status.active {
    background: var(--success-light);
    color: var(--success-hover);
    border: 1px solid var(--success-border);
}

.status.active::before {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status.inactive {
    background: var(--danger-light);
    color: var(--danger-hover);
    border: 1px solid var(--danger-border);
}

.status.inactive::before {
    background: var(--danger);
}

/* Audio Player in Table */
.table-audio {
    width: 220px;
    height: 34px;
    border-radius: var(--radius-full);
    outline: none;
}

table audio::-webkit-media-controls-panel {
    background-color: var(--bg-surface);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px var(--border);
    position: relative;
    animation: modalSpring 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 22px;
    letter-spacing: -0.01em;
}

/* Form Styling */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="time"],
.form-group select {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: var(--font-main);
    color: var(--text-main);
    background: #ffffff;
    transition: all var(--transition-fast);
    outline: none;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.input-group input,
.input-group input[type="text"],
.input-group input[type="password"] {
    padding-left: 50px !important;
    padding-right: 44px !important;
}

.form-group input[type="time"] {
    font-family: var(--font-mono);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Checkbox and Radios */
.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.checkbox-card input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* File Upload Drop Area */
.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-zone input[type="file"] {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Day Selection Chips */
.day-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.day-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.day-chip:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.day-chip input[type="checkbox"] {
    accent-color: var(--purple);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.chip-quick-select {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-chip-action {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-chip-action:hover {
    background: var(--purple-light);
    color: var(--purple);
    border-color: var(--purple-border);
}

/* Toast Notifications */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    opacity: 0;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.notification.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.notification.info {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 24px 0 12px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Mobile & Responsive Breakpoints */
@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group,
    .filter-buttons {
        width: 100%;
        margin-left: 0;
    }

    .filter-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 14px 12px 32px;
    }

    header {
        padding: 18px 16px;
        border-radius: var(--radius-md);
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .school-logo {
        max-height: 50px;
    }

    .header-right {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #playerStatus {
        justify-content: center;
    }

    .user-profile-badge {
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .today-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .today-schedule-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .today-bell-tile {
        padding: 10px 12px;
        min-height: 110px;
    }

    .tile-time {
        font-size: 1.15rem;
    }

    .schedules-modern-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .schedule-time {
        font-size: 1.15rem;
    }

    .next-badge {
        margin-left: 0;
    }

    .table-container {
        padding: 0;
    }

    /* Hide Description & Audio file on small screens */
    th:nth-child(4),
    td:nth-child(4),
    th:nth-child(5),
    td:nth-child(5) {
        display: none;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}