/* EVE-NG VPN Access Platform - Clean White SaaS UI */
:root {
    /* Light theme - clean SaaS inspired */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f5;

    --border-primary: #e2e8f0;
    --border-secondary: #edf2f7;

    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;

    --accent: #0070f3;
    --accent-hover: #0060df;
    --accent-light: rgba(0, 112, 243, 0.08);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --transition: all 0.15s ease;

    /* Aliases for shorthand references used in inline styles */
    --bg-main: #f8f9fa;
    --text: #1a202c;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Container - full width, minimal padding */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

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

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 4px;
    margin: 24px 0;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    overflow-x: auto;
}

.nav-tab {
    padding: 8px 14px;
    font-size: 0.82rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-secondary);
}

.card-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-value.success {
    color: var(--success);
}

.stat-card .stat-value.warning {
    color: var(--warning);
}

.stat-card .stat-value.danger {
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

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

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

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

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

.btn-danger:hover {
    background: #d32f2f;
}

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

.btn-success:hover {
    background: #00a043;
}

.btn-warning {
    background: var(--warning);
    color: #000;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #e68900;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder {
    color: var(--text-muted);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 0.82rem;
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
}

.badge-scheduled {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-expired {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.badge-revoked {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-noshow {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-superadmin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-system_admin {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-hr_admin {
    background: var(--success-bg);
    color: var(--success);
}


.badge-user {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(255, 152, 0, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.125rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Landing Page — Split Layout */
.landing-page {
    display: flex;
    min-height: 100vh;
}

.hero-banner {
    flex: 1.4;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
}

/* Login Page */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .landing-page {
        flex-direction: column;
    }
    .hero-banner {
        padding: 40px 24px;
        min-height: auto;
    }
    .login-container {
        min-height: auto;
        padding: 24px;
    }
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo h1 {
    font-size: 1.5rem;
    margin-top: 16px;
}

.login-card .logo-icon-large {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Countdown Timer */
.countdown-container {
    text-align: center;
    padding: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.countdown-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.countdown-timer {
    font-size: 4rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.countdown-timer.active {
    color: var(--success);
}

.countdown-timer.warning {
    color: var(--warning);
}

.countdown-timer.danger {
    color: var(--danger);
}

.countdown-status {
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Session Card */
/* Session cards — compact single-line rows like a spreadsheet */
.session-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 0.82rem;
}

.session-card:last-child { border-bottom: none; }

.session-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 140px;
}

.session-card-info {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.session-card-info .info-row {
    display: flex;
    gap: 4px;
    font-size: 0.8rem;
}

.session-card-info .info-label {
    color: var(--text-muted);
}

.session-card-info .info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Connection Instructions */
.instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 24px;
}

.instructions h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.instructions ol {
    padding-left: 24px;
    color: var(--text-secondary);
}

.instructions li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.instructions code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--accent);
}

/* Code Block */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    color: var(--text-secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}

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

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

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

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

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

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 14px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
}

/* Health indicator */
.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Quota Indicator */
.quota-indicator {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quota-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.quota-value {
    font-weight: 600;
    font-size: 1rem;
}

.quota-value.unlimited {
    color: var(--success);
}

.quota-value.warning {
    color: var(--warning);
}

.quota-value.exhausted {
    color: var(--danger);
}

/* Booking Form */
.booking-form {
    padding: 16px 0;
}

/* Approval Items */
.approval-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approval-item:last-child {
    margin-bottom: 0;
}

.approval-info {
    flex: 1;
}

.approval-info .email {
    font-weight: 500;
    color: var(--text-primary);
}

.approval-info .details {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.approval-actions {
    display: flex;
    gap: 8px;
}

/* Booking Request Items — compact single-line rows */
.booking-request-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 0.82rem;
}

.booking-request-item:last-child {
    border-bottom: none;
}

.booking-request-header {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.booking-request-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge variations */
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--accent-light);
    color: var(--accent);
}

/* Action button group for tables */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Textarea styling */
textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px;
    font-family: inherit;
    font-size: 0.875rem;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========== Responsive Utility Classes ========== */
/* Two-col grid that stacks on mobile — use instead of inline style="grid-template-columns:1fr 1fr" */
.mobile-stack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.mobile-stack-flex {
    display: flex;
    gap: 10px;
}

/* ========== Responsive: Tablet (768px) ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .student-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        margin: 16px 0;
    }

    .nav-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .countdown-timer {
        font-size: 2.5rem;
    }

    .countdown-container {
        padding: 20px;
    }

    .approval-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .approval-actions {
        width: 100%;
    }

    .approval-actions .btn {
        flex: 1;
    }

    /* Session cards: wrap info below header on tablets */
    .session-card {
        flex-wrap: wrap;
    }

    .session-card-header {
        min-width: auto;
    }

    /* Connection hub: reduce padding */
    .connection-hub {
        padding: 16px;
        position: static; /* Don't stick on mobile — takes too much space */
    }

    .connection-hub-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* Wizard steps: compact */
    .wizard-steps {
        gap: 0 !important;
        margin: 12px 0 24px !important;
    }

    .step-label {
        font-size: 0.6rem;
    }

    /* Availability items: stack info */
    .avail-info {
        flex-direction: column !important;
        gap: 4px !important;
    }

    .avail-date {
        min-width: auto !important;
    }

    /* Daily summary: wrap */
    .daily-summary-card {
        padding: 12px 16px;
        gap: 12px;
    }

    /* Mobile stack grid utility */
    .mobile-stack-grid {
        grid-template-columns: 1fr !important;
    }
    .mobile-stack-flex {
        flex-direction: column;
    }
}

/* ========== Responsive: Phone (480px) ========== */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }

    /* Header compact */
    header {
        padding: 6px 0;
    }

    header h1 {
        font-size: 1rem;
    }

    header .user-info {
        gap: 8px;
        font-size: 0.8rem;
    }

    /* Nav tabs: even more compact */
    .nav-tabs {
        margin: 10px 0;
        padding: 3px;
    }

    .nav-tab {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    /* Cards: tighter on phone */
    .card {
        padding: 10px;
        border-radius: var(--radius-md);
    }

    /* Stats: single column on tiny screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .student-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .stat-card {
        padding: 8px;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .student-stat-card .stat-value {
        font-size: 1rem;
    }

    .student-stat-card {
        padding: 6px 8px;
    }

    /* Countdown: smaller on phones */
    .countdown-timer {
        font-size: 2rem;
    }

    .countdown-container {
        padding: 16px;
        margin-bottom: 16px;
    }

    .countdown-ring-text {
        font-size: 1.3rem;
    }

    /* Session cards: stack vertically */
    .session-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px;
    }

    .session-card-header {
        min-width: auto;
        width: 100%;
    }

    .session-card-info {
        gap: 6px;
    }

    /* Booking request items: stack */
    .booking-request-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Connection hub: single column */
    .connection-hub {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .connection-hub-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .connection-hub-item {
        padding: 8px 12px;
    }

    /* Wizard: vertical on small phones */
    .wizard-steps {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        margin: 10px 0 20px !important;
    }

    .wizard-step::after {
        display: none;
    }

    .wizard-step {
        flex-direction: row !important;
        gap: 10px;
        width: 100%;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .step-label {
        margin-top: 0;
        font-size: 0.7rem;
    }

    /* Tables: smaller text on phones */
    th, td {
        padding: 5px 6px;
        font-size: 0.75rem;
    }

    th {
        font-size: 0.65rem;
    }

    /* Modals: full-width on phones */
    .modal-content {
        width: 95%;
        padding: 16px;
        max-height: 90vh;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    /* Buttons: taller touch targets on phone */
    .btn {
        min-height: 40px;
        padding: 10px 14px;
    }

    .btn-sm {
        min-height: 34px;
        padding: 7px 10px;
    }

    /* Forms: taller inputs for touch */
    input, select, textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Toast: full width on phones */
    .toast-notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    /* Empty state: less padding */
    .empty-state {
        padding: 24px 16px;
    }

    /* Approval items: compact */
    .approval-item {
        padding: 10px;
    }

    /* Daily summary: smaller values */
    .daily-summary-item .summary-value {
        font-size: 1.1rem;
    }

    /* Heatmap: hide on very small screens (unreadable) */
    .heatmap-grid {
        overflow-x: auto;
    }

    /* Avail items: tighter */
    .avail-item {
        padding: 10px 12px !important;
    }

    /* Inline 1fr 1fr grids in JS — force stack (covers inline styles) */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Profile form grid — reduce min column width */
    [style*="minmax(280px"] {
        grid-template-columns: 1fr !important;
    }

    /* AI chat: full width */
    .ai-chat-window {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 76px;
        max-height: 70vh;
    }

    .ai-chat-bubble {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
        font-size: 1.2rem;
    }

    .ai-chat-messages {
        min-height: 200px;
        max-height: 50vh;
    }

    /* Quota indicator: stack on phone */
    .quota-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    /* Login card: tighter */
    .login-card {
        padding: 24px 20px;
    }

    /* Code block: smaller */
    .code-block {
        padding: 10px;
        font-size: 0.7rem;
    }
}

/* Wizard / Bulk Scheduling Styles - Premium Overhaul */
.wizard-steps {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 20px 0 40px !important;
    flex-direction: row !important;
}

.wizard-step {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    position: relative !important;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-primary);
    z-index: 1;
}

.wizard-step:last-child::after {
    display: none;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.wizard-step.active .step-number {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-light);
}

.step-label {
    margin-top: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wizard-step.active .step-label {
    color: var(--text-primary);
}


/* Scheduling Wizard - Approval Style UX Pattern */
.avail-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 10px !important;
    max-height: 380px !important;
    overflow-y: auto !important;
}

.avail-item {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius-md) !important;
    padding: 15px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.avail-item:hover:not(.disabled) {
    border-color: var(--accent) !important;
    background: var(--bg-hover) !important;
    transform: translateX(4px) !important;
}

.avail-item.disabled {
    opacity: 0.4 !important;
    background: rgba(0, 0, 0, 0.1) !important;
    cursor: not-allowed !important;
}

.avail-info {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 30px !important;
}

.avail-date {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    min-width: 160px !important;
}

.avail-badge {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.avail-badge-success {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
}

.avail-badge-error {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

/* Premium Ultra-Smooth Toggle */
.premium-switch {
    width: 50px !important;
    height: 26px !important;
    background: #cbd5e0 !important;
    border-radius: 20px !important;
    padding: 4px !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.avail-item.selected .premium-switch {
    background: #2563eb !important;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.4) !important;
}

.switch-knob {
    width: 18px !important;
    height: 18px !important;
    background: #fff !important;
    border-radius: 50% !important;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.avail-item.selected .switch-knob {
    transform: translateX(24px) !important;
}

.avail-item.disabled .premium-switch {
    background: #e2e8f0 !important;
}

/* ========== Analytics Heatmap ========== */
.heatmap-grid { display: flex; flex-direction: column; gap: 2px; }
.heatmap-row { display: flex; gap: 2px; align-items: center; }
.heatmap-label { width: 36px; font-size: 0.7rem; color: var(--text-muted); text-align: right; padding-right: 4px; flex-shrink: 0; }
.heatmap-header { width: 28px; height: 20px; font-size: 0.65rem; color: var(--text-muted); text-align: center; line-height: 20px; }
.heatmap-cell { width: 28px; height: 28px; border-radius: 3px; font-size: 0.65rem; color: #fff; display: flex; align-items: center; justify-content: center; cursor: default; transition: transform 0.1s; }
.heatmap-cell:hover { transform: scale(1.3); z-index: 1; }

/* ========== Student Stats Cards ========== */
.student-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.student-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; text-align: center; }
.student-stat-card .stat-value { font-size: 1.2rem; font-weight: 700; margin: 2px 0; }
.student-stat-card .stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ========== D6: Color-coded session status ========== */
.session-status-completed, .session-status-active { border-left: 4px solid var(--success); }
.session-status-noshow { border-left: 4px solid var(--danger); }
.session-status-expired { border-left: 4px solid var(--warning); }
.session-status-scheduled { border-left: 4px solid var(--accent); }
.session-status-revoked { border-left: 4px solid var(--danger); }

/* ========== D7: Countdown progress ring ========== */
.countdown-ring-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.countdown-ring-svg {
    transform: rotate(-90deg);
}
.countdown-ring-bg {
    fill: none;
    stroke: var(--border-primary);
    stroke-width: 6;
}
.countdown-ring-fg {
    fill: none;
    stroke: var(--success);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}
.countdown-ring-fg.warning { stroke: var(--warning); }
.countdown-ring-fg.danger { stroke: var(--danger); }
.countdown-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--text-primary);
}

/* ========== D1: Connection Hub ========== */
.connection-hub {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 112, 243, 0.1);
}
.connection-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.connection-hub-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}
.connection-hub-item .hub-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.connection-hub-item .hub-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

/* ========== D9: Daily activity summary ========== */
.daily-summary-card {
    background: linear-gradient(135deg, rgba(0,112,243,0.08), rgba(16,185,129,0.08));
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.daily-summary-item {
    text-align: center;
    min-width: 80px;
}
.daily-summary-item .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.daily-summary-item .summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ========== D11: Student search filter ========== */
.user-search-box {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
}
.user-search-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========== D8: Quick rebook button ========== */
.btn-rebook {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}
.btn-rebook:hover {
    background: var(--accent);
    color: #fff;
}

/* ========== D2: Session starting toast ========== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 10001;
    animation: slideInRight 0.3s ease-out;
    max-width: 380px;
    font-size: 0.9rem;
    font-weight: 500;
}
.toast-notification .toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    cursor: pointer;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== A3: AI Chat ========== */
.ai-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 112, 243, 0.4);
    z-index: 9000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    font-size: 1.4rem;
}
.ai-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0, 112, 243, 0.6);
}
.ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}
.ai-chat-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}
.ai-chat-header .chat-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.ai-chat-header .chat-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: 360px;
}
.ai-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.ai-chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-chat-msg.assistant {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    border-bottom-left-radius: 4px;
}
.ai-chat-msg.assistant p { margin: 0 0 8px 0; }
.ai-chat-msg.assistant p:last-child { margin-bottom: 0; }
.ai-chat-msg.assistant code {
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--accent);
}
.ai-chat-msg.assistant pre {
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
}
.ai-chat-msg.assistant pre code {
    background: none;
    padding: 0;
}
.ai-chat-msg.assistant ul, .ai-chat-msg.assistant ol {
    padding-left: 18px;
    margin: 4px 0;
}
.ai-chat-msg.assistant strong { color: var(--text-primary); }
.ai-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}
.ai-chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.ai-chat-input-area input:focus {
    outline: none;
    border-color: var(--accent);
}
.ai-chat-input-area button {
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}
.ai-chat-input-area button:hover {
    background: var(--accent-hover);
}
.ai-chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Two-column responsive layouts for wide screens */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}
.two-col-grid .full-span { grid-column: 1 / -1; }
@media (max-width: 768px) {
    .two-col-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
    }
}

/* ---- Compact density pass (2026-05-14) ----
 * Shaves ~30% off paddings/margins/gaps on desktop so more rows + cards
 * fit per pane. Applies only ≥769px so the existing mobile rules at the
 * bottom of this file (which already tighten things) remain authoritative.
 * Only targets existing selectors — no DOM changes required.
 */
@media (min-width: 769px) {
    .container { padding: 0 12px; }
    header { padding: 6px 0; }

    .card { padding: 8px 10px; margin-bottom: 6px; }
    .card h2 { margin-bottom: 5px; padding-bottom: 4px; }
    .card-header { margin-bottom: 5px; padding-bottom: 4px; }

    .stats-grid { gap: 6px; margin-bottom: 6px; }
    .stat-card { padding: 7px 9px; }
    .stat-card .stat-label { margin-bottom: 2px; }

    th, td { padding: 4px 8px; }

    .nav-tabs { padding: 3px; }
    .nav-tabs button, .nav-tab { padding: 6px 10px; }

    .btn { padding: 7px 12px; }

    /* Tighten any inline-styled cards/grids in index.html that use rem units */
    section, .panel, .pane { margin-bottom: 8px; }
    form > div, .form-row { margin-bottom: 6px; }
}
