@import url('thmanyah.css');
@import url('sigma_landing.css');

:root {
    --font-thmanyah: 'Thmanyah Sans', 'Thmanyah', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-thmanyah-sans: 'Thmanyah Sans', 'Thmanyah', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-thmanyah-serif: 'Thmanyah Serif Display', 'Thmanyah', serif;
    --font-thmanyah-text: 'Thmanyah Serif Text', 'Thmanyah', serif;
    --font-cairo: var(--font-thmanyah-sans);
    --font-main: var(--font-thmanyah-sans);
    --font-heading: var(--font-thmanyah-serif);
    --font-reading: var(--font-thmanyah-text);
}

/* Ambient Lighting & Background Motifs for All Dashboard Pages */
.sigma-ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sigma-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.22;
    animation: sigmaOrbPulse 12s infinite alternate ease-in-out;
}

.sigma-orb-1 {
    top: -10%;
    right: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--sigma-cyan, #0284C7) 0%, rgba(0, 242, 254, 0) 70%);
}

.sigma-orb-2 {
    top: 40%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--sigma-violet, #6366F1) 0%, rgba(123, 44, 191, 0) 70%);
    animation-delay: -6s;
}

@keyframes sigmaOrbPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.18; }
    50% { transform: scale(1.15) translate(30px, -20px); opacity: 0.3; }
    100% { transform: scale(0.9) translate(-20px, 30px); opacity: 0.18; }
}

:root {
    --primary-color: #0284C7;
    --primary-hover: #0369A1;
    --secondary-color: #6366F1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-main: #F8FAFC;
    --bg-card: rgba(255, 255, 255, 0.88);
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: rgba(99, 102, 241, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
    --shadow-md: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 0 15px rgba(99, 102, 241, 0.05);
    --shadow-lg: 0 15px 35px -10px rgba(15, 23, 42, 0.12), 0 0 25px rgba(99, 102, 241, 0.1);

    --bg-color: var(--bg-main);
    --text-color: var(--text-main);
    --card-bg: var(--bg-card);
    --auth-bg-gradient: radial-gradient(circle at 50% 0%, #EEF2FF 0%, #F1F5F9 50%, #F8FAFC 100%);
    --table-header-bg: rgba(2, 132, 199, 0.05);
    --table-row-hover: rgba(2, 132, 199, 0.03);
}

[data-theme="dark"] {
    --bg-main: #070415;
    --bg-card: rgba(20, 11, 48, 0.65);
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --border-color: rgba(0, 242, 254, 0.15);
    --primary-color: #00F2FE;
    --primary-hover: #4FACFE;
    --secondary-color: #7B2CBF;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;

    --bg-color: var(--bg-main);
    --text-color: var(--text-main);
    --card-bg: var(--bg-card);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(123, 44, 191, 0.15);
    --shadow-lg: 0 15px 35px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 242, 254, 0.2);
    --auth-bg-gradient: radial-gradient(circle at 50% 0%, #1c0f45 0%, #0c0624 50%, #070415 100%);
    --table-header-bg: rgba(0, 242, 254, 0.08);
    --table-row-hover: rgba(0, 242, 254, 0.04);
}

*, body, button, input, select, textarea {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-thmanyah-sans);
}

body {
    background-color: var(--bg-color);
    background-image: var(--auth-bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Enable smooth transitions ONLY during active theme toggle clicks */
html.theme-animating,
html.theme-animating body,
html.theme-animating .card,
html.theme-animating .app-header,
html.theme-animating .sidebar,
html.theme-animating .table,
html.theme-animating .table th,
html.theme-animating .table td,
html.theme-animating .form-control {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    flex-shrink: 0;
    user-select: none;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--border-color);
    transform: scale(1.08) rotate(10deg);
    box-shadow: var(--shadow-md);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Dedicated position for login/register theme toggle */
.auth-theme-toggle {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 1000;
}

/* Typography settings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-thmanyah-serif, 'Thmanyah Serif Display', serif);
    font-weight: 700;
    line-height: 1.3;
}

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

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Layout */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1.5px solid var(--border-color);
    padding: 0.85rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-wrapper h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ==========================================================================
   GLOBAL SEARCH BAR & LIVE DROPDOWN (Universal Across All Pages)
   ========================================================================== */
.sigma-search-wrap {
    position: relative;
    z-index: 1050;
}

.sigma-search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    padding: 0 0.85rem;
    gap: 0.55rem;
    height: 40px;
    width: 220px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
}

.sigma-search-box:focus-within {
    width: 280px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15), var(--shadow-md);
    background: var(--bg-card);
}

[data-theme="dark"] .sigma-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2), 0 0 15px rgba(0, 242, 254, 0.15);
}

.sigma-search-icon {
    color: var(--primary-color);
    font-size: 0.9rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sigma-search-box:focus-within .sigma-search-icon {
    transform: scale(1.1);
}

.sigma-search-input {
    border: none !important;
    background: transparent !important;
    color: var(--text-main) !important;
    font-family: var(--font-thmanyah-sans, 'Thmanyah Sans', sans-serif) !important;
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    width: 100% !important;
    height: auto !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sigma-search-input::placeholder {
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
}

.sigma-search-clear-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    cursor: pointer;
    padding: 0 0.15rem !important;
    line-height: 1;
    transition: color 0.15s ease;
    display: none;
}

.sigma-search-clear-btn:hover {
    color: var(--danger-color, #ef4444) !important;
}

.sigma-search-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: sigmaSearchSpin 0.6s linear infinite;
    display: none;
    flex-shrink: 0;
}

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

/* Dropdown Container */
.sigma-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 92vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 460px;
    overflow-y: auto;
    z-index: 99999;
    padding: 0.65rem;
    display: none;
    animation: sigmaDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    text-align: right;
}

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

.sigma-search-group {
    margin-bottom: 0.65rem;
}

.sigma-search-group:last-child {
    margin-bottom: 0;
}

.sigma-search-group-title {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--primary-color);
    padding: 0.3rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.35rem;
}

.sigma-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.15s ease;
    cursor: pointer;
}

.sigma-search-item:hover,
.sigma-search-item.active-item {
    background: var(--table-row-hover, rgba(2, 132, 199, 0.06));
    transform: translateX(-2px);
}

.sigma-search-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(2, 132, 199, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sigma-search-item-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sigma-search-item-info {
    flex: 1;
    min-width: 0;
}

.sigma-search-item-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.sigma-search-item-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.sigma-search-badge {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary-color);
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.sigma-search-price {
    font-weight: 700;
    font-size: 0.76rem;
    color: var(--success-color, #10b981);
    margin-right: auto;
}

.sigma-search-empty {
    text-align: center;
    padding: 1.25rem 0.75rem;
    color: var(--text-muted);
}

.sigma-search-empty i {
    font-size: 1.8rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 0.4rem;
    display: block;
}

.sigma-search-empty p {
    font-size: 0.85rem;
    margin: 0.2rem 0;
    color: var(--text-main);
}

.sigma-search-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.sigma-search-highlight {
    background: rgba(2, 132, 199, 0.18);
    color: var(--primary-color);
    font-weight: 800;
    border-radius: 3px;
    padding: 0 2px;
}

[data-theme="dark"] .sigma-search-highlight {
    background: rgba(0, 242, 254, 0.25);
    color: var(--primary-color);
}

@media (max-width: 991px) {
    .sigma-search-wrap {
        display: none;
    }
}

.user-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 0.92rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
    backdrop-filter: blur(12px);
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1.5px solid var(--border-color);
    padding: 1.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.sidebar-link:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    transform: translateX(-3px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(139, 92, 246, 0.16) 100%);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
    font-weight: 800;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
    overflow-y: auto;
}

/* Card */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.35);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

/* Grid System */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

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

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

/* Stats Card */
.stat-card {
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

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

.stat-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 0.05rem;
    color: var(--text-main);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: var(--transition-fast);
    font-family: inherit;
}

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

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

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

/* Login/Register Page Specific */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background-color: var(--bg-main) !important;
    background-image: var(--auth-bg-gradient) !important;
    color: var(--text-main);
    overflow-x: hidden;
}

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

.auth-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 1.15rem;
}

.auth-brand-icon {
    font-size: 1.3rem;
}

.auth-brand-title {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.auth-header h2 {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Demo accounts interactive box */
.demo-accounts-box {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--table-header-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
}

.demo-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.demo-buttons {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.demo-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.demo-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
}

/* Custom Table System */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.92rem;
}

.table th {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    background-color: var(--table-header-bg);
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main);
}

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

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

.table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* User cell layout helper */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.user-cell-info {
    display: flex;
    flex-direction: column;
}

.user-cell-name {
    font-weight: 700;
    color: var(--text-main);
}

.user-cell-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Progress bar */
.progress-container {
    width: 100%;
    background-color: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width var(--transition-normal);
}

/* Sequential unlock styling */
.lesson-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
    background-color: var(--bg-card);
}

.lesson-list-item.unlocked:hover {
    border-color: var(--primary-color);
    transform: translateX(-4px);
}

.lesson-list-item.locked {
    background-color: var(--border-color);
    border-color: var(--border-color);
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.lesson-list-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-status-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lesson-list-item.unlocked .lesson-status-icon {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.lesson-list-item.completed .lesson-status-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.lesson-list-item.locked .lesson-status-icon {
    background-color: var(--border-color);
    color: var(--text-muted);
}

/* Alerts banners */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.alert-info {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

/* Units outline box */
.unit-section {
    margin-bottom: 2rem;
}

.unit-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Footer styling */
.app-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Quiz UI custom styles */
.question-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.answer-option:hover {
    background-color: rgba(99, 102, 241, 0.04);
    border-color: var(--primary-color);
}

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

/* Video container with YouTube Header Cropping & Protection */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    background: #000;
}

.video-responsive iframe {
    position: absolute;
    top: -10%;
    left: -2%;
    width: 104%;
    height: 120%;
    border: 0;
}

.video-top-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 75px;
    z-index: 99;
    cursor: default;
    background: rgba(0, 0, 0, 0.001);
    pointer-events: auto !important;
}

/* Plyr Custom LMS Video Player Styling */
:root {
    --plyr-color-main: var(--primary-color, #0284c7);
    --plyr-video-control-color: #ffffff;
    --plyr-video-control-color-hover: #ffffff;
    --plyr-menu-bg: var(--bg-card, #1e293b);
    --plyr-menu-color: var(--text-main, #f8fafc);
    --plyr-menu-radius: 12px;
}

.video-responsive-plyr {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    background: #000;
    position: relative;
}

/* Crop YouTube top channel header and bottom logo */
.video-responsive-plyr .plyr__video-embed {
    overflow: hidden;
    position: relative;
}

.video-responsive-plyr .plyr__video-embed iframe {
    transform: scale(1.25) !important;
    transform-origin: center center !important;
}

@media (max-width: 768px) {
    .video-responsive-plyr .plyr__video-embed iframe {
        transform: scale(1.42) !important;
        transform-origin: center center !important;
    }
}

.plyr--video {
    border-radius: 16px;
    overflow: hidden;
}

.plyr__controls {
    z-index: 10 !important;
}

.plyr__control--overlaid {
    background: var(--primary-color, #0284c7) !important;
    border-radius: 50% !important;
    padding: 1.25rem !important;
    z-index: 10 !important;
}

/* Modals */
div[id$="-modal"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

div[id$="-modal"]>div {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* ==========================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   ========================================== */

/* Laptop / Desktop medium screens (max-width: 1024px) */
@media (max-width: 1024px) {
    .app-header {
        padding: 0.85rem 1.25rem;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

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

    .sidebar {
        width: 220px;
        padding: 1.5rem 0.75rem;
    }

    .main-content {
        padding: 1.5rem;
    }
}

/* Tablets and Mobile Landscape (max-width: 768px) */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo-wrapper h1 {
        font-size: 1.25rem;
    }

    .user-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .nav-user {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Mobile Hamburger ☰ Toggle Button Styling - HIDDEN BY DEFAULT on all screens */
.mobile-hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
    flex-shrink: 0;
}

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

.sidebar-close-btn {
    display: none;
}

/* Desktop Only Rules (min-width: 769px) - Standard Computer Layout */
@media (min-width: 769px) {
    aside.sidebar {
        position: static !important;
        transform: none !important;
        width: 250px !important;
        height: auto !important;
        box-shadow: none !important;
        z-index: 1 !important;
        padding: 1.5rem 0.85rem !important;
        border-left: 1px solid var(--border-color) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .sidebar-close-btn {
        display: none !important;
    }
    .sidebar-theme-toggle {
        display: none !important;
    }
    .mobile-hamburger-btn {
        display: none !important;
    }
    .sidebar-mobile-overlay {
        display: none !important;
    }
}

/* Off-Canvas Mobile Sidebar Drawer (max-width: 768px ONLY) */
@media (max-width: 768px) {
    .app-header {
        padding: 0.6rem 0.85rem !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    .logo-wrapper {
        gap: 0.5rem !important;
        flex-shrink: 0;
        align-items: center;
    }

    .logo-wrapper h1 {
        font-size: 1.15rem !important;
        white-space: nowrap !important;
    }

    .user-badge {
        display: none !important;
    }

    .nav-user {
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0;
        align-items: center;
    }

    /* Hide welcome text greeting on mobile header so header fits on 1 line */
    .nav-user > span {
        display: none !important;
    }

    .nav-user .btn-danger, .nav-user .btn-sm {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* Hide theme toggle sun/moon button from header on mobile; available inside 3-bars sidebar */
    .theme-toggle-btn, #theme-toggle {
        display: none !important;
    }

    .mobile-hamburger-btn {
        display: none !important;
    }

    .dashboard-container {
        flex-direction: column;
    }

    /* Hide static sidebar on mobile since mobile drawer is active */
    aside.sidebar {
        display: none !important;
    }

    .sidebar-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0.85rem;
        margin-bottom: 0.85rem;
        border-bottom: 1px solid var(--border-color);
        font-weight: 800;
        font-size: 1.05rem;
        color: var(--text-main);
    }

    .sidebar-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
        background-color: transparent;
        border: none;
    }

    .sidebar-link.active {
        background-color: rgba(99, 102, 241, 0.1);
        color: var(--primary-color) !important;
        border-right: 3px solid var(--primary-color);
        font-weight: 700;
    }

    .sidebar-link[style*="margin-top: auto"] {
        margin-top: auto !important;
    }

    /* Mobile Dark Backdrop Overlay */
    .sidebar-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 99998;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-mobile-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Additional Mobile Responsive Tweaks (max-width: 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

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

    .card-title {
        font-size: 1.1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.85rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }

    /* Table responsive behavior */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
    }

    .table {
        min-width: 580px;
        margin-top: 0;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.65rem;
        font-size: 0.85rem;
    }

    .lesson-list-item {
        padding: 0.85rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .lesson-list-info {
        gap: 0.65rem;
    }
}

/* Mobile Phones Portrait (max-width: 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 0.65rem 0.75rem;
    }

    .logo-wrapper h1 {
        font-size: 1.1rem;
    }

    .nav-user span {
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
    }

    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius-sm);
    }

    .auth-page {
        padding: 0.75rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-md);
    }

    .auth-header h2 {
        font-size: 1.35rem;
    }

    .auth-header p {
        font-size: 0.85rem;
    }

    .auth-theme-toggle {
        top: 0.75rem;
        left: 0.75rem;
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        font-size: 1rem;
    }

    .form-control {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }

    .question-card {
        padding: 1rem;
    }

    .question-text {
        font-size: 0.98rem;
    }

    .answer-option {
        padding: 0.6rem 0.75rem;
        font-size: 0.88rem;
    }

    div[id$="-modal"]>div {
        padding: 1.15rem;
        max-width: 95%;
    }
}

/* Extra Small Phones (max-width: 360px) */
@media (max-width: 360px) {
    .logo-wrapper h1 {
        font-size: 1rem;
    }

    .user-badge {
        display: none;
    }

    .nav-user span {
        display: none;
    }

    .main-content {
        padding: 0.5rem;
    }
}

/* Touch-Friendly Global Enhancements */
button, select, input, a.btn {
    touch-action: manipulation;
}

/* Content Protection & Dynamic Watermark System */
.protected-content-container {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
}

.protected-content-container iframe,
.protected-content-container video {
    pointer-events: auto;
}

.watermark-overlay {
    position: absolute;
    top: 20%;
    left: 20%;
    pointer-events: none;
    z-index: 999;
    background: rgba(15, 23, 42, 0.65);
    color: rgba(255, 255, 255, 0.85);
    border: 1px dashed rgba(255, 255, 255, 0.35);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    transition: all 1.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: watermarkDrift 22s infinite alternate ease-in-out;
}

@keyframes watermarkDrift {
    0% {
        top: 15%;
        left: 15%;
        opacity: 0.7;
        transform: rotate(-4deg);
    }

    25% {
        top: 70%;
        left: 25%;
        opacity: 0.9;
        transform: rotate(3deg);
    }

    50% {
        top: 30%;
        left: 65%;
        opacity: 0.6;
        transform: rotate(-2deg);
    }

    75% {
        top: 75%;
        left: 60%;
        opacity: 0.85;
        transform: rotate(4deg);
    }

    100% {
        top: 20%;
        left: 45%;
        opacity: 0.75;
        transform: rotate(-3deg);
    }
}

/* ==========================================================================
   JAW ACADEMY STYLE AUTHENTICATION (ZERO-SCROLL COMPACT FIT)
   ========================================================================== */
body.jaw-auth-page {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0.75rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 80% 20%, rgba(0, 242, 254, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.12) 0%, transparent 50%);
}

body.jaw-auth-page .sigma-watermark {
    display: none !important;
}

.jaw-auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    min-height: 450px;
    max-height: 96vh;
    margin: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    overflow: hidden !important;
    align-items: stretch;
}

/* Theme-Aware Left Banner Side */
.jaw-auth-banner {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.08) 100%);
    padding: 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: var(--text-main);
    border-left: 1px solid var(--border-color);
}

[data-theme="dark"] .jaw-auth-banner {
    background: linear-gradient(145deg, #180d38 0%, #0d0622 60%, #080315 100%);
    color: #ffffff;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.jaw-auth-banner::before {
    content: 'Σ';
    position: absolute;
    top: -40px;
    right: -40px;
    font-size: 260px;
    font-weight: 900;
    color: rgba(99, 102, 241, 0.05);
    line-height: 1;
    pointer-events: none;
}

[data-theme="dark"] .jaw-auth-banner::before {
    color: rgba(0, 242, 254, 0.04);
}

.jaw-banner-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.jaw-banner-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.jaw-banner-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

[data-theme="dark"] .jaw-banner-brand-text {
    color: #ffffff;
}

.jaw-banner-brand-text span {
    color: var(--primary-color);
}

.jaw-banner-hero-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    color: var(--text-main);
}

[data-theme="dark"] .jaw-banner-hero-text h1 {
    color: #ffffff;
}

.jaw-banner-hero-text p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

[data-theme="dark"] .jaw-banner-hero-text p {
    color: rgba(255, 255, 255, 0.78);
}

.jaw-banner-features {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1rem;
}

.jaw-feature-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    color: var(--text-main);
}

[data-theme="dark"] .jaw-feature-item {
    color: rgba(255, 255, 255, 0.9);
}

.jaw-feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.7rem;
    flex-shrink: 0;
}

[data-theme="dark"] .jaw-feature-icon {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: #00f2fe;
}

/* Right Auth Form Side */
.jaw-auth-form-wrap {
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-card);
    overflow: hidden !important; /* ABSOLUTELY NO SCROLLBAR */
}

.jaw-auth-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

/* Jaw Auth Tab Switcher */
.jaw-auth-tabs {
    display: flex;
    background: var(--bg-main);
    padding: 2px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.jaw-auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 50px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.jaw-auth-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.25);
}

/* Input Fields with Icons */
.jaw-input-group {
    position: relative;
    margin-bottom: 0.6rem;
}

.jaw-input-icon {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.3s ease;
    pointer-events: none;
}

.jaw-input-control {
    width: 100%;
    padding: 0.55rem 2.3rem 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.jaw-input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.jaw-password-toggle {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.85rem;
}

.jaw-password-toggle:hover {
    color: var(--primary-color);
}

.demo-accounts-box {
    margin-top: 0.65rem !important;
    padding: 0.35rem 0.5rem !important;
}

.demo-title {
    font-size: 0.72rem !important;
}

.demo-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.72rem !important;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .jaw-auth-wrapper {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
    .jaw-auth-banner {
        display: none;
    }
    .jaw-auth-form-wrap {
        padding: 1.25rem 1rem;
    }
}

/* ==========================================================================
   ULTRA-PROFESSIONAL STUDENT PORTAL DESIGN SYSTEM
   ========================================================================== */

/* Hero Banner */
.student-hero-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(99, 102, 241, 0.15) 50%, rgba(123, 44, 191, 0.12) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

[data-theme="dark"] .student-hero-banner {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(123, 44, 191, 0.18) 100%);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.1);
}

.student-hero-content h2 {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.student-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(2, 132, 199, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(2, 132, 199, 0.25);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

[data-theme="dark"] .student-hero-badge {
    background: rgba(0, 242, 254, 0.15);
    border-color: rgba(0, 242, 254, 0.35);
}

.student-hero-stats {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.hero-stat-chip {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    text-align: center;
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.hero-stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    display: block;
}

.hero-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 0.25rem;
    display: block;
}

/* Resume Learning Card */
.resume-card-premium {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.resume-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.resume-card-premium:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

/* Premium Course Card */
.course-card-premium {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.course-card-premium:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.course-img-box {
    position: relative;
    height: 170px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(99, 102, 241, 0.12));
}

.course-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.course-card-premium:hover .course-img-box img {
    transform: scale(1.06);
}

.course-badge-status {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-badge-status.enrolled {
    background: rgba(16, 185, 129, 0.9);
    color: #ffffff;
}

.course-badge-status.available {
    background: rgba(2, 132, 199, 0.9);
    color: #ffffff;
}

/* Curriculum Accordion */
.curriculum-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.unit-accordion-item {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-normal);
}

.unit-accordion-header {
    padding: 1.15rem 1.5rem;
    background: rgba(2, 132, 199, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    font-weight: 800;
    font-size: 1.05rem;
}

.unit-lesson-row {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    gap: 1rem;
}

.unit-lesson-row:last-child {
    border-bottom: none;
}

.unit-lesson-row:hover {
    background-color: var(--table-row-hover);
}

/* Lesson Cinema Focus Player */
.lesson-cinema-wrapper {
    background: #000000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--sigma-cyan-glow, rgba(2, 132, 199, 0.25));
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

/* Workspace Tabs */
.workspace-tabs-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.workspace-tab-btn {
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* ==========================================================================
   NEXT-GEN COMPACT APP WORKSPACE DESIGN SYSTEM (STUDENT PORTAL)
   ========================================================================== */

/* Top App Command Bar */
.student-appbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.student-appbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appbar-nav-link {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.appbar-nav-link:hover {
    color: var(--primary-color);
    background: rgba(2, 132, 199, 0.08);
}

.appbar-nav-link.active {
    color: var(--primary-color);
    background: rgba(2, 132, 199, 0.12);
    font-weight: 800;
}

/* Dual Pane App Layout */
.student-app-workspace {
    max-width: 1550px;
    width: 95%;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.student-app-workspace.split-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.75rem;
}

@media (max-width: 1080px) {
    .student-app-workspace.split-workspace {
        grid-template-columns: 1fr;
    }
}

/* Compact Banner */
.compact-hero-banner {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.14) 0%, rgba(99, 102, 241, 0.16) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

/* Filter Pills Bar */
.filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.filter-pill-btn {
    padding: 0.45rem 1.15rem;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.filter-pill-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Compact Sleek Course Card */
.sleek-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.sleek-compact-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.sleek-compact-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.compact-card-header {
    position: relative;
    height: 130px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(99, 102, 241, 0.15));
}

.compact-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.sleek-compact-card:hover .compact-card-header img {
    transform: scale(1.05);
}

.compact-card-badge {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    padding: 0.2rem 0.65rem;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.compact-card-body {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
    justify-content: space-between;
}

/* Timeline Curriculum Tree */
.curriculum-timeline-tree {
    position: relative;
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.curriculum-timeline-tree::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 18px;
    bottom: 15px;
    width: 2px;
    background: var(--border-color);
}

.timeline-step-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    gap: 1rem;
}

.timeline-step-item:hover {
    border-color: var(--primary-color);
    transform: translateX(-3px);
}

.timeline-node-dot {
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border-color);
    border: 3px solid var(--bg-main);
    z-index: 2;
}

.timeline-step-item.completed .timeline-node-dot {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.timeline-step-item.active .timeline-node-dot {
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

/* Mobile Bottom Navigation Bar & Mobile Side Drawers (Hidden by default on Desktop) */
.student-bottom-navbar,
.teacher-mobile-menu-wrapper,
.admin-mobile-menu-wrapper,
.teacher-mobile-drawer,
.admin-mobile-drawer,
.teacher-drawer-overlay,
.admin-drawer-overlay {
    display: none;
}

@media (max-width: 768px) {
    .student-bottom-navbar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 0.5rem 1rem;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    }

    /* Teacher & Admin Mobile Side Drawer (RTL - Right Side) */
    .teacher-mobile-menu-wrapper,
    .admin-mobile-menu-wrapper {
        display: block;
        position: relative;
    }

    .teacher-hamburger-btn,
    .admin-hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 12px;
        background: rgba(2, 132, 199, 0.08);
        border: 1px solid var(--border-color);
        color: var(--text-main);
        font-size: 1.25rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s ease;
        line-height: 1;
        padding: 0;
    }

    .teacher-hamburger-btn:hover,
    .teacher-hamburger-btn.active,
    .admin-hamburger-btn:hover,
    .admin-hamburger-btn.active {
        background: var(--primary-color);
        color: #ffffff;
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    }

    /* Backdrop Overlay */
    .teacher-drawer-overlay,
    .admin-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 10008;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .teacher-drawer-overlay.open,
    .admin-drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Off-Canvas Sidebar Drawer from Right Side */
    .teacher-mobile-drawer,
    .admin-mobile-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 290px;
        max-width: 82vw;
        background: var(--bg-card);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-left: 1px solid var(--border-color);
        box-shadow: -8px 0 35px rgba(0, 0, 0, 0.25);
        z-index: 10009;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.25rem 1rem;
        overflow-y: auto;
    }

    [dir="ltr"] .teacher-mobile-drawer,
    [dir="ltr"] .admin-mobile-drawer {
        right: auto;
        left: 0;
        border-left: none;
        border-right: 1px solid var(--border-color);
        transform: translateX(-100%);
        box-shadow: 8px 0 35px rgba(0, 0, 0, 0.25);
    }

    .teacher-mobile-drawer.open,
    .admin-mobile-drawer.open {
        transform: translateX(0);
    }

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

    .drawer-brand {
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

    .teacher-drawer-close-btn,
    .admin-drawer-close-btn {
        background: rgba(239, 68, 68, 0.1);
        border: none;
        color: #ef4444;
        font-size: 1.4rem;
        width: 32px;
        height: 32px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        line-height: 1;
        transition: all 0.2s ease;
    }

    .teacher-drawer-close-btn:hover,
    .admin-drawer-close-btn:hover {
        background: #ef4444;
        color: #ffffff;
    }

    .teacher-drawer-user-info,
    .admin-drawer-user-info {
        background: rgba(2, 132, 199, 0.08);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 0.65rem 0.85rem;
        margin-bottom: 1rem;
    }

    .teacher-drawer-links,
    .admin-drawer-links {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .teacher-drawer-link,
    .admin-drawer-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 700;
        font-size: 0.9rem;
        transition: all 0.2s ease;
    }

    .teacher-drawer-link:hover,
    .admin-drawer-link:hover {
        color: var(--primary-color);
        background: rgba(2, 132, 199, 0.08);
    }

    .teacher-drawer-link.active,
    .admin-drawer-link.active {
        color: var(--primary-color);
        background: rgba(2, 132, 199, 0.14);
        font-weight: 800;
    }

    .teacher-drawer-link.danger,
    .admin-drawer-link.danger {
        color: #ef4444;
        margin-top: 0.25rem;
    }

    .teacher-drawer-link.danger:hover,
    .admin-drawer-link.danger:hover {
        background: rgba(239, 68, 68, 0.1);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 700;
        transition: all 0.2s ease;
        padding: 0.2rem 0.5rem;
        border-radius: 10px;
    }

    .bottom-nav-icon {
        font-size: 1.25rem;
        transition: transform 0.2s ease;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
        font-weight: 800;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: translateY(-2px);
    }

    body:has(.student-bottom-navbar) {
        padding-bottom: 75px !important;
    }

    .student-appbar-nav {
        display: none !important;
    }

    .student-appbar {
        padding: 0.6rem 0.85rem !important;
        gap: 0.5rem !important;
    }

    .student-appbar-user-badge {
        display: none !important;
    }

    .show-on-mobile-inline {
        display: inline !important;
    }

    .hide-on-mobile {
        display: none !important;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .protected-content-container {
        grid-column: span 1 !important;
    }

    /* Floating AI Chat Bubble Mobile Placement & Size */
    #ai-floating-widget {
        bottom: 85px !important;
        left: 15px !important;
    }

    #ai-chat-bubble {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
    }

    #ai-chat-window {
        bottom: 60px !important;
        left: 0 !important;
        width: calc(100vw - 30px) !important;
        max-width: 340px !important;
        height: 420px !important;
    }

    /* Mobile Progress & Table Adjustments */
    .student-hero-banner {
        padding: 1.25rem 1.25rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .student-hero-content h2 {
        font-size: 1.25rem !important;
    }

    .progress-course-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }

    .progress-bar-wrapper {
        width: 100% !important;
    }

    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
    }

    .table-responsive table {
        min-width: 580px !important;
    }
}