/* =========================================================
   AFAQY ENTERPRISE DESIGN SYSTEM & ROUTING ENGINE
   Strict Pointer Isolation, Corporate Theme, Dedicated Panes,
   and Gamified S-Curve Learning Journey (course.html)
   ========================================================= */

:root {
    /* Official Afaqy Brand Palette */
    --primary-navy: #1b325f;
    --primary-navy-dark: #112244;
    --primary-navy-light: #244177;
    --primary-green: #20a850;
    --primary-green-hover: #178a40;
    --light-green: #44b07e;
    --accent-gold: #d4a373;
    --accent-gold-dark: #b88655;
    
    /* Surfaces & Layout */
    --bg-canvas: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    /* Typography */
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 4px 15px rgba(27, 50, 95, 0.05);
    --shadow-card-hover: 0 10px 25px rgba(27, 50, 95, 0.1);
    --shadow-gold: 0 6px 18px rgba(212, 163, 115, 0.35);
    --shadow-green: 0 6px 20px rgba(32, 168, 80, 0.25);
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* =========================================================
   STRICT ISOLATION & HIDING
   ========================================================= */
.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* =========================================================
   1. APP DUAL-PANE SHELL & SIDEBAR (DASHBOARD & ADMIN)
   ========================================================= */

.app-shell {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Left Sidebar (250px) */
.app-sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 1.25rem 0.5rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.sidebar-brand-svg {
    width: 38px;
    height: 38px;
}

.sidebar-brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-navy);
    letter-spacing: -0.5px;
}

.sidebar-brand-title span {
    color: var(--primary-green);
}

.sidebar-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.75rem;
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.sidebar-nav-btn:hover {
    background: var(--bg-canvas);
    color: var(--primary-navy);
}

.sidebar-nav-btn.active {
    background: rgba(27, 50, 95, 0.08);
    color: var(--primary-navy);
    font-weight: 700;
    border-left: 4px solid var(--primary-navy);
}

.sidebar-nav-btn .nav-icon {
    font-size: 1.2rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.sidebar-action-btn:hover {
    background: var(--bg-canvas);
    color: var(--primary-navy);
    font-weight: 600;
}

/* =========================================================
   2. MAIN CONTENT AREA & TOPBAR
   ========================================================= */

.app-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

.main-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
    gap: 1.5rem;
}

.topbar-nav-tabs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.topbar-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.topbar-tab-btn:hover {
    color: var(--primary-navy);
    background: var(--bg-canvas);
}

.topbar-tab-btn.active {
    color: var(--primary-navy);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-navy);
    border-radius: 0;
}

.topbar-controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box-pill {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-pill input {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    width: 220px;
    outline: none;
    transition: all 0.2s;
}

.search-box-pill input:focus {
    width: 280px;
    border-color: var(--primary-navy);
    background: #ffffff;
}

.search-box-pill .search-icon {
    position: absolute;
    left: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.icon-btn-circle {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    color: var(--text-dark);
    transition: all 0.2s;
}

.icon-btn-circle:hover {
    background: #e2e8f0;
}

.badge-counter-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.btn-navy-logout {
    background: var(--primary-navy);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-navy-logout:hover {
    background: var(--primary-navy-dark);
}

/* =========================================================
   3. DEDICATED MODULE VIEW PANES (EMPLOYEE PORTAL)
   ========================================================= */

.dashboard-content-area {
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
}

.module-view-pane {
    animation: fadeIn 0.2s ease-in-out;
}

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

.module-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-navy);
}

.module-page-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.category-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary-navy);
}

.filter-chip.active {
    background: var(--primary-navy);
    color: white;
    border-color: var(--primary-navy);
}

/* Standard Smart Container */
.smart-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.smart-panel:hover {
    box-shadow: var(--shadow-card-hover);
}

.panel-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* =========================================================
   4. SMART 360° OVERVIEW (HERO + SPLIT)
   ========================================================= */

.hero-top-row {
    display: grid;
    grid-template-columns: 1.8fr 1fr 2.5fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 1200px) {
    .hero-top-row {
        grid-template-columns: 1fr;
    }
}

.profile-card-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.profile-avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.profile-name-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.profile-role-text {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.progress-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.progress-header-row .pct-num {
    color: var(--primary-green);
    font-weight: 800;
    font-size: 0.95rem;
}

.segmented-progress-track {
    display: flex;
    gap: 5px;
    height: 12px;
}

.progress-pill-segment {
    flex: 1;
    background: #e2e8f0;
    border-radius: 4px;
    transition: background 0.3s;
}

.progress-pill-segment.active {
    background: var(--primary-green);
}

.xp-center-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.xp-level-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold-dark);
    margin-bottom: 0.5rem;
}

.xp-shield-badge {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #d4a373 0%, #b88655 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-gold);
    margin-bottom: 0.5rem;
}

.xp-shield-badge .shield-small {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.xp-shield-badge .shield-big {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.announcements-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.announcement-green-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.announcement-green-card:hover {
    border-color: var(--primary-green);
    transform: translateX(4px);
}

.green-pill-badge {
    background: var(--primary-green);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.announcement-snippet-text {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.6fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1050px) {
    .dashboard-split-grid {
        grid-template-columns: 1fr;
    }
}

.split-left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.apps-tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.app-square-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 1.15rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    gap: 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.app-square-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.app-square-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e8f5e9;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.app-square-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
}

.hr-split-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.hr-horizontal-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hr-horizontal-card:hover {
    border-color: var(--primary-navy);
    background: #f8fafc;
    transform: translateY(-2px);
}

.hr-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.hr-text-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

/* Calendar Matrix Widget */
.calendar-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cal-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cal-select-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.cal-nav-arrow {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

.calendar-matrix-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-matrix-table th {
    text-align: center;
    padding: 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 1.5px solid var(--border-color);
}

.calendar-matrix-table td {
    padding: 0.5rem;
    height: 78px;
    vertical-align: top;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-dark);
    background: #ffffff;
}

.calendar-matrix-table td.outside-month {
    color: var(--text-light);
    background: #fafafa;
}

.day-number-text {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.cal-meeting-pill {
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.2rem 0.3rem;
    margin-top: 0.2rem;
    text-align: center;
}

.cal-meeting-pill .meeting-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-join-btn {
    background: var(--primary-green);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: background 0.2s;
}

.cal-join-btn:hover {
    background: var(--primary-green-hover);
}

/* =========================================================
   5. GAMIFIED S-CURVE LEARNING PATH (course.html)
   ========================================================= */

.app-container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

/* Course Header Section */
.header-section {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.profile-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    font-size: 2.2rem;
    background: #e8f5e9;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-green);
}

.user-info h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-navy);
    line-height: 1.2;
}

.user-info h2 {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
}

.progress-area {
    display: flex;
    flex-direction: column;
    width: 280px;
}

.xp-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

#xp-text {
    color: var(--primary-green);
    font-weight: 800;
}

#next-level-text {
    color: var(--text-muted);
}

.progress-bar-container {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green) 0%, #44b07e 100%);
    width: 0%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

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

/* S-Curve Path Layout */
.path-container {
    max-width: 860px;
    margin: 2.5rem auto 5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.path-node {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    width: 440px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    margin-right: auto;
}

.path-node.right-side {
    margin-left: auto;
    margin-right: 0;
}

/* Node States */
.path-node.unlocked {
    border-color: var(--primary-green);
    box-shadow: 0 8px 25px rgba(32, 168, 80, 0.18);
    background: #ffffff;
}

.path-node.unlocked:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(32, 168, 80, 0.25);
    border-color: var(--primary-green-hover);
}

.path-node.completed {
    border-color: var(--primary-navy);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.path-node.completed:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.path-node.locked {
    background: #f1f5f9;
    border-color: #cbd5e1;
    opacity: 0.65;
    cursor: not-allowed;
}

.node-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.path-node.unlocked .node-icon {
    background: #e8f5e9;
    border-color: var(--primary-green);
}

.path-node.completed .node-icon {
    background: #e0f2fe;
    border-color: var(--primary-navy);
}

.node-content {
    flex-grow: 1;
}

.quest-xp {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary-green);
    background: rgba(32, 168, 80, 0.12);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-bottom: 0.35rem;
}

.path-node.completed .quest-xp {
    color: var(--primary-navy);
    background: rgba(27, 50, 95, 0.1);
}

.quest-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.2rem;
}

.quest-week {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Connecting Curved Path Lines */
.path-connector {
    width: 180px;
    height: 65px;
    border-right: 4px dashed #cbd5e1;
    border-bottom: 4px dashed #cbd5e1;
    border-bottom-right-radius: 28px;
    margin: -10px auto -10px 220px;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s;
}

.path-connector.reverse {
    border-right: none;
    border-left: 4px dashed #cbd5e1;
    border-bottom-left-radius: 28px;
    margin: -10px 220px -10px auto;
}

.path-connector.active {
    border-color: var(--primary-green);
    border-style: solid;
}

/* =========================================================
   6. READING PANE & QUIZ MODAL
   ========================================================= */

.modal-content.large {
    max-width: 860px;
    width: 92%;
}

.chapter-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-navy);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.reading-pane {
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.75rem;
    color: var(--text-dark);
}

.reading-pane h1, .reading-pane h2, .reading-pane h3 {
    color: var(--primary-navy);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.reading-pane code {
    background: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: monospace;
}

.reading-pane pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.validation-section {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.validation-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

.quiz-question {
    background: var(--bg-canvas);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.quiz-question p {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.75rem;
}

.quiz-question label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin: 0.4rem 0 !important;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.quiz-question label:hover {
    border-color: var(--primary-navy);
    background: #f8fafc;
}

.quiz-question input[type="radio"] {
    accent-color: var(--primary-green);
    width: 16px;
    height: 16px;
}

/* =========================================================
   7. CELEBRATION & LEVEL UP OVERLAY
   ========================================================= */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(6px);
}

.celebration-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 480px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    border: 3px solid var(--accent-gold);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.celebration-icon {
    font-size: 4rem;
    margin: 1rem 0;
}

.celebration-content h1 {
    color: var(--accent-gold-dark);
    font-size: 2rem;
    font-weight: 800;
}

.celebration-content h2 {
    color: var(--primary-navy);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

/* =========================================================
   8. STRICT MODAL OVERLAYS & CONTROLS
   ========================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.modal-dialog-box, .modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 580px;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   9. QUEST LEARNING STUDIO (VARIATION B: TABBED SPLIT-STUDIO)
   ========================================================= */

.quest-studio-modal {
    width: 95vw !important;
    max-width: 1240px !important;
    height: 88vh !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.5rem !important;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

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

.quest-studio-top-workspace, .quest-studio-body {
    display: flex;
    gap: 1.25rem;
    flex: 1;
    min-height: 0;
}

/* Left Studio Stage (56%): Phase Title, Reading Documentation & Study Materials */
.quest-studio-left {
    flex: 56;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 0.75rem;
}

/* Right Studio Stage (44%): Video Stage, Telemetry & Progressive Quiz */
.quest-studio-right {
    flex: 44;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    padding-left: 0.25rem;
}

.active-video-stage-box {
    border-radius: 10px;
    overflow: hidden;
    background: black;
    box-shadow: var(--shadow-sm);
    min-height: 220px;
}

.chapter-playlist-pills-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 0.25rem;
}

.chapter-pill-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--primary-navy);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chapter-pill-btn:hover {
    border-color: var(--primary-navy);
}

.chapter-pill-btn.active {
    background: var(--primary-navy);
    color: white;
    border-color: var(--primary-navy);
}

/* Studio Bottom Row (100% Full Width): My Personal Notes */
.quest-studio-bottom-notes {
    margin-top: 0.65rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
}

.horizontal-notes-layout {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.studio-tabs-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.25rem;
}

/* Quest Material Blueprint Ribbon */
.quest-blueprint-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.blueprint-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-navy);
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.blueprint-chip.clickable {
    cursor: pointer;
    user-select: none;
}

.blueprint-chip.clickable:hover {
    transform: translateY(-2px);
}

.blueprint-chip.clickable:active {
    transform: translateY(0);
}

.blueprint-chip.video-chip {
    background: rgba(27, 50, 95, 0.06);
    color: var(--primary-navy);
    border-color: rgba(27, 50, 95, 0.18);
}
.blueprint-chip.video-chip.clickable:hover {
    background: rgba(27, 50, 95, 0.12);
    border-color: var(--primary-navy);
    box-shadow: 0 4px 12px rgba(27, 50, 95, 0.18);
}

.blueprint-chip.reading-chip {
    background: rgba(32, 168, 80, 0.08);
    color: var(--primary-green);
    border-color: rgba(32, 168, 80, 0.25);
}
.blueprint-chip.reading-chip.clickable:hover {
    background: rgba(32, 168, 80, 0.15);
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(32, 168, 80, 0.22);
}

.blueprint-chip.pdf-chip {
    background: rgba(220, 38, 38, 0.06);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.2);
}
.blueprint-chip.pdf-chip.clickable:hover {
    background: rgba(220, 38, 38, 0.12);
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}

.blueprint-chip.quiz-chip {
    background: rgba(212, 163, 115, 0.12);
    color: #b45309;
    border-color: rgba(212, 163, 115, 0.35);
}
.blueprint-chip.quiz-chip.clickable:hover {
    background: rgba(212, 163, 115, 0.22);
    border-color: #b45309;
    box-shadow: 0 4px 12px rgba(212, 163, 115, 0.28);
}

/* Stage Pulse and Focus Glow Animations */
@keyframes focusPulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(32, 168, 80, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(32, 168, 80, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(32, 168, 80, 0); }
}

.glow-focus-pulse {
    animation: focusPulseGlow 1.2s ease-out;
}

/* Multi-Video Chapter Playlist Strip */
.chapter-playlist-strip {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.75rem 0 1.5rem 0;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
}

.chapter-playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-navy);
    margin-bottom: 0.25rem;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chapter-item:hover {
    border-color: var(--primary-navy);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.chapter-item.active {
    background: var(--primary-navy);
    border-color: var(--primary-navy);
    color: white;
}

.chapter-item.active .chapter-title {
    color: white !important;
}

.chapter-item.active .chapter-meta {
    color: #cbd5e1 !important;
}

.chapter-status-pill {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
}

.chapter-status-pill.playing {
    background: rgba(32, 168, 80, 0.2);
    color: #16a34a;
}
.chapter-item.active .chapter-status-pill.playing {
    background: var(--primary-green);
    color: white;
}

.chapter-status-pill.done {
    background: #dcfce7;
    color: #16a34a;
}

.chapter-status-pill.pending {
    background: #f1f5f9;
    color: #64748b;
}

/* Playback Status Badge */
.playback-status-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.playback-status-badge.playing {
    background: #dcfce7;
    color: #16a34a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.playback-status-badge.paused {
    background: #f1f5f9;
    color: #64748b;
}

.studio-tab-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

.studio-tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.studio-tab-content {
    flex: 1;
}

.studio-tab-content.hidden {
    display: none;
}

/* Right Interactive Sidebar (35%) */
.quest-studio-right {
    flex: 35;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-left: 0.25rem;
}

.studio-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.studio-card:hover {
    border-color: #cbd5e1;
}

.progressive-quiz-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
}

.progressive-quiz-card.unlocked-glow {
    border-color: var(--primary-green);
    box-shadow: 0 0 16px rgba(32, 168, 80, 0.2);
    animation: studioUnlockGlow 0.6s ease-out;
}

@keyframes studioUnlockGlow {
    0% { transform: scale(0.98); border-color: var(--primary-green); }
    50% { transform: scale(1.02); box-shadow: 0 0 24px rgba(32, 168, 80, 0.35); }
    100% { transform: scale(1); }
}

@media (max-width: 900px) {
    .quest-studio-body {
        flex-direction: column;
    }
    .quest-studio-modal {
        height: 95vh !important;
        max-height: 95vh !important;
    }
}

.modal-close-x, .close-modal {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-close-x:hover, .close-modal:hover {
    background: #fee2e2;
    color: #dc2626;
}

.form-group-field {
    margin-bottom: 1.25rem;
}

.form-group-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-group-field input,
.form-group-field select,
.form-group-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group-field input:focus,
.form-group-field select:focus,
.form-group-field textarea:focus {
    border-color: var(--primary-navy);
}

.btn-primary-action {
    background: var(--primary-navy);
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary-action:hover {
    background: var(--primary-navy-dark);
}

.btn-primary {
    background: var(--primary-navy);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-navy-dark);
}

.btn-success {
    background: var(--primary-green);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-success:hover {
    background: var(--primary-green-hover);
}

.btn-secondary {
    background: white;
    color: var(--primary-navy);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* =========================================================
   9. ADMIN TABLES & METRICS
   ========================================================= */

.admin-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.admin-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border-top: 4px solid var(--primary-navy);
}

.admin-stat-card.green { border-top-color: var(--primary-green); }
.admin-stat-card.gold { border-top-color: var(--accent-gold); }

.admin-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-navy);
    margin-top: 0.25rem;
}

.admin-stat-num.green { color: var(--primary-green); }
.admin-stat-num.gold { color: var(--accent-gold-dark); }

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

.admin-enterprise-table th {
    background: #f8fafc;
    color: var(--primary-navy);
    padding: 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.admin-enterprise-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    vertical-align: middle;
}

.admin-enterprise-table tr:hover {
    background: #fcfcfc;
}

/* =========================================================
   10. SSO & LOGIN PORTAL STYLING
   ========================================================= */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1b325f 0%, #112244 100%);
    padding: 1.5rem;
}

.login-box {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-box h2 {
    color: var(--primary-navy);
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.login-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    margin-bottom: 0.75rem;
}

/* =========================================================
   11. LARGE FILE & VIDEO UPLOAD PROGRESS TRACKER
   ========================================================= */
@keyframes uploadStripeAnimation {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

@keyframes uploadCardGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12); }
    50% { box-shadow: 0 6px 24px rgba(37, 99, 235, 0.28); }
}

.upload-active-progress-bar {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.25) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.25) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: uploadStripeAnimation 1s linear infinite;
}

.upload-card-pulse {
    animation: uploadCardGlow 2s ease-in-out infinite;
}

/* =========================================================
   FINAL EXAM LOCKDOWN & ANTI-CHEAT SHIELD
   ========================================================= */
.exam-protected-content {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

@keyframes examViolationPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.exam-violation-active {
    animation: examViolationPulse 1.2s infinite;
}


