/**
 * Tinver Class - Dark Trading Dashboard Theme
 * Main Stylesheet
 */

/* ========================================
   CSS Variables / Theme
   ======================================== */
:root {
    /* Background Colors */
    --bg-primary: #050810;
    --bg-elevated: #0B1220;
    --bg-sidebar: #05060C;
    --bg-card: #0D1525;
    --bg-input: #111827;
    
    /* Accent Colors */
    --accent-green: #00FF85;
    --accent-green-hover: #22C55E;
    --accent-cyan: #00D4FF;
    --accent-orange: #F97316;
    --accent-red: #F97373;
    --accent-purple: #A855F7;
    
    /* Text Colors */
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Border Colors */
    --border-color: #1F2937;
    --border-light: #374151;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(0, 255, 133, 0.2);
    --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.2);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

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

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

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ========================================
   Layout - Main Structure
   ======================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-right: 70px; /* Sidebar width */
}

@media (max-width: 768px) {
    .main-content {
        margin-right: 0;
        margin-bottom: 70px; /* Bottom nav height */
    }
}

/* ========================================
   Header
   ======================================== */
.app-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--bg-primary);
}

.header-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.header-user:hover {
    background: var(--bg-input);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-cyan);
}

.header-user-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ========================================
   Sidebar Navigation
   ======================================== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 70px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width var(--transition-normal);
}

.sidebar:hover {
    width: 220px;
}

.sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--bg-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}
.sidebar-group { border-top: 1px solid var(--border-color); }
.sidebar-group-toggle { justify-content: space-between; }
.sidebar-group-caret { transition: transform var(--transition-fast); }
.sidebar-group.open .sidebar-group-caret { transform: rotate(180deg); }
.sidebar-subnav { display: none; flex-direction: column; padding: 0 0.5rem 0.35rem 0; }
.sidebar-group.open .sidebar-subnav { display: flex; }
.sidebar-subnav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 2.5rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    border-right: 2px solid transparent;
}
.sidebar-subnav-item:hover,
.sidebar-subnav-item.active {
    color: var(--accent-green);
    background: rgba(0, 255, 133, 0.08);
    border-right-color: var(--accent-green);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    gap: 1rem;
    white-space: nowrap;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    color: var(--accent-green);
    background: rgba(0, 255, 133, 0.1);
}

.sidebar-nav-item.active {
    border-right: 3px solid var(--accent-green);
}

.sidebar-nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav-text {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar:hover .sidebar-nav-text {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}
.mobile-menu-btn,
.mobile-drawer,
.mobile-drawer-backdrop { display: none; }
.desktop-only { display: block; }
.drawer-open { overflow: hidden; }

/* Mobile: header + drawer menu */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-right: 0; }
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }
    .header-brand.desktop-only { display: none !important; }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .mobile-menu-btn {
        display: inline-flex;
        width: 44px;
        height: 44px;
        border-radius: var(--radius-md);
        border: none;
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
        color: #fff;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        box-shadow: var(--shadow-md);
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-menu-btn:hover { transform: scale(1.02); }
    .mobile-menu-btn:active { transform: scale(0.98); }
    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 400;
    }
    .mobile-drawer-backdrop.show { opacity: 1; pointer-events: auto; }
    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(88%, 320px);
        max-width: 320px;
        background: var(--bg-elevated);
        border-left: 1px solid var(--border-color);
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.2s ease;
        z-index: 401;
        box-shadow: -8px 0 24px rgba(0,0,0,0.4);
    }
    .mobile-drawer.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
    .mobile-drawer-header {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-primary);
        flex-shrink: 0;
    }
    .mobile-drawer-header button {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-card);
        border: none;
        border-radius: var(--radius-md);
        color: var(--text-primary);
        font-size: 1.2rem;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-drawer-header button:hover { background: var(--bg-input); }
    .mobile-drawer-body {
        padding: 0.75rem 0.5rem 1.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-drawer-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        margin-bottom: 2px;
        border-radius: var(--radius-md);
        color: var(--text-primary);
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }
    .mobile-drawer-item i { width: 24px; text-align: center; font-size: 1.1rem; }
    .mobile-drawer-item:hover,
    .mobile-drawer-item.active { background: rgba(0,255,133,0.1); color: var(--accent-green); }
    .mobile-drawer-item-logout { color: var(--accent-red); }
    .mobile-drawer-item-logout:hover { background: rgba(249,115,115,0.12); color: var(--accent-red); }
    .mobile-drawer-group-title {
        font-weight: 700;
        color: var(--text-muted);
        margin: 1rem 1rem 0.35rem;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    .sidebar-nav-item {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.25rem;
        font-size: 0.75rem;
    }
    
    .sidebar-nav-item i {
        font-size: 1.25rem;
    }
    
    .sidebar-nav-text {
        opacity: 1;
        font-size: 0.625rem;
    }
    
    .sidebar-nav-item.active {
        border-right: none;
        border-bottom: 3px solid var(--accent-green);
    }
    .sidebar-footer { display: none; }
    .desktop-only { display: none; }
}

/* ========================================
   Page Content
   ======================================== */
.page-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--accent-cyan);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--accent-cyan);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

.stat-card-icon.green {
    background: rgba(0, 255, 133, 0.15);
    color: var(--accent-green);
}

.stat-card-icon.cyan {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

.stat-card-icon.orange {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.stat-card-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
}

.stat-card-info {
    flex: 1;
}

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

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-green-hover);
    box-shadow: var(--shadow-glow-green);
}

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

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

.btn-accent {
    background: var(--accent-orange);
    color: white;
}

.btn-accent:hover {
    background: #EA580C;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.1);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:hover {
    border-color: var(--border-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: var(--bg-elevated);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-card);
}

.form-control.is-invalid {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(249, 115, 115, 0.15);
}

.form-control.is-valid {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 133, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* ========================================
   Select Form Control - Custom Styling
   Override browser defaults completely
   ======================================== */
/* 1) فلش‌های خود select را کلاً خاموش کن (هرچی از هر CSS دیگه‌ای آمده) */
select.form-control {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    /* مهم: هر نوع آیکونی که با background روی select آمده را نابود می‌کنیم */
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-color: var(--bg-input) !important;

    padding-left: 2.75rem !important; /* جا برای فلش */
    padding-right: 1rem !important;

    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    width: 100% !important;
    min-height: 2.75rem !important;
    line-height: 1.5 !important;
    text-align: right !important;
    direction: rtl !important;
    box-shadow: none !important;
}

/* مخفی کردن فلش پیشفرض در IE/old Edge (برای کامل بودن) */
select.form-control::-ms-expand {
    display: none;
}

/* جلوگیری از حالت focus عجیب در فایرفاکس */
select.form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--text-primary);
}

/* استایل‌های hover و focus برای select.form-control */
select.form-control:hover {
    border-color: var(--border-light) !important;
}

select.form-control:focus {
    outline: none !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15) !important;
    background-color: var(--bg-elevated) !important;
    background-image: none !important;
}

select.form-control:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: var(--bg-card) !important;
    background-image: none !important;
}

select.form-control.is-invalid {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 115, 0.15) !important;
}

select.form-control.is-valid {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 133, 0.15) !important;
}

/* Force dark text on light background options if needed, or variable based */
select.form-control option {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    padding: 10px !important;
}

/* Option hover state */
select.form-control option:hover,
select.form-control option:focus,
select.form-control option:active,
select.form-control option:checked {
    background-color: var(--accent-cyan) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 10px 100px var(--accent-cyan) inset !important; /* Hack for Chrome */
}

/* For Firefox - option styling */
@-moz-document url-prefix() {
    select.form-control option {
        background-color: var(--bg-input) !important;
        color: var(--text-primary) !important;
    }
    
    select.form-control option:checked {
        background-color: var(--accent-cyan) !important;
        color: var(--bg-primary) !important;
    }
}

/* ========================================
   Select Wrap - استفاده از pseudo-element برای فلش (پایدارترین روش)
   ======================================== */
/* 2) فلش را فقط با pseudo-element رسم کن */
.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 2;

    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
                no-repeat center / contain;
}

input[type="checkbox"].form-control,
input[type="radio"].form-control {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-cyan);
}

input[type="file"].form-control {
    padding: 0.5rem;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    padding: 0.5rem 1rem;
    margin-left: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    font-size: 0.875rem;
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--bg-card);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

input[type="time"].form-control,
input[type="date"].form-control {
    cursor: pointer;
}

input[type="time"].form-control::-webkit-calendar-picker-indicator,
input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

input[type="time"].form-control:focus::-webkit-calendar-picker-indicator,
input[type="date"].form-control:focus::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(175deg);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-green);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ========================================
   Tables
   ======================================== */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(0, 255, 133, 0.15);
    color: var(--accent-green);
}

.badge-warning {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.badge-danger {
    background: rgba(249, 115, 115, 0.15);
    color: var(--accent-red);
}

.badge-info {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

.badge-secondary {
    background: var(--bg-input);
    color: var(--text-muted);
}

/* ========================================
   Form Elements - Select & Option (Global)
   Only for selects WITHOUT .form-control class
   ======================================== */
select:not(.form-control) {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 3rem;
}

select:not(.form-control):focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

select:not(.form-control):disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select[multiple]:not(.form-control) {
    background-image: none;
    padding-left: 1rem;
    min-height: 150px;
}

/* Option styling - Only for selects without .form-control */
select:not(.form-control) option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

select:not(.form-control) option:hover,
select:not(.form-control) option:focus,
select:not(.form-control) option:checked {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

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

/* Checkbox styling in multiple select */
select[multiple]:not(.form-control) option {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
}

select[multiple]:not(.form-control) option:checked {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    font-weight: 500;
}

/* ========================================
   Alerts (Global)
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    animation: slideInDown 0.3s ease;
}

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

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.alert-success {
    background: rgba(0, 255, 133, 0.1);
    border: 1px solid rgba(0, 255, 133, 0.3);
    color: var(--accent-green);
}

.alert-success i {
    color: var(--accent-green);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--accent-orange);
}

.alert-warning i {
    color: var(--accent-orange);
}

.alert-danger,
.alert-error {
    background: rgba(249, 115, 115, 0.1);
    border: 1px solid rgba(249, 115, 115, 0.3);
    color: var(--accent-red);
}

.alert-danger i,
.alert-error i {
    color: var(--accent-red);
}

.alert-info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--accent-cyan);
}

.alert-info i {
    color: var(--accent-cyan);
}

/* Alert with close button */
.alert-dismissible {
    position: relative;
    padding-left: 3rem;
}

.alert-dismissible .alert-close {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: opacity var(--transition-fast);
}

.alert-dismissible .alert-close:hover {
    opacity: 1;
}

/* ========================================
   Grid System
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col {
    flex: 1;
    padding: 0.75rem;
}

.col-12 { width: 100%; padding: 0.75rem; }
.col-6 { width: 50%; padding: 0.75rem; }
.col-4 { width: 33.333%; padding: 0.75rem; }
.col-3 { width: 25%; padding: 0.75rem; }

@media (max-width: 768px) {
    .col-md-12 { width: 100%; }
    .col-md-6 { width: 50%; }
}

@media (max-width: 576px) {
    .col-sm-12 { width: 100%; }
}

/* ========================================
   Session Cards
   ======================================== */
.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all var(--transition-fast);
}

.session-card:hover {
    border-color: var(--border-light);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.session-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.session-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.session-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.session-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.session-card-meta-item i {
    color: var(--accent-cyan);
}

.session-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Status indicators */
.status-active {
    color: var(--accent-green);
}

.status-upcoming {
    color: var(--accent-cyan);
}

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

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ========================================
   Auth Pages
   ======================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0A1628 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--bg-primary);
    margin: 0 auto 1rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.google-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    margin-bottom: 1rem;
}

.google-btn:hover {
    background: #f5f5f5;
    box-shadow: var(--shadow-md);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

/* ========================================
   Landing Page
   ======================================== */
.landing-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(ellipse at center, #0F172A 0%, var(--bg-primary) 70%);
}

.landing-hero-content {
    max-width: 700px;
}

.landing-hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.landing-hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-features {
    padding: 5rem 2rem;
    background: var(--bg-elevated);
}

.landing-section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
}

.feature-card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

.feature-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10001;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.show .modal-backdrop {
    opacity: 1;
}

.modal-dialog {
    position: relative;
    z-index: 10002;
    width: 90%;
    max-width: 500px;
    margin: 2rem auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform var(--transition-normal);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title i {
    font-size: 1.5rem;
}

.modal-title.success i {
    color: var(--accent-green);
}

.modal-title.error i,
.modal-title.danger i {
    color: var(--accent-red);
}

.modal-title.warning i {
    color: var(--accent-orange);
}

.modal-title.info i {
    color: var(--accent-cyan);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color var(--transition-fast);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

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

.modal-body {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: var(--bg-elevated);
}

.modal-footer .btn {
    min-width: 100px;
}

/* Alert Modal Specific Styles */
.alert-modal .modal-content {
    border: none;
}

.alert-modal.success .modal-content {
    border-top: 3px solid var(--accent-green);
}

.alert-modal.error .modal-content,
.alert-modal.danger .modal-content {
    border-top: 3px solid var(--accent-red);
}

.alert-modal.warning .modal-content {
    border-top: 3px solid var(--accent-orange);
}

.alert-modal.info .modal-content {
    border-top: 3px solid var(--accent-cyan);
}

/* Confirm Modal Specific Styles */
.confirm-modal .modal-content {
    border: none;
}

.confirm-modal .modal-body {
    text-align: center;
    padding: 2rem 1.5rem;
}

.confirm-modal .modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-orange);
}

.confirm-modal .modal-message {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.confirm-modal .modal-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        margin: 1rem auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Form Control Required Indicator */
.form-label.required::after {
    content: ' *';
    color: var(--accent-red);
    margin-right: 0.25rem;
}

/* Form Control Focus Ring Animation */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    }
}

.form-control:focus {
    animation: focusRing 0.3s ease;
}

/* Select Option styling is now handled above with stronger rules */

/* File Input Styling */
input[type="file"].form-control {
    padding: 0.5rem;
    cursor: pointer;
    border-style: dashed;
}

input[type="file"].form-control:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-elevated);
}

/* Checkbox and Radio Custom Styling */
input[type="checkbox"]:not(.form-control),
input[type="radio"]:not(.form-control) {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-cyan);
    margin-left: 0.5rem;
}

/* Range Input Styling */
input[type="range"].form-control {
    padding: 0;
    height: 6px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 3px;
    outline: none;
}

input[type="range"].form-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="range"].form-control::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-orange); }
.text-info { color: var(--accent-cyan); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.hidden { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .sidebar,
    .app-header,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ========================================
   Weekly Days Grid - Checkbox Styling
   ======================================== */
/* Grid */
.weekly-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
    .weekly-days-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .weekly-days-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Label as a "pill button" */
.day-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: var(--radius-md);

    /* رنگ‌ها با تم تیره هماهنگ شده */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition-fast);
}

/* Hide native checkbox (but keep it accessible) */
.day-checkbox input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Text */
.day-checkbox span {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

/* Checked state */
.day-checkbox input[type="checkbox"]:checked + span {
    color: var(--bg-primary);
}

.day-checkbox:has(input[type="checkbox"]:checked) {
    background: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25);
}

/* Hover / focus */
.day-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.day-checkbox input[type="checkbox"]:focus-visible + span {
    outline: none;
}

.day-checkbox:has(input[type="checkbox"]:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.35);
}

/* Disabled */
.day-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.day-checkbox:has(input[type="checkbox"]:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Student Selection Grid - Checkbox Styling
   ======================================== */
/* Grid */
.student-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

/* Responsive */
@media (max-width: 900px) {
    .student-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 520px) {
    .student-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* Student checkbox card as a "pill button" */
.student-checkbox-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 60px;
    padding: 12px 14px;
    border-radius: var(--radius-md);

    /* رنگ‌ها با تم تیره هماهنگ شده */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition-fast);
}

/* Hide native checkbox (but keep it accessible) */
.student-checkbox-card input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Content */
.student-checkbox-content {
    flex: 1;
    min-width: 0;
    pointer-events: none;
}

.student-checkbox-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.92);
}

.student-checkbox-email {
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checked state */
.student-checkbox-card:has(input[type="checkbox"]:checked) {
    background: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25);
}

.student-checkbox-card:has(input[type="checkbox"]:checked) .student-checkbox-name {
    color: var(--bg-primary);
}

.student-checkbox-card:has(input[type="checkbox"]:checked) .student-checkbox-email {
    color: rgba(11, 16, 32, 0.8);
}

/* Hover / focus */
.student-checkbox-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.student-checkbox-card input[type="checkbox"]:focus-visible {
    outline: none;
}

.student-checkbox-card:has(input[type="checkbox"]:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.35);
}

/* Disabled */
.student-checkbox-card input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.student-checkbox-card:has(input[type="checkbox"]:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   PWA Install Banner
   ======================================== */
.pwa-install {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pwa-install[hidden] {
    display: none !important;
}

.pwa-install-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-install-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pwa-install-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.pwa-install-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pwa-install-ios {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
}

.pwa-install-ios-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.pwa-install-steps {
    padding-inline-start: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pwa-install-steps li {
    margin-bottom: 0.4rem;
}

.pwa-install-ios-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .pwa-install {
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    .pwa-install-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: stretch;
    }

    .pwa-install-actions .btn {
        flex: 1;
    }
}

/* ========================================
   PWA Update Banner
   ======================================== */
.pwa-update {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 11000;
}

.pwa-update[hidden] {
    display: none !important;
}

.pwa-update-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
}

.pwa-update-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.pwa-update-text {
    flex: 1;
    min-width: 0;
}

.pwa-update-title {
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-update-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pwa-update-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .pwa-update {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    .pwa-update-card {
        flex-direction: column;
        align-items: stretch;
    }

    .pwa-update-actions {
        width: 100%;
        justify-content: stretch;
    }

    .pwa-update-actions .btn {
        flex: 1;
    }
}
