:root {
    --bg-main: #07111f;
    --bg-panel: rgba(15, 23, 42, 0.86);
    --bg-panel-soft: rgba(30, 41, 59, 0.72);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-strong: rgba(255, 255, 255, 0.12);

    --text-main: #f8fafc;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;

    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --primary-soft: rgba(56, 189, 248, 0.18);

    --secondary: #a78bfa;
    --secondary-soft: rgba(167, 139, 250, 0.18);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.16);

    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.16);

    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.16);

    --border-soft: rgba(255, 255, 255, 0.14);
    --shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.38);
    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.28);

    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-ar: Tahoma, Arial, sans-serif;
}

/* ============================================================
   Global
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-main);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.26), transparent 34%),
        radial-gradient(circle at 90% 12%, rgba(167, 139, 250, 0.25), transparent 32%),
        radial-gradient(circle at 55% 100%, rgba(34, 197, 94, 0.12), transparent 32%),
        var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

body.rtl {
    font-family: var(--font-ar);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-main);
    padding: 13px 14px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
    background: rgba(15, 23, 42, 0.95);
}

textarea {
    resize: vertical;
}

label {
    display: block;
    color: var(--text-soft);
    font-weight: 700;
    margin-bottom: 8px;
}

hr.soft-divider {
    border: none;
    height: 1px;
    background: var(--border-soft);
    margin: 26px 0;
}

.hidden {
    display: none !important;
}

/* ============================================================
   Background Orbs
   ============================================================ */

.app-background-orb {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.28;
    z-index: -1;
    pointer-events: none;
    animation: floatOrb 12s ease-in-out infinite alternate;
}

.orb-one {
    top: 10%;
    left: -100px;
    background: var(--primary);
}

.orb-two {
    top: 8%;
    right: -120px;
    background: var(--secondary);
    animation-delay: 2s;
}

.orb-three {
    bottom: -130px;
    left: 35%;
    background: var(--success);
    animation-delay: 4s;
}

@keyframes floatOrb {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(30px, -24px, 0) scale(1.12);
    }
}

/* ============================================================
   Layout
   ============================================================ */

.page-shell {
    width: min(1420px, calc(100% - 36px));
    margin: 0 auto;
    padding: 32px 0 70px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px min(34px, 4vw);
    background: rgba(7, 17, 31, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-soft);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark,
.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #00111d;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 16px 40px rgba(56, 189, 248, 0.28);
}

.brand-name {
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-name-ar {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link,
.language-select {
    padding: 10px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-soft);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s ease;
}

.language-select {
    cursor: pointer;
}

.nav-link:hover,
.language-select:hover {
    color: var(--text-main);
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.10);
}

.nav-logout {
    color: #fecaca;
}

.language-form {
    margin: 0;
}

.footer {
    width: min(1420px, calc(100% - 36px));
    margin: 0 auto 28px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--border-soft);
    padding-top: 22px;
    font-size: 14px;
}

.footer-note {
    color: var(--primary);
    font-weight: 800;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #00111d;
    background: linear-gradient(135deg, var(--primary), #67e8f9);
    box-shadow: 0 16px 34px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
    box-shadow: 0 20px 44px rgba(56, 189, 248, 0.32);
}

.btn-secondary {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--border-soft);
}

.btn-ghost {
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--border-soft);
}

.btn-danger {
    color: #fecaca;
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 9px 12px;
    font-size: 13px;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-weight: 800;
    border: 1px solid var(--border-soft);
}

.alert-error {
    background: var(--danger-soft);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.30);
}

.alert-success {
    background: var(--success-soft);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.30);
}

/* ============================================================
   Login Page
   ============================================================ */

.auth-page {
    min-height: calc(100vh - 170px);
    display: grid;
    grid-template-columns: 1.18fr 0.82fr;
    align-items: center;
    gap: 34px;
    padding: 28px 0;
}

.auth-hero h1 {
    font-size: clamp(42px, 6vw, 78px);
    line-height: 0.95;
    margin: 18px 0 18px;
    letter-spacing: -0.07em;
}

.auth-hero h1 span {
    display: block;
    font-size: clamp(26px, 3vw, 40px);
    color: var(--primary);
    margin-top: 14px;
    letter-spacing: -0.03em;
}

.auth-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    background: var(--success);
    border-radius: 999px;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.8);
    animation: pulseDot 1.7s infinite;
}

@keyframes pulseDot {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.auth-slogan,
.auth-slogan-ar {
    max-width: 720px;
    font-size: 20px;
    color: var(--text-soft);
    line-height: 1.65;
}

.auth-slogan-ar {
    color: #bae6fd;
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(18px);
}

.auth-card-header {
    margin-bottom: 24px;
}

.auth-card-header h2 {
    font-size: 32px;
    margin: 16px 0 8px;
    letter-spacing: -0.04em;
}

.auth-card-header p,
.auth-security-note {
    color: var(--text-muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-security-note {
    margin-top: 18px;
    font-size: 13px;
}

.auth-visual-card {
    max-width: 780px;
    margin-top: 28px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.mini-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.mini-node {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    font-weight: 900;
    font-size: 12px;
}

.mini-node.active {
    background: var(--primary);
    color: #00111d;
}

.mini-line {
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.auth-ai-board {
    min-height: 260px;
    display: grid;
    grid-template-columns: 0.9fr 1.4fr 0.9fr;
    gap: 18px;
}

.ai-board-left,
.ai-board-middle,
.ai-board-right {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
    padding: 18px;
}

.pixel-grid-demo {
    display: grid;
    grid-template-columns: repeat(8, 13px);
    gap: 5px;
}

.pixel-grid-demo span {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.16);
    animation: pixelBlink 2.5s ease-in-out infinite;
}

.pixel-grid-demo span:nth-child(3n) {
    animation-delay: 0.3s;
}

.pixel-grid-demo span:nth-child(4n) {
    animation-delay: 0.7s;
}

.pixel-grid-demo span:nth-child(7n) {
    animation-delay: 1.1s;
}

@keyframes pixelBlink {
    0%, 100% {
        background: rgba(56, 189, 248, 0.10);
        transform: scale(1);
    }
    50% {
        background: rgba(56, 189, 248, 0.75);
        transform: scale(1.08);
    }
}

.network-demo {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
}

.network-demo::before {
    content: "";
    position: absolute;
    inset: 50% 12%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    animation: signalMove 2.2s linear infinite;
}

.network-layer {
    display: grid;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.network-layer span {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid rgba(56, 189, 248, 0.55);
}

@keyframes signalMove {
    0% {
        opacity: 0.25;
        transform: scaleX(0.4);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
    100% {
        opacity: 0.25;
        transform: scaleX(0.4);
    }
}

.prob-demo {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.prob-demo div {
    width: 34px;
    height: 160px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.prob-demo span {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 999px;
    animation: barRise 2.4s ease-in-out infinite alternate;
}

@keyframes barRise {
    from {
        filter: brightness(0.8);
    }
    to {
        filter: brightness(1.4);
    }
}

.auth-visual-caption {
    color: var(--text-muted);
    margin-top: 14px;
    font-weight: 700;
}

/* ============================================================
   Dashboard
   ============================================================ */

.dashboard-hero,
.lab-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.85fr;
    gap: 26px;
    align-items: stretch;
    margin-bottom: 26px;
}

.dashboard-hero > div:first-child,
.lab-hero-left,
.lab-hero-right,
.dashboard-stats,
.honesty-banner,
.level-section,
.future-card,
.lab-section,
.settings-card,
.practice-card,
.lab-tool-card,
.chart-card,
.result-explanation-card,
.examples-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
}

.dashboard-hero > div:first-child,
.lab-hero-left {
    padding: 34px;
}

.dashboard-hero h1,
.lab-hero h1,
.page-title-block h1,
.error-card h1 {
    font-size: clamp(34px, 4.2vw, 60px);
    line-height: 1;
    margin: 18px 0;
    letter-spacing: -0.06em;
}

.dashboard-hero p,
.lab-hero p,
.page-title-block p,
.level-header p,
.future-card p {
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 17px;
}

.dashboard-stats {
    padding: 24px;
    display: grid;
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.stat-card span {
    font-size: 36px;
    font-weight: 950;
    color: var(--primary);
}

.stat-card p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-weight: 800;
}

.honesty-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    margin-bottom: 26px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(56, 189, 248, 0.10));
}

.honesty-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--success);
    color: #00130a;
    font-weight: 950;
    font-size: 24px;
}

.honesty-banner strong {
    display: block;
    font-size: 17px;
}

.honesty-banner p {
    margin: 5px 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.level-section {
    padding: 28px;
    margin-bottom: 26px;
}

.level-header {
    margin-bottom: 22px;
}

.level-header h2 {
    margin: 12px 0 6px;
    font-size: 34px;
    letter-spacing: -0.04em;
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.lab-card {
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: transform 0.18s ease, border 0.18s ease, background 0.18s ease;
}

.lab-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(255, 255, 255, 0.10);
}

.lab-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lab-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background: var(--primary-soft);
    font-size: 28px;
}

.lab-level-pill {
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
    font-size: 12px;
}

.lab-card h3 {
    font-size: 25px;
    margin: 20px 0 10px;
    letter-spacing: -0.04em;
}

.lab-description {
    color: var(--text-soft);
    line-height: 1.65;
}

.lab-story {
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 18px 0;
}

.lab-story span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lab-story p {
    color: var(--text-soft);
    line-height: 1.5;
    margin: 8px 0 0;
}

.lab-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.lab-capabilities span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
}

.future-section {
    margin-top: 26px;
}

.future-card {
    padding: 30px;
}

/* ============================================================
   Settings
   ============================================================ */

.page-title-block {
    margin-bottom: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.settings-card {
    padding: 26px;
}

.settings-card-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.settings-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: var(--primary-soft);
    display: grid;
    place-items: center;
    font-size: 25px;
}

.settings-card h2 {
    margin: 0 0 6px;
    font-size: 25px;
    letter-spacing: -0.04em;
}

.settings-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.settings-form {
    display: grid;
    gap: 14px;
}

.security-card {
    margin-top: 22px;
}

.security-list {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.8;
}

/* ============================================================
   Lab Page
   ============================================================ */

.lab-hero-right {
    padding: 24px;
}

.lab-story-banner {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.20);
    color: var(--text-soft);
    line-height: 1.6;
}

.lab-story-banner strong {
    color: var(--primary);
}

.lab-cycle-card {
    display: grid;
    gap: 11px;
}

.cycle-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
}

.cycle-step span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    font-weight: 950;
}

.cycle-step p {
    margin: 0;
    color: var(--text-soft);
    font-weight: 800;
}

.cycle-step.active {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.13);
}

.cycle-step.active span {
    background: var(--primary);
    color: #00111d;
}

.lab-section {
    padding: 28px;
    margin-bottom: 26px;
}

.lab-section-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.lab-section-header h2 {
    margin: 12px 0 8px;
    font-size: 34px;
    letter-spacing: -0.05em;
}

.lab-section-header p {
    color: var(--text-soft);
    line-height: 1.65;
    margin: 0;
}

.watch-layout {
    display: grid;
    grid-template-columns: 1.45fr 0.55fr;
    gap: 20px;
}

.watch-main-card,
.watch-explanation-card {
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.watch-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.watch-label {
    color: var(--primary);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.watch-title-group h3 {
    margin: 7px 0 0;
    font-size: 24px;
    letter-spacing: -0.04em;
}

.watch-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.watch-animation-root {
    min-height: 520px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.72)),
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.18), transparent 34%);
    border: 1px solid var(--border-soft);
}

.watch-loading {
    height: 520px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-weight: 800;
}

.watch-side-block {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid var(--border-soft);
    margin-bottom: 14px;
}

.watch-side-block h4 {
    margin: 0 0 8px;
    color: var(--primary);
}

.watch-side-block p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.practice-grid,
.improve-reflect-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.practice-card,
.lab-tool-card {
    padding: 24px;
}

.practice-card h3,
.lab-tool-card h3 {
    margin-top: 0;
    font-size: 24px;
    letter-spacing: -0.04em;
}

.feature-list {
    margin: 0;
    padding-left: 22px;
    color: var(--text-soft);
    line-height: 1.85;
}

.rtl .feature-list {
    padding-left: 0;
    padding-right: 22px;
}

.tool-card-header {
    margin-bottom: 18px;
}

.tool-card-header p {
    color: var(--text-soft);
    line-height: 1.6;
    margin: 8px 0 0;
}

.form-row {
    margin-bottom: 16px;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form input {
    flex: 1;
}

.image-classes-area {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}

.image-class-box {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
}

.image-class-box h4 {
    margin: 0 0 12px;
    color: var(--primary);
}

.dataset-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.dataset-choice label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    padding: 11px 13px;
    border-radius: 999px;
    cursor: pointer;
}

.dataset-choice input {
    width: auto;
}

.download-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    font-weight: 900;
}

.token-output,
.gpt-concept-output {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.token-pill,
.gpt-pill {
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #dff7ff;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-weight: 900;
}

.training-status {
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.25);
    margin-bottom: 18px;
    font-weight: 900;
}

.results-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.20);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.045);
    padding: 28px;
}

.empty-icon {
    font-size: 52px;
}

.results-empty h3 {
    font-size: 26px;
    margin: 12px 0 4px;
}

.results-empty p {
    color: var(--text-soft);
    margin: 0;
}

.results-area {
    display: grid;
    gap: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
}

.metric-card span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    color: var(--primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card,
.result-explanation-card,
.examples-card {
    padding: 22px;
}

.chart-card h3,
.result-explanation-card h3,
.examples-card h3 {
    margin-top: 0;
    font-size: 22px;
}

.confusion-matrix-table {
    border-collapse: collapse;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.confusion-matrix-table th,
.confusion-matrix-table td {
    border: 1px solid var(--border-soft);
    padding: 12px;
    text-align: center;
}

.confusion-matrix-table th {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
}

.confusion-matrix-table td {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 900;
}

.feature-importance-view {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.feature-bar-row {
    display: grid;
    grid-template-columns: 150px 1fr 70px;
    gap: 10px;
    align-items: center;
}

.feature-bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.feature-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.honesty-text {
    color: #bbf7d0;
    font-weight: 800;
}

.download-links-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.example-row {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    margin-bottom: 10px;
    color: var(--text-soft);
}

.example-row strong {
    color: var(--text-main);
}

.example-correct {
    border-color: rgba(34, 197, 94, 0.35);
}

.example-wrong {
    border-color: rgba(239, 68, 68, 0.35);
}

.reflection-list {
    color: var(--text-soft);
    line-height: 1.85;
}

/* ============================================================
   Watch Engine Visual Elements
   These classes are used by static/js/watch_engine.js
   ============================================================ */

.watch-stage {
    position: absolute;
    inset: 0;
    padding: 22px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
}

.watch-progress-line {
    display: grid;
    grid-template-columns: repeat(var(--steps, 6), minmax(0, 1fr));
    gap: 8px;
}

.watch-progress-item {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.watch-progress-item.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.watch-canvas {
    position: relative;
    min-height: 390px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    overflow: hidden;
}

.watch-node {
    position: absolute;
    min-width: 120px;
    min-height: 76px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--text-main);
    font-weight: 950;
    z-index: 5;
}

.watch-node small {
    display: block;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 700;
}

.watch-node.active {
    border-color: rgba(56, 189, 248, 0.70);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.10), var(--shadow-card);
}

.watch-arrow {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform-origin: left center;
    border-radius: 999px;
    opacity: 0.85;
    z-index: 3;
}

.watch-arrow::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 3px solid var(--secondary);
    border-top: 3px solid var(--secondary);
    transform: translateY(-50%) rotate(45deg);
}

.data-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.95);
    z-index: 10;
    animation: dotPulse 1.2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.22);
        filter: brightness(1.35);
    }
}

.pixel-board {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(8, 18px);
    gap: 5px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border-soft);
}

.pixel-cell {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(56, 189, 248, 0.12);
    display: grid;
    place-items: center;
    font-size: 7px;
    color: rgba(255,255,255,0.75);
}

.pixel-cell.hot {
    background: rgba(56, 189, 248, 0.78);
    color: #00111d;
    font-weight: 900;
}

.token-stream {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 420px;
}

.token-stream span {
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--secondary-soft);
    border: 1px solid rgba(167, 139, 250, 0.35);
    font-weight: 900;
}

.prob-bars {
    position: absolute;
    display: flex;
    align-items: flex-end;
    gap: 11px;
    height: 170px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.80);
    border: 1px solid var(--border-soft);
}

.prob-bar {
    width: 38px;
    height: 140px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    position: relative;
}

.prob-bar span {
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.prob-bar label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 11px;
    color: var(--text-soft);
}

.matrix-demo {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(3, 78px);
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border-soft);
}

.matrix-cell {
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-soft);
    font-weight: 950;
}

.matrix-cell.diagonal {
    background: rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
}

.matrix-cell.error {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.tree-vote-board {
    position: absolute;
    display: flex;
    gap: 14px;
}

.tree-card {
    width: 115px;
    min-height: 130px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid var(--border-soft);
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 900;
}

.tree-card .tree-symbol {
    font-size: 36px;
}

.neural-board {
    position: absolute;
    width: 440px;
    height: 280px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.80);
    border: 1px solid var(--border-soft);
}

.neural-node {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(56, 189, 248, 0.48);
    z-index: 4;
}

.neural-line {
    position: absolute;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
    transform-origin: left center;
    z-index: 2;
}

.attention-grid {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(5, 44px);
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid var(--border-soft);
}

.attention-cell {
    height: 44px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.10);
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 900;
}

.attention-cell.strong {
    background: rgba(56, 189, 248, 0.55);
    color: #00111d;
}

.vector-box {
    position: absolute;
    padding: 13px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
    font-weight: 850;
    line-height: 1.75;
}

.watch-caption {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
    line-height: 1.6;
    font-weight: 750;
}

/* ============================================================
   Error Page
   ============================================================ */

.error-page {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
}

.error-card {
    text-align: center;
    width: min(620px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 42px;
    box-shadow: var(--shadow-strong);
}

.error-code {
    font-size: 90px;
    line-height: 1;
    font-weight: 950;
    color: var(--primary);
}

.error-card p {
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* ============================================================
   RTL
   ============================================================ */

.rtl .topbar,
.rtl .brand-link,
.rtl .settings-card-header,
.rtl .honesty-banner,
.rtl .cycle-step {
    direction: rtl;
}

.rtl .feature-bar-row {
    grid-template-columns: 70px 1fr 150px;
}

.rtl .watch-arrow::after {
    right: auto;
    left: -1px;
    transform: translateY(-50%) rotate(-135deg);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
    .auth-page,
    .dashboard-hero,
    .lab-hero,
    .watch-layout,
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-ai-board {
        grid-template-columns: 1fr;
    }

    .watch-topline {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 800px) {
    .topbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .topbar-nav {
        flex-wrap: wrap;
    }

    .page-shell {
        width: min(100% - 24px, 1420px);
        padding-top: 18px;
    }

    .lab-grid,
    .settings-grid,
    .practice-grid,
    .improve-reflect-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
    }

    .auth-page {
        padding-top: 8px;
    }

    .auth-card,
    .dashboard-hero > div:first-child,
    .lab-hero-left,
    .lab-section,
    .level-section,
    .settings-card {
        padding: 20px;
    }

    .inline-form {
        flex-direction: column;
    }

    .watch-animation-root {
        min-height: 620px;
    }

    .watch-loading {
        height: 620px;
    }
}
/* ============================================================
   Level selection and teacher assignment
   ============================================================ */

.level-selector-section,
.teacher-assignment-section {
    margin-bottom: 26px;
}

.level-selector-card,
.assignment-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    padding: 28px;
}

.level-selector-header,
.assignment-header {
    margin-bottom: 20px;
}

.level-selector-header h2,
.assignment-header h2 {
    font-size: 34px;
    margin: 14px 0 8px;
    letter-spacing: -0.05em;
}

.level-selector-header p,
.assignment-header p {
    color: var(--text-soft);
    line-height: 1.65;
}

.level-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.level-tab {
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 950;
    cursor: pointer;
    transition: 0.2s ease;
}

.level-tab:hover,
.level-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #00111d;
    border-color: transparent;
    transform: translateY(-1px);
}

.assignment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.assignment-level-box {
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.assignment-level-box h3 {
    margin: 0 0 8px;
    font-size: 24px;
}

.assignment-level-box p {
    color: var(--text-muted);
    line-height: 1.55;
}

.assignment-checklist {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.assignment-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 11px;
    cursor: pointer;
    margin: 0;
}

.assignment-checklist input {
    width: auto;
}

.assignment-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.assignment-note {
    margin-top: 14px;
    color: var(--text-muted);
    font-weight: 800;
}

.assignment-note-success {
    color: #bbf7d0;
}

/* ============================================================
   Improved image upload lab
   ============================================================ */

.image-lab-notice {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #bae6fd;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 850;
    margin-bottom: 18px;
}

.image-classes-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-class-box {
    background: rgba(15, 23, 42, 0.80);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.image-class-box-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.image-class-box-header h4 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--primary);
}

.image-class-box-header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.image-preview-grid img {
    width: 100%;
    height: 92px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   Movie-style watch additions
   ============================================================ */

.movie-animation-root {
    min-height: 620px;
    background:
        radial-gradient(circle at 18% 22%, rgba(56, 189, 248, 0.24), transparent 32%),
        radial-gradient(circle at 78% 28%, rgba(167, 139, 250, 0.22), transparent 34%),
        linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.88));
}

.movie-watch-card {
    position: relative;
    overflow: hidden;
}

.movie-watch-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transform: translateX(-100%);
    animation: movieSweep 5s linear infinite;
    pointer-events: none;
}

@keyframes movieSweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 1000px) {
    .assignment-grid,
    .image-classes-area {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   Upload / Prepare Data Panel
   ============================================================ */

.data-prep-panel {
    margin: 18px 0 22px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.data-prep-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.data-prep-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.data-prep-header p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.data-prep-status {
    min-width: 230px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-soft);
    font-weight: 900;
    text-align: center;
}

.data-prep-status.success {
    background: rgba(34,197,94,0.18);
    color: #bbf7d0;
}

.data-prep-status.error {
    background: rgba(239,68,68,0.18);
    color: #fecaca;
}

.data-prep-status.working {
    background: rgba(245,158,11,0.18);
    color: #fde68a;
}

/* ============================================================
   Cinematic Live Training Overlay
   ============================================================ */

.training-movie-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(16px);
    display: grid;
    place-items: center;
}

.training-movie-overlay.hidden {
    display: none;
}

.training-movie-card {
    position: relative;
    width: min(960px, calc(100% - 32px));
    min-height: 560px;
    overflow: hidden;
    border-radius: 34px;
    background:
        radial-gradient(circle at 20% 20%, rgba(56,189,248,0.25), transparent 34%),
        radial-gradient(circle at 80% 30%, rgba(167,139,250,0.25), transparent 36%),
        linear-gradient(135deg, #020617, #0f172a);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 35px 120px rgba(0,0,0,0.65);
    padding: 34px;
}

.training-movie-bg {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 34px 34px;
    animation: trainingStarMove 16s linear infinite;
}

@keyframes trainingStarMove {
    from {
        transform: translate3d(0,0,0);
    }
    to {
        transform: translate3d(120px,90px,0);
    }
}

.training-movie-card::before {
    content: "";
    position: absolute;
    top: -30%;
    left: -60%;
    width: 70%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(56,189,248,0.13), transparent);
    transform: rotate(20deg);
    animation: trainingSweep 4.5s ease-in-out infinite;
}

@keyframes trainingSweep {
    0% {
        left: -70%;
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        left: 120%;
        opacity: 0;
    }
}

.training-movie-header {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(34,197,94,0.18);
    border: 1px solid rgba(34,197,94,0.32);
    color: #bbf7d0;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
}

.training-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 rgba(34,197,94,0.7);
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(34,197,94,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34,197,94,0);
    }
}

.training-movie-card h2 {
    position: relative;
    z-index: 2;
    font-size: 42px;
    margin: 22px 0 30px;
    letter-spacing: -0.05em;
}

.training-movie-stage {
    position: relative;
    z-index: 2;
    min-height: 240px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.1fr 1fr 1fr;
    gap: 18px;
    align-items: center;
}

.training-data-block {
    height: 120px;
    border-radius: 26px;
    background: rgba(15,23,42,0.78);
    border: 1px solid rgba(255,255,255,0.16);
    display: grid;
    place-items: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.40);
}

.training-data-block span {
    color: var(--primary);
    font-size: 22px;
    font-weight: 950;
}

.training-flow {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.training-flow span {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(56,189,248,0.8);
    animation: trainingFlow 1.3s ease-in-out infinite;
}

.training-flow span:nth-child(2) { animation-delay: 0.15s; }
.training-flow span:nth-child(3) { animation-delay: 0.30s; }
.training-flow span:nth-child(4) { animation-delay: 0.45s; }
.training-flow span:nth-child(5) { animation-delay: 0.60s; }

@keyframes trainingFlow {
    0%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.55;
    }
    50% {
        transform: translateY(-16px) scale(1.25);
        opacity: 1;
    }
}

.training-model-core {
    position: relative;
    height: 210px;
    display: grid;
    place-items: center;
}

.core-ring {
    position: absolute;
    border-radius: 999px;
    border: 2px solid rgba(56,189,248,0.38);
}

.ring-one {
    width: 190px;
    height: 190px;
    animation: coreSpin 6s linear infinite;
}

.ring-two {
    width: 135px;
    height: 135px;
    border-color: rgba(167,139,250,0.50);
    animation: coreSpinReverse 4s linear infinite;
}

.core-center {
    width: 88px;
    height: 88px;
    border-radius: 30px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #00111d;
    font-size: 28px;
    font-weight: 950;
    box-shadow: 0 0 45px rgba(56,189,248,0.42);
}

@keyframes coreSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes coreSpinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.training-steps {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 26px;
}

.training-step {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    text-align: center;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,0.12);
}

.training-step.active {
    background: rgba(56,189,248,0.18);
    color: #bae6fd;
    border-color: rgba(56,189,248,0.36);
    box-shadow: 0 0 24px rgba(56,189,248,0.15);
}

.training-progress-track {
    position: relative;
    z-index: 2;
    height: 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    margin-top: 24px;
    overflow: hidden;
}

.training-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--success));
    transition: width 0.5s ease;
}

.training-honesty {
    position: relative;
    z-index: 2;
    margin: 18px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
    font-weight: 800;
}

/* ============================================================
   Testing Panel
   ============================================================ */

.model-testing-panel,
.test-result-card {
    background: rgba(255,255,255,0.075);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.model-testing-panel h3 {
    margin-top: 0;
    font-size: 26px;
}

.model-testing-panel p {
    color: var(--text-soft);
    line-height: 1.6;
}

.test-output {
    margin-top: 18px;
}

.test-result-card h4 {
    margin: 0 0 14px;
    font-size: 21px;
}

.test-result-card h4 span {
    color: var(--primary);
}

@media (max-width: 900px) {
    .data-prep-header {
        flex-direction: column;
    }

    .data-prep-status {
        width: 100%;
    }

    .training-movie-stage {
        grid-template-columns: 1fr;
    }

    .training-steps {
        grid-template-columns: 1fr;
    }

    .training-movie-card {
        min-height: auto;
    }
}
/* ============================================================
   Stronger continuous cinematic training movie
   Works with the existing training overlay in lab_engine.js
   ============================================================ */

.training-movie-stage {
    position: relative !important;
    overflow: hidden !important;
}

.training-movie-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(56,189,248,.20), transparent 30%),
        radial-gradient(circle at 75% 35%, rgba(167,139,250,.18), transparent 34%);
    animation: trainingScenePulse 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes trainingScenePulse {
    0%,100% {
        opacity: .55;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

.training-data-block {
    position: relative !important;
    overflow: hidden !important;
}

.training-data-block::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(56,189,248,.10), rgba(56,189,248,.35), rgba(167,139,250,.10));
    transform: translateX(-120%);
    animation: trainingDataScan 2.4s linear infinite;
}

@keyframes trainingDataScan {
    from {
        transform: translateX(-120%);
    }
    to {
        transform: translateX(120%);
    }
}

.training-flow span {
    animation: trainingFlowMove 1.2s ease-in-out infinite !important;
}

@keyframes trainingFlowMove {
    0% {
        transform: translateX(-18px) scale(.65);
        opacity: .35;
    }
    50% {
        transform: translateX(0) scale(1.25);
        opacity: 1;
    }
    100% {
        transform: translateX(18px) scale(.65);
        opacity: .35;
    }
}

.training-model-core {
    filter: drop-shadow(0 0 28px rgba(56,189,248,.35));
}

.core-center {
    animation: coreLearningPulse 1.5s ease-in-out infinite !important;
}

@keyframes coreLearningPulse {
    0%,100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.12);
        filter: brightness(1.35);
    }
}

.core-ring {
    box-shadow:
        0 0 22px rgba(56,189,248,.25),
        inset 0 0 22px rgba(167,139,250,.12);
}

.training-step.active {
    animation: trainingStepGlow 1.4s ease-in-out infinite;
}

@keyframes trainingStepGlow {
    0%,100% {
        box-shadow: 0 0 16px rgba(56,189,248,.16);
    }
    50% {
        box-shadow: 0 0 34px rgba(56,189,248,.40);
    }
}

.training-progress-fill {
    background-size: 200% 100% !important;
    animation: trainingProgressMove 1.5s linear infinite !important;
}

@keyframes trainingProgressMove {
    from {
        background-position: 0% 0%;
    }
    to {
        background-position: 200% 0%;
    }
}/* ============================================================
   Role-aware top context bar
   ============================================================ */

.user-context-bar {
    width: min(1420px, calc(100% - 36px));
    margin: 18px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-soft);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
}

.user-context-left,
.user-context-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.user-role-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #00111d;
    font-weight: 950;
    font-size: 13px;
}

.user-context-name {
    color: var(--text-main);
    font-weight: 900;
}

.user-context-email {
    color: var(--text-muted);
    font-size: 14px;
}

.user-context-right span {
    color: var(--text-soft);
    font-size: 14px;
}

.user-context-right strong {
    color: var(--primary);
}

@media (max-width: 900px) {
    .user-context-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
/* ============================================================
   Admin dashboard tables and cards
   ============================================================ */

.admin-grid-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 26px;
}

.admin-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    padding: 26px;
}

.admin-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-card-header h2 {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.admin-card-header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.responsive-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.72);
}

.admin-table th,
.admin-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.rtl .admin-table th,
.rtl .admin-table td {
    text-align: right;
}

.admin-table th {
    color: var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(56, 189, 248, 0.08);
}

.admin-table td {
    color: var(--text-soft);
}

.admin-table td strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 4px;
}

.admin-table td small {
    display: block;
    color: var(--text-muted);
    line-height: 1.4;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
}

.status-pill.success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.status-pill.danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
}

.activity-item strong {
    color: var(--text-main);
}

.activity-item p {
    margin: 5px 0 0;
    color: var(--text-muted);
}

.activity-item span {
    color: var(--primary);
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .admin-grid-section {
        grid-template-columns: 1fr;
    }

    .activity-item {
        flex-direction: column;
    }
}
/* ============================================================
   School admin assignment forms
   ============================================================ */

.assignment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.assignment-submit-row {
    margin-bottom: 0;
}

.inline-level-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.inline-level-form select {
    min-width: 150px;
}

@media (max-width: 1000px) {
    .assignment-form-grid {
        grid-template-columns: 1fr;
    }

    .inline-level-form {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   Teacher dashboard student cards and timeline
   ============================================================ */

.student-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.student-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: 0.2s ease;
}

.student-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.36);
    background: rgba(255, 255, 255, 0.10);
}

.student-avatar {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #00111d;
    font-weight: 950;
    font-size: 22px;
}

.student-card-body h3 {
    margin: 0 0 5px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.student-card-body p {
    margin: 0;
    color: var(--text-muted);
}

.student-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13px;
}

.student-card-meta strong {
    color: var(--primary);
}

.student-card-action {
    color: var(--primary);
    font-weight: 950;
    white-space: nowrap;
}

.activity-timeline {
    position: relative;
    display: grid;
    gap: 18px;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 14px;
}

.timeline-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin-top: 18px;
    background: var(--primary);
    box-shadow: 0 0 0 7px rgba(56, 189, 248, 0.12);
}

.timeline-content {
    padding: 18px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--text-muted);
    font-size: 13px;
}

.timeline-header strong {
    color: var(--primary);
}

.timeline-content h3 {
    margin: 10px 0 8px;
    font-size: 22px;
}

.timeline-content p {
    color: var(--text-soft);
    line-height: 1.6;
}

.activity-details {
    margin-top: 12px;
}

.activity-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 900;
}

.activity-details pre {
    white-space: pre-wrap;
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--text-soft);
    overflow-x: auto;
}

@media (max-width: 1000px) {
    .student-card-grid {
        grid-template-columns: 1fr;
    }

    .student-card {
        grid-template-columns: 1fr;
    }

    .student-card-action {
        white-space: normal;
    }

    .timeline-header {
        flex-direction: column;
    }
}
/* ============================================================
   Student performance page
   ============================================================ */

.student-profile-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.student-profile-line span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    border: 1px solid var(--border-soft);
    font-weight: 850;
    font-size: 13px;
}

.performance-actions-section {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 22px;
    margin-bottom: 26px;
}

.performance-action-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    padding: 24px;
}

.performance-action-card h2 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.performance-action-card p {
    color: var(--text-soft);
    line-height: 1.6;
}

.share-box {
    display: grid;
    gap: 12px;
}

.share-user-results {
    display: grid;
    gap: 8px;
}

.share-user-item {
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.075);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

.rtl .share-user-item {
    text-align: right;
}

.share-user-item:hover {
    border-color: rgba(56, 189, 248, 0.40);
    background: rgba(56, 189, 248, 0.12);
}

.share-user-item strong {
    display: block;
    margin-bottom: 4px;
}

.share-user-item span {
    color: var(--text-muted);
    font-size: 13px;
}

.share-user-loading,
.share-user-empty,
.share-user-error {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.06);
}

.share-user-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.16);
}

.share-status {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-weight: 850;
    min-height: 40px;
}

.share-status.success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.share-status.error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.share-status.working {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.30);
}

.mini-result-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 18px;
    margin-top: 14px;
}

.mini-result-grid h4 {
    margin: 0 0 10px;
    color: var(--primary);
}

.mini-result-grid pre {
    white-space: pre-wrap;
    overflow-x: auto;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
}

.mini-matrix-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 260px;
}

.mini-matrix-table td {
    width: 60px;
    height: 46px;
    text-align: center;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.075);
    color: var(--text-main);
    font-weight: 950;
}

@media (max-width: 1000px) {
    .performance-actions-section,
    .mini-result-grid {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   Printable student report
   ============================================================ */

.print-report-page {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.print-report-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.print-report-document {
    background: #ffffff;
    color: #111827;
    border-radius: 24px;
    padding: 42px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.print-report-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    border-bottom: 3px solid #0f172a;
    padding-bottom: 22px;
    margin-bottom: 28px;
}

.print-report-header h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.print-report-header p {
    margin: 6px 0 0;
    color: #334155;
    font-weight: 700;
}

.print-report-badge {
    padding: 12px 16px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 900;
    border: 1px solid #bae6fd;
}

.print-report-section {
    margin-bottom: 30px;
    break-inside: avoid;
}

.print-report-section h2 {
    font-size: 22px;
    color: #0f172a;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
    margin: 0 0 16px;
}

.print-info-table,
.print-results-table,
.print-activity-table {
    width: 100%;
    border-collapse: collapse;
}

.print-info-table th,
.print-info-table td,
.print-results-table th,
.print-results-table td,
.print-activity-table th,
.print-activity-table td {
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.rtl .print-info-table th,
.rtl .print-info-table td,
.rtl .print-results-table th,
.rtl .print-results-table td,
.rtl .print-activity-table th,
.rtl .print-activity-table td {
    text-align: right;
}

.print-info-table th,
.print-results-table th,
.print-activity-table th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 900;
}

.print-info-table td,
.print-results-table td,
.print-activity-table td {
    color: #1f2937;
}

.print-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.print-summary-card {
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    padding: 18px;
}

.print-summary-card strong {
    display: block;
    color: #0284c7;
    font-size: 28px;
    margin-bottom: 6px;
}

.print-summary-card span {
    color: #334155;
    font-weight: 800;
}

.print-empty-text {
    color: #475569;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 16px;
}

.print-note {
    color: #334155;
    background: #f8fafc;
    border-left: 4px solid #0284c7;
    padding: 14px 16px;
    line-height: 1.7;
}

.rtl .print-note {
    border-left: none;
    border-right: 4px solid #0284c7;
}

.print-report-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 2px solid #0f172a;
    padding-top: 18px;
    color: #334155;
    margin-top: 34px;
}

.print-report-footer strong {
    display: block;
    color: #0f172a;
}

@media print {
    body {
        background: #ffffff !important;
        color: #111827 !important;
    }

    .topbar,
    .user-context-bar,
    .footer,
    .no-print,
    .app-background-orb {
        display: none !important;
    }

    .page-shell {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-report-document {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .print-report-page {
        width: 100% !important;
    }

    .print-report-section {
        page-break-inside: avoid;
    }
}

@media (max-width: 900px) {
    .print-report-document {
        padding: 24px;
    }

    .print-report-header,
    .print-report-footer,
    .print-report-toolbar {
        flex-direction: column;
    }

    .print-summary-grid {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   Labs by level page
   ============================================================ */

.level-links .level-tab {
    display: inline-flex;
    text-decoration: none;
}

.lab-cycle-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 16px 0;
}

.lab-cycle-preview span {
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #bae6fd;
    font-weight: 850;
    font-size: 12px;
}

.level-lab-card {
    position: relative;
    overflow: hidden;
}

.level-lab-card::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(56, 189, 248, 0.08),
        transparent
    );
    transform: rotate(18deg) translateX(-70%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

.level-lab-card:hover::before {
    transform: rotate(18deg) translateX(70%);
}
/* ============================================================
   Updated lab workflow panels
   ============================================================ */

.train-action-panel {
    margin-top: 22px;
    padding: 18px;
    border-radius: var(--radius-xl);
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.24);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.train-action-panel h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.train-action-panel p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

@media (max-width: 900px) {
    .train-action-panel {
        flex-direction: column;
        align-items: stretch;
    }
}
.plugin-loader-box,
.plugin-error-box {
    padding: 24px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    font-weight: 900;
    text-align: center;
}

.plugin-loader-box small,
.plugin-error-box small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.plugin-error-box {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.30);
}
/* ============================================================
   School Management V2
   ============================================================ */

.assignment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.assignment-submit-row {
    margin-bottom: 0;
}

.student-profile-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.student-profile-line span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    border: 1px solid var(--border-soft);
    font-weight: 850;
    font-size: 13px;
}

.student-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.student-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: 0.2s ease;
}

.student-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.36);
    background: rgba(255, 255, 255, 0.10);
}

.student-avatar {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #00111d;
    font-weight: 950;
    font-size: 22px;
}

.student-card-body h3 {
    margin: 0 0 5px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.student-card-body p {
    margin: 0;
    color: var(--text-muted);
}

.student-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13px;
}

.student-card-meta strong {
    color: var(--primary);
}

.student-card-action {
    color: var(--primary);
    font-weight: 950;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .assignment-form-grid,
    .student-card-grid {
        grid-template-columns: 1fr;
    }

    .student-card {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Lab catalog quick search
   ========================================================= */
.lab-search-shell {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 20px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}
.lab-search-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.lab-search-head label {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
}
.lab-search-head p {
    margin: 3px 0 0;
    color: #64748b;
    font-weight: 700;
    font-size: .9rem;
}
.lab-search-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 900;
    white-space: nowrap;
}
.lab-search-input-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 6px 8px 6px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    background: #fff;
    transition: .18s ease;
}
.lab-search-input-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
.lab-search-icon { font-size: 1.1rem; }
.lab-search-input {
    width: 100%;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #0f172a;
    font: inherit;
    font-size: 1rem;
    font-weight: 750;
    padding: 8px 0 !important;
}
.lab-search-input::placeholder { color: #94a3b8; font-weight: 650; }
.lab-search-clear {
    min-height: 38px;
    border: 0;
    border-radius: 12px;
    padding: 8px 12px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 900;
    cursor: pointer;
}
.lab-search-clear[hidden] { display: none !important; }
.lab-search-empty {
    margin: 14px 0 20px;
    padding: 20px;
    border-radius: 18px;
    text-align: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 850;
}
.lab-search-empty[hidden], [data-lab-search-item][hidden], [data-lab-search-group][hidden] { display: none !important; }
.lab-search-filtered-out { display: none !important; }
html[dir="rtl"] .lab-search-input-wrap { padding: 6px 14px 6px 8px; }
@media (max-width: 640px) {
    .lab-search-shell { padding: 13px; border-radius: 16px; }
    .lab-search-head { align-items: flex-start; }
    .lab-search-count { font-size: .85rem; }
    .lab-search-input-wrap { grid-template-columns: auto minmax(0, 1fr); }
    .lab-search-clear { grid-column: 1 / -1; width: 100%; }
}
