/* ==========================================================================
   Chessturf Management System — Design System
   Refined Soft-Grey High-Contrast Light Theme
   Comfortable, soft-grey background with distinct panels, crisp contrast,
   and emerald brand accents.
   ========================================================================== */

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

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* A. Global Colour Palette — Refined Soft-Grey */
    --bg-main: #E8EDF2;
    --bg-surface: #F3F5F7;
    --bg-surface-elevated: #F8FAFC;
    --bg-surface-hover: #E2E8F0;
    --bg-card: #F3F5F7;
    --bg-hover: #E2E8F0;
    --bg-table-header: #DEE5EC;
    --bg-table-body: #F1F4F7;
    --bg-secondary: #DEE5EC;
    --bg-secondary-section: #DEE5EC;
    --bg-input: #F8FAFC;

    --border-color: #CBD5E1;
    --border-color-dark: #94A3B8;
    --border-color-focus: #10b981;
    --sidebar-border: #94A3B8;

    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #4B5563;
    --text-inverted: #ffffff;
    --text-input: #111827;

    /* Brand Accents — Preserved Chessturf Identity */
    --accent-emerald: #059669;
    --accent-emerald-light: #047857;
    --accent-emerald-glow: rgba(5, 150, 105, 0.18);

    --accent-gold: #d97706;
    --accent-gold-glow: rgba(217, 119, 6, 0.18);

    --accent-purple: #7c3aed;
    --accent-blue: #2563eb;
    --accent-rose: #e11d48;
    --accent-cyan: #0891b2;
    --accent-amber: #d97706;
    --accent-red: #dc2626;
    --accent-green: #059669;

    /* Subtle Shadows for High Contrast Depth */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px var(--accent-emerald-glow);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --header-height: 70px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

p {
    color: var(--text-secondary);
}

small, .text-muted {
    color: var(--text-muted);
}

a {
    color: var(--accent-emerald);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-emerald-light);
}

/* App Shell Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Sidebar Backdrop (Mobile/Tablet) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

/* Sidebar Toggle Button (Header - Hidden on Desktop) */
#sidebarToggle,
.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    flex-shrink: 0;
}

#sidebarToggle:hover,
.sidebar-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-emerald);
    border-color: var(--border-hover);
}

#sidebarToggle:focus-visible,
.sidebar-toggle-btn:focus-visible {
    outline: 2px solid var(--accent-emerald);
    outline-offset: 2px;
}

/* Sidebar Close Button (Sidebar Header - Hidden on Desktop) */
#sidebarClose,
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    margin-left: 8px;
    background: var(--bg-surface-elevated, #f1f5f9);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #1e293b);
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
    position: relative;
    z-index: 1010;
}

#sidebarClose:hover,
.sidebar-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: scale(1.05);
}

#sidebarClose:focus-visible,
.sidebar-close-btn:focus-visible {
    outline: 2px solid var(--accent-emerald);
    outline-offset: 2px;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.04);
}

.sidebar-brand {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.sidebar-logo {
    max-height: 70px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform var(--transition-fast);
}

.sidebar-brand-link:hover .sidebar-logo {
    transform: scale(1.03);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-emerald), #047857);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px var(--accent-emerald-glow);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #111827 40%, var(--accent-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
    list-style: none;
}

.menu-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
}

.menu-link i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
    transition: var(--transition);
    color: var(--text-muted);
}

.menu-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: translateX(3px);
}

.menu-link:hover i {
    color: var(--accent-emerald);
}

.menu-link.active {
    color: #065f46;
    background: #d1fae5;
    border-left: 3px solid var(--accent-emerald);
    font-weight: 600;
}

.menu-link.active i {
    color: var(--accent-emerald);
}

/* Main Area */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-main);
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #4f46e5, #0891b2);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

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

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.role-pill {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 2px;
}

/* Role badge colors */
.role-superadmin {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.role-admin {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.role-teacher {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.role-parent {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.role-student {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 32px;
    background-color: var(--bg-main);
}

/* Flash Messages */
.flash-container {
    margin-bottom: 24px;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    border: 1px solid transparent;
    animation: slideDown 0.3s ease-out;
}

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

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

/* Cards & Panels */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 28px;
    transition: var(--transition);
    min-width: 0;
    max-width: 100%;
}

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

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    min-width: 0;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-body {
    padding: 24px;
    background: var(--bg-card);
    min-width: 0;
    max-width: 100%;
}

/* Metric Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
    width: 100%;
}

.stats-grid > * {
    min-width: 0;
}

/* Dashboard Multi-Column Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
    gap: 24px;
    width: 100%;
    max-width: 100%;
}

.dashboard-grid > * {
    min-width: 0; /* Crucial for CSS Grid: allows child containers with overflow-x: auto to establish their own scroll boundaries */
}

.stat-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--stat-color, var(--accent-emerald));
}

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

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 6px;
    line-height: 1;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--stat-color, var(--accent-emerald));
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--accent-emerald);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
    background: var(--accent-emerald-light);
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-rose);
    color: #ffffff;
}

.btn-danger:hover {
    background: #be123c;
    color: #ffffff;
}

.btn-success {
    background: var(--accent-emerald);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--accent-emerald-light);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-input);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
    background: var(--bg-input);
}

.form-control::placeholder {
    color: #64748B;
}

select.form-control {
    cursor: pointer;
    background-color: var(--bg-input);
    color: var(--text-input);
    border: 1px solid var(--border-color);
}

select.form-control option {
    background-color: var(--bg-input);
    color: var(--text-input);
}

textarea.form-control {
    background-color: var(--bg-input);
    color: var(--text-input);
    border: 1px solid var(--border-color);
    resize: vertical;
}

.form-control.is-invalid {
    border-color: var(--accent-red, #dc2626) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

.field-error {
    color: var(--accent-red, #dc2626);
    font-size: 0.84rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    position: relative;
    scrollbar-width: thin;
}

.table {
    width: 100%;
    min-width: 580px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.92rem;
    background: var(--bg-table-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table th {
    background: var(--bg-table-header);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

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

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

/* Session Cards & Responsive Presentation */
.desktop-sessions-table {
    display: block;
}

.mobile-session-cards {
    display: none;
}

.session-card-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.session-card-header .status-pill {
    flex-shrink: 0;
}

.session-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.session-card-class {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.session-card-session-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    word-break: break-word;
}

.session-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

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

.session-meta-icon {
    color: var(--accent-emerald);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.82rem;
}

.session-meta-val {
    word-break: break-word;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active, .status-present, .status-completed, .status-paid, .status-reviewed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-absent, .status-unpaid, .status-overdue, .status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-late, .status-rescheduled {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-excused, .status-inactive, .status-void, .status-pending {
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.status-scheduled, .status-submitted {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.status-under_review {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Secondary Sections / Wells / Inset Panels */
.secondary-section, .well, .inset-panel {
    background: var(--bg-secondary-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 24px;
}

/* Auth Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo-img {
    height: 110px;
    max-height: 120px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    transition: transform var(--transition-fast);
}

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

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-emerald), #047857);
    color: #ffffff;
    border-radius: var(--radius-lg);
    font-size: 2rem;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px var(--accent-emerald-glow);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Permission Matrix */
.perm-matrix-table td {
    vertical-align: middle;
}

.perm-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-emerald);
    cursor: pointer;
}

/* Code Snippet / JSON display */
.json-dump {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #0369a1;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Pagination Controls */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 14px;
    background: var(--bg-card);
}

.pagination-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition);
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color-dark);
}

.pagination-btn.active {
    background: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-emerald);
    box-shadow: 0 2px 8px var(--accent-emerald-glow);
    font-weight: 600;
    cursor: default;
}

.pagination-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Modals & Dialogs */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

/* Dropdown Menus */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #sidebarToggle,
    .sidebar-toggle-btn {
        display: inline-flex !important;
    }

    #sidebarClose,
    .sidebar-close-btn {
        display: inline-flex !important;
    }

    .sidebar-backdrop {
        cursor: pointer;
    }

    .sidebar-backdrop.active {
        display: block !important;
        opacity: 1;
    }

    .app-sidebar {
        width: 280px;
        max-width: 85vw;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
        visibility: hidden;
    }

    .app-sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        position: relative;
        gap: 12px;
    }

    .sidebar-brand-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        max-width: calc(100% - 54px);
        width: auto;
    }

    .app-main {
        margin-left: 0;
        min-width: 0;
        width: 100%;
    }

    .app-header {
        padding: 0 20px;
    }

    .app-content {
        padding: 20px;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 767px) {
    .desktop-sessions-table {
        display: none !important;
    }

    .mobile-session-cards {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .app-content {
        padding: 16px 14px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
    }
    .auth-logo-img {
        height: 90px;
        max-height: 95px;
    }
}
