/* ==========================================================================
   DESIGN SYSTEM v3.5 - TRUNG TÂM ĐÀO TẠO & SÁT HẠCH LÁI XE HOÀNG THÀNH
   Modern Crisp Light Theme, Sidebar Navigation & Weekly Schedule Planner
   ========================================================================== */

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

:root {
    /* Color Tokens (Crisp Modern Light Palette) */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-card: #ffffff;
    --border-subtle: #e2e8f0;
    --border-focus: #3b82f6;

    /* Accents */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --secondary: #0284c7;
    --secondary-hover: #0369a1;
    --secondary-light: #f0f9ff;

    --gold: #d97706;
    --gold-light: #fffbeb;
    --gold-glow: rgba(217, 119, 6, 0.15);
    --gold-gradient: linear-gradient(135deg, #f59e0b, #d97706);

    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --danger: #e11d48;
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    /* Typography & Spacing */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 6px 12px -2px rgba(0, 0, 0, 0.03);
    --shadow-elevated: 0 12px 28px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   SVG ICON HELPER
   ========================================================================== */
.svg-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   AUTH / LOGIN SCREEN
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    position: relative;
    z-index: 10;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 520px;
    padding: 2.5rem 2.25rem;
    position: relative;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.role-tab-selector {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.role-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.role-tab-btn:hover {
    color: var(--text-main);
}

.role-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.quick-demo-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.quick-demo-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quick-pills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.quick-pill {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-align: left;
}

.quick-pill:hover {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.quick-pill strong {
    color: var(--text-main);
    font-size: 0.82rem;
    margin-bottom: 0.15rem;
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-text h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    border-radius: var(--radius-full);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-meta .name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.user-meta .role-tag {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    background: #fee2e2;
}

/* ==========================================================================
   MAIN APPLICATION LAYOUT
   ========================================================================== */
.main-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1.25rem 1.5rem;
    box-sizing: border-box;
}

.portal-view {
    display: none;
}

.portal-view.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ADMIN LAYOUT WITH LEFT SIDEBAR
   ========================================================================== */
.admin-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    width: 100%;
}

.admin-main-content {
    flex: 1;
    min-width: 0;
    width: 0;
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 0.5rem 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.6rem;
}

.admin-sidebar-header .role-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-sidebar-header .title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0.2rem;
}

.admin-nav-section {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.85rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px dashed var(--border-subtle);
}

.admin-nav-section:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0.15rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.admin-nav-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.admin-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.admin-nav-item .icon {
    font-size: 1.15rem;
    width: 24px;
    display: inline-flex;
    justify-content: center;
}

.admin-main-content {
    flex: 1;
    min-width: 0;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* ==========================================================================
   METRICS GRID
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.metric-box {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.metric-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.metric-box:has(.metric-icon-wrap) {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
}

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

.metric-icon-indigo { background: #eff6ff; color: #2563eb; }
.metric-icon-cyan { background: #f0f9ff; color: #0284c7; }
.metric-icon-gold { background: #fffbeb; color: #d97706; }
.metric-icon-emerald { background: #ecfdf5; color: #059669; }

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    word-break: break-word;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.35;
}

.metric-sub {
    font-size: 0.76rem;
    color: var(--text-dim);
    line-height: 1.35;
    margin-top: 0.15rem;
}

/* ==========================================================================
   CARDS & CONTAINERS (CLEAN LIGHT DESIGN)
   ========================================================================== */
.glass-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.1rem;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ==========================================================================
   SUB NAVIGATION TABS (STUDENT)
   ========================================================================== */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.nav-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin-bottom: -2px;
}

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

.nav-tab-btn.active {
    color: var(--primary);
    font-weight: 700;
    border-bottom-color: var(--primary);
}

.student-tab-content {
    display: none;
}

.student-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* ==========================================================================
   WEEKLY SCHEDULE BOARD (STUDENT SCHEDULING REDESIGN)
   ========================================================================== */
.week-planner-container {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.week-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
}

.week-nav-info {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.week-nav-btns {
    display: flex;
    gap: 0.4rem;
}

.week-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.week-day-pill {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.week-day-pill:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
}

.week-day-pill.active {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.week-day-pill .day-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.week-day-pill.active .day-lbl {
    color: var(--primary);
}

.week-day-pill .day-date-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0.2rem;
}

.week-day-pill.today::after {
    content: 'Hôm nay';
    display: block;
    font-size: 0.65rem;
    color: var(--success);
    font-weight: 800;
    margin-top: 0.25rem;
}

/* Slots Grid in Weekly Planner */
.slot-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.slot-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.slot-card:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.slot-card.selected {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.slot-card .s-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}

.slot-card.selected .s-name {
    color: var(--primary);
}

.slot-card .s-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Teachers Grid */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.selectable-item {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.selectable-item:hover:not(.disabled) {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
}

.selectable-item.selected {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.selectable-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Notice Box */
.info-callout {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ==========================================================================
   DIGITAL STUDENT ID CARD
   ========================================================================= */
.digital-id-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: white;
    box-shadow: 0 15px 30px -5px rgba(30, 58, 138, 0.35);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.digital-id-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}

.id-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.id-chip {
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border-radius: 5px;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
}

.id-card-body {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.id-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.id-info h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.id-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
}

.id-detail-item .lbl {
    color: #cbd5e1;
}

.id-detail-item .val {
    font-weight: 700;
    color: white;
}

/* Rolling Milestones Grid */
.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.milestone-crit-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.milestone-crit-card.passed {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.milestone-crit-card.pending {
    border-color: #fed7aa;
    background: #fffaf5;
}

.crit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.crit-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.crit-val {
    font-size: 1.25rem;
    font-weight: 800;
}

/* ==========================================================================
   TABLES & PAGINATION (CLEAN LIGHT DESIGN)
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

.data-table thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-subtle);
}

.data-table th {
    padding: 0.6rem 0.75rem;
    font-weight: 700;
    color: #475569;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    font-size: 0.84rem;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Pagination Bar */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: #fafafa;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-controls {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8fafc;
}

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

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

/* Search and Filter Row */
.table-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.search-input-wrap {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 2rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: #ffffff;
}

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

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px var(--primary-glow);
}

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

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

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

.btn-success:hover:not(:disabled) {
    background: #047857;
}

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

.btn-warning:hover:not(:disabled) {
    background: #b45309;
}

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

.btn-danger:hover:not(:disabled) {
    background: #be123c;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.3;
}

.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-info { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.badge-delayed { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-gold { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.badge-standard { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   MODALS - PIXEL PERFECT PROFESSIONAL DIALOG SYSTEM
   ========================================================================== */
body.modal-open {
    overflow: hidden !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden; /* Overlay shell never scrolls */
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* CRITICAL: Dialog container NEVER scrolls, preventing double scrollbar */
    padding: 0;
    border: 1px solid var(--border-subtle);
    position: relative;
    margin: auto;
}

/* Modal Header - Fixed at Top */
.modal-header,
.modal-dialog > .card-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.4rem;
    margin: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: #ffffff;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

/* Modal Body - The ONLY element that scrolls when content overflows */
.modal-body,
#student-pedagogical-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Required for proper flex scrolling */
    padding: 1.25rem 1.4rem;
    overscroll-behavior: contain;
}

/* Modal Footer - Fixed at Bottom */
.modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem;
    border-top: 1px solid var(--border-subtle);
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Custom Sleek Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar,
#student-pedagogical-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.modal-body::-webkit-scrollbar-track,
#student-pedagogical-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb,
#student-pedagogical-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.modal-body::-webkit-scrollbar-thumb:hover,
#student-pedagogical-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 420px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--secondary); }

/* ==========================================================================
   PROGRESS TRACK
   ========================================================================== */
.progress-track {
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* ==========================================================================
   SELECT2 CUSTOM MODERN THEME (PIXEL-PERFECT LUXURY STYLING)
   ========================================================================== */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

.select2-container--default {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 44px !important;
    padding: 6px 14px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #94a3b8 !important;
    background-color: #f8fafc !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
    line-height: normal !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding-left: 0 !important;
    padding-right: 28px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    right: 10px !important;
    top: 1px !important;
    width: 20px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #2563eb transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-dropdown {
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06) !important;
    background: #ffffff !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    margin-top: 4px !important;
}

.select2-search--dropdown {
    padding: 10px 12px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.86rem !important;
    outline: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    background: #ffffff !important;
}

.select2-container--default .select2-results__options {
    max-height: 260px !important;
    padding: 6px !important;
}

.select2-container--default .select2-results__option {
    padding: 9px 12px !important;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    margin-bottom: 2px !important;
    line-height: 1.35 !important;
    transition: all 0.15s ease !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #2563eb !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-disabled=true] {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
    cursor: not-allowed !important;
    opacity: 0.85 !important;
    border-left: 3px solid #cbd5e1 !important;
}

/* ==========================================================================
   SESSION TYPE VISUAL SELECTOR CARDS
   ========================================================================== */
.session-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.25rem;
}

.session-type-card {
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.session-type-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.session-type-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
}

.session-type-card.active::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-type-card .st-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.session-type-card.active .st-icon {
    background: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.session-type-card .st-text {
    flex: 1;
    min-width: 0;
}

.session-type-card .st-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: #0f172a;
    margin-bottom: 2px;
}

.session-type-card.active .st-title {
    color: #1d4ed8;
}

.session-type-card .st-desc {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.3;
}

@media (max-width: 960px) {
    .assign-schedule-container {
        grid-template-columns: 1fr !important;
    }
    .session-type-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   LARGE SCREEN OPTIMIZATIONS (≥ 1400px)
   ========================================================================== */
@media (min-width: 1400px) {
    .main-wrapper {
        padding: 1.1rem 1.5rem;
    }

    .admin-sidebar {
        width: 215px;
    }

    .admin-nav-item {
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.65rem;
        margin-bottom: 0.9rem;
    }

    .metric-box {
        padding: 0.8rem 1rem;
    }

    .glass-card {
        padding: 1rem 1.2rem;
        margin-bottom: 0.9rem;
    }

    .card-header {
        margin-bottom: 1rem;
        padding-bottom: 0.7rem;
    }

    .data-table th {
        padding: 0.5rem 0.65rem;
        font-size: 0.72rem;
    }

    .data-table td {
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    .table-filter-bar {
        margin-bottom: 0.75rem;
        gap: 0.65rem;
    }

    .search-input-wrap {
        max-width: 260px;
    }

    .search-input-wrap input {
        padding: 0.4rem 0.75rem 0.4rem 1.8rem;
        font-size: 0.82rem;
    }

    .form-control {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    .btn {
        font-size: 0.82rem;
        padding: 0.45rem 1rem;
    }

    .pagination-wrapper {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   ULTRA-WIDE SCREENS (≥ 1800px)
   ========================================================================== */
@media (min-width: 1800px) {
    .main-wrapper {
        padding: 1rem 2rem;
    }

    .admin-layout {
        gap: 1.5rem;
    }

    .admin-sidebar {
        width: 230px;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .data-table th {
        padding: 0.55rem 0.8rem;
    }

    .data-table td {
        padding: 0.55rem 0.8rem;
    }

    .glass-card {
        padding: 1.1rem 1.4rem;
    }
}

/* ==========================================================================
   TRAINING STATISTICS & PROGRESS BARS
   ========================================================================== */
.progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill-emerald {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 999px;
}

.progress-fill-primary {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #0284c7);
    border-radius: 999px;
}

/* ==========================================================================
   PRINT STYLES FOR TRAINING STATISTICS REPORT
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .admin-sidebar,
    .top-header,
    .app-header,
    .table-filter-bar,
    .btn,
    button,
    .no-print {
        display: none !important;
    }

    .admin-layout {
        display: block !important;
    }

    .admin-main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .glass-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .metrics-grid {
        display: flex !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .metric-box {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        flex: 1 !important;
    }

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

    .data-table th, .data-table td {
        border: 1px solid #ddd !important;
        padding: 6px 8px !important;
        font-size: 9pt !important;
    }
}

/* ==========================================================================
   STUDENT AVAILABILITY MATRIX & QUICK PRESETS (LỊCH RẢNH HỌC VIÊN HIỆN ĐẠI)
   ========================================================================== */
.avail-matrix-container {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.avail-presets-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
}

.avail-preset-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.35rem;
}

.avail-preset-btn {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.avail-preset-btn:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.12);
}

.avail-preset-btn.btn-clear:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.avail-matrix-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.avail-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 780px;
}

.avail-matrix-table th, 
.avail-matrix-table td {
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    padding: 0.5rem;
    text-align: center;
}

.avail-matrix-table th:last-child,
.avail-matrix-table td:last-child {
    border-right: none;
}

.avail-matrix-table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.75rem 0.5rem;
}

.avail-matrix-table th.time-col-header,
.avail-matrix-table td.time-col-cell {
    width: 130px;
    min-width: 130px;
    background: #f8fafc;
    text-align: left;
    padding: 0.65rem 0.85rem;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid var(--border-subtle);
}

.avail-matrix-table thead th.time-col-header {
    z-index: 3;
}

.avail-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.avail-day-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.avail-day-date {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.avail-day-header.today .avail-day-name {
    color: var(--primary);
}

.avail-day-header.today .avail-day-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    margin-top: 0.15rem;
}

/* Individual Slot Cell */
.avail-slot-cell {
    min-height: 54px;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.4rem;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    user-select: none;
    position: relative;
}

.avail-slot-cell:hover:not(.is-past):not(.is-scheduled) {
    border-color: var(--primary);
    background: #f0f7ff;
    transform: scale(1.02);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
    z-index: 2;
}

.avail-slot-cell .cell-status-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

/* State: Selected in draft */
.avail-slot-cell.is-selected {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid #1e40af;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: scale(1.02);
    z-index: 2;
}

.avail-slot-cell.is-selected .cell-status-text {
    color: #ffffff;
    font-weight: 700;
}

.avail-slot-cell.is-selected .cell-icon {
    font-size: 0.95rem;
}

/* State: Already submitted, pending */
.avail-slot-cell.is-pending {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    cursor: pointer;
}

.avail-slot-cell.is-pending:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

.avail-slot-cell.is-pending .cell-status-text {
    color: #92400e;
    font-weight: 700;
}

/* State: Scheduled / Booked */
.avail-slot-cell.is-scheduled {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    cursor: default;
}

.avail-slot-cell.is-scheduled .cell-status-text {
    color: #166534;
    font-weight: 700;
}

/* State: Past Date (Disabled) */
.avail-slot-cell.is-past {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.avail-slot-cell.is-past .cell-status-text {
    color: #94a3b8;
}

/* Avail Summary & Action Box */
.avail-summary-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.avail-staged-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.avail-chip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.avail-chip .btn-remove-chip {
    background: none;
    border: none;
    color: #3b82f6;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
}

.avail-chip .btn-remove-chip:hover {
    color: #ef4444;
}

/* ==========================================================================
   TIMETABLE MATRIX: WEEK VIEW & SCHEDULE DETAIL MODAL
   ========================================================================== */
.timetable-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.timetable-mode-toggle .btn-mode {
    border: none;
    background: transparent;
    padding: 0.42rem 0.85rem;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.timetable-mode-toggle .btn-mode:hover {
    color: var(--text-main);
}

.timetable-mode-toggle .btn-mode.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Weekly Table Grid */
.timetable-week-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1080px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timetable-week-table th {
    background: #f8fafc;
    padding: 0.75rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    border-bottom: 2px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
}

.timetable-week-table th:last-child {
    border-right: none;
}

.timetable-week-table th.col-slot-header {
    width: 130px;
    background: #f1f5f9;
    color: var(--text-muted);
}

.timetable-week-table th.col-today {
    background: #eff6ff;
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.timetable-week-table td {
    vertical-align: top;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    background: #ffffff;
    height: 110px;
    transition: background 0.15s ease;
}

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

.timetable-week-table td:last-child {
    border-right: none;
}

.timetable-week-table td.col-slot-info {
    background: #f8fafc;
    text-align: center;
    vertical-align: middle;
    width: 130px;
    padding: 0.6rem 0.4rem;
}

.timetable-week-table td.col-today {
    background: rgba(239, 246, 255, 0.35);
}

.timetable-week-table td.is-weekend {
    background: rgba(248, 250, 252, 0.5);
}

/* Interactive Session Card in Cell */
.timetable-session-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-left: 3.5px solid var(--primary);
    border-radius: 8px;
    padding: 0.5rem 0.55rem;
    margin-bottom: 0.45rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.timetable-session-card:last-child {
    margin-bottom: 0;
}

.timetable-session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
    border-color: #cbd5e1;
    border-left-color: var(--primary);
}

.timetable-session-card.type-dat {
    border-left-color: #2563eb;
    background: linear-gradient(to right, #f8fafc 0%, #ffffff 100%);
}

.timetable-session-card.type-sahinh {
    border-left-color: #059669;
    background: linear-gradient(to right, #f0fdf4 0%, #ffffff 100%);
}

.timetable-session-card.is-waiting-veh {
    border-left-color: #f59e0b;
}

.timetable-session-card.status-completed {
    border-left-color: #64748b;
    opacity: 0.85;
}

.timetable-session-card.status-cancelled {
    border-left-color: #ef4444;
    background: #fef2f2;
    opacity: 0.7;
}

.timetable-session-card.status-no_show {
    border-left-color: #dc2626;
    background: #fff1f2;
}

.card-student-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.card-student-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-teacher-row {
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-vehicle-row {
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.veh-assigned {
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.veh-waiting {
    color: #d97706;
    background: #fef3c7;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

/* Empty Slot Hover Button */
.cell-empty-action {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    border: 1px dashed transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.4rem;
}

.timetable-week-table td:hover .cell-empty-action {
    display: flex;
    border-color: #cbd5e1;
    background: rgba(241, 245, 249, 0.4);
    color: var(--primary);
}

/* Modal Details Grid Layout */
.schedule-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.schedule-detail-section {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
}

.schedule-detail-section.full-width {
    grid-column: span 2;
}

.section-title-sm {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.detail-info-row:last-child {
    margin-bottom: 0;
}

.detail-info-label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.detail-info-value {
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
}


