/* ==========================================================================
   STYLE.CSS  —  Refactored & Debugged
   ──────────────────────────────────────────────────────────────────────────
   Architecture:
     1. CSS Custom Properties (Design Tokens)
     2. Reset & Base
     3. Utility Classes  (buttons, visibility, status, notes)
     4. Layout — Sidebar Shell  (dashboard pages)
     5. Auth Pages  —  Glassmorphism Theme
     6. Evaluation Pages  —  Clean White Theme
     7. Filter & Checkbox Group
     8. Journal Club Summary Page
     9. UG Lab / Student Management Page
    10. Media Queries
   ──────────────────────────────────────────────────────────────────────────
   BUG FIXES vs. original:
     • Fixed undefined --clean-text variable  →  var(--color-text)
     • Added missing .success-text, .clean-input aliases, .score-cell
     • Standardised group-row  →  .eval-table__group-row everywhere
   ========================================================================== */


/* ==========================================================================
   1. CSS CUSTOM PROPERTIES  (DESIGN TOKENS)
   ========================================================================== */

:root {
    /* --- Brand & Semantic Colours --- */
    --color-primary:        #4f46e5;   /* Indigo */
    --color-success:        #10b981;   /* Emerald */
    --color-danger:         #ef4444;   /* Red */
    --color-warning:        #ffc107;   /* Amber */

    /* --- Neutral Palette --- */
    --color-white:          #ffffff;
    --color-bg:             #F8FAFC;
    --color-text:           #1e293b;
    --color-text-muted:     #64748b;
    --color-border:         #e2e8f0;
    --color-border-dark:    #cbd5e1;
    --color-surface:        #f1f5f9;
    --color-surface-dark:   #e2e8f0;

    /* --- Glassmorphism  (Auth pages only) --- */
    --auth-gradient:        linear-gradient(135deg, #7c4cff 0%, #d4a5ff 30%, #a8edea 70%, #e0c3fc 100%);
    --glass-bg:             rgba(255, 255, 255, 0.15);
    --glass-border:         rgba(255, 255, 255, 0.3);
    --glass-text:           #ffffff;
    --glass-text-muted:     rgba(255, 255, 255, 0.9);

    /* --- Border Radii --- */
    --radius-sm:            8px;
    --radius-md:            12px;
    --radius-lg:            20px;
    --radius-pill:          25px;

    /* --- Transitions --- */
    --transition:           0.3s ease;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}


/* ==========================================================================
   3. UTILITY CLASSES
   ========================================================================== */

/* --- Visibility --- */
.hidden { display: none !important; }

/* ── Shared Button Base ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

/* Primary (Indigo) */
.btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 10px 20px;
}
.btn--primary:hover { filter: brightness(1.1); }

/* Success (Green) — full-width form submit */
.btn--success {
    background: var(--color-success);
    color: var(--color-white);
    padding: 12px 24px;
    width: 100%;
    margin-top: 20px;
}
.btn--success:hover { filter: brightness(1.1); }

/* Danger (Red) — destructive actions */
.btn--danger {
    background: var(--color-danger);
    color: var(--color-white);
    padding: 10px 20px;
}
.btn--danger:hover { filter: brightness(1.1); }

/* Secondary (Ghost / Back) */
.btn--secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    padding: 6px 14px;
    font-size: 13px;
}
.btn--secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Pill variant modifier */
.btn--pill { border-radius: var(--radius-pill); }

/* ── Status & Feedback ──────────────────────────────────────────────────── */
.status-message {
    margin-top: 15px;
    font-size: 14px;
}

.blinking-text {
    color: var(--color-primary);
    font-weight: 600;
    animation: blink 1.5s linear infinite;
}

.success-text {
    color: var(--color-success);
    font-weight: 600;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ── Annotation / Note Text ─────────────────────────────────────────────── */
.note {
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.5;
}

.note--muted {
    color: var(--color-text-muted);
    font-style: italic;
}

.note--danger {
    color: var(--color-danger);
    font-weight: 500;
    margin-top: 12px;
}

/* ── Warning Highlight  (shared across eval & summary pages) ────────────── */
.warning-highlight,
select.warning-highlight {
    border: 2px solid var(--color-danger) !important;
    background-color: #fff5f5 !important;
}


/* ==========================================================================
   4. LAYOUT — SIDEBAR SHELL  (Dashboard)
   ========================================================================== */

.layout-body {
    background-color: var(--color-bg);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
    width: 288px;
    background-color: var(--color-white);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all var(--transition);
}

.sidebar__header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar__nav {
    flex: 1;
    padding: 8px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__footer {
    padding: 16px;
    border-top: 1px solid var(--color-surface);
}

/* Mobile hamburger — hidden on desktop */
.sidebar__menu-icon {
    display: none;
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
}

/* ── Navigation Items ───────────────────────────────────────────────────── */
.nav-item {
    padding: 10px 16px;
    color: var(--color-text);           /* FIX: was var(--clean-text) — undefined variable */
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item.active {
    background: var(--color-bg);
    color: var(--color-primary);
    font-weight: 600;
}

/* ── Main Content Area ──────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: rgba(248, 250, 252, 0.5);
    padding: 32px;
}


/* ==========================================================================
   5. AUTH PAGES — GLASSMORPHISM THEME
   ========================================================================== */

body.auth-page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--auth-gradient);
    background-size: cover;
    background-attachment: fixed;
}

/* ── Login Card Container ───────────────────────────────────────────────── */
.login-card {
    display: flex;
    width: 100%;
    max-width: 850px;
    min-height: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ── Glass Panel  (left / form side) ───────────────────────────────────── */
.login-card__glass {
    flex: 1.2;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: clamp(20px, 5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Full-width variant — no right brand panel (Sign Up, Recovery) */
.login-card__glass--full {
    flex: 1;
    border-radius: var(--radius-lg);
}

.login-card__glass h2 {
    color: var(--glass-text);
    font-weight: 500;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
}

/* ── White Brand Panel  (right side) ───────────────────────────────────── */
.login-card__brand {
    flex: 1;
    background: var(--color-white);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.brand-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ── Glass Form Fields ──────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }

.field__label {
    display: block;
    color: var(--glass-text-muted);
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.field__input {
    width: 100%;
    height: 45px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-pill);
    padding: 0 20px;
    color: var(--color-white);
    transition: border var(--transition);
}

.field__input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
}

/* ── Auth Submit Button ─────────────────────────────────────────────────── */
.btn--auth {
    width: 100%;
    height: 45px;
    background: var(--color-white);
    color: var(--color-primary);
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 10px;
    transition: all var(--transition);
}

.btn--auth:hover {
    background: #f1f1f1;
    transform: translateY(-1px);
}

/* ── Auth Feedback Messages ─────────────────────────────────────────────── */
.message-error {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
    min-height: 18px;
}

.message-success {
    color: var(--color-success);
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
    min-height: 18px;
}

/* ── Auth Extras (Remember Me, Links) ───────────────────────────────────── */
.remember-me {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--color-white);
    cursor: pointer;
}

.remember-me label {
    color: var(--glass-text-muted);
    font-size: 13px;
    cursor: pointer;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.forgot-link { margin-bottom: 15px; }

.forgot-link a {
    color: var(--glass-text);
    font-size: 13px;
    text-decoration: none;
    transition: opacity var(--transition);
}
.forgot-link a:hover { opacity: 0.8; }

.signup-text {
    color: var(--glass-text-muted);
    font-size: 13px;
    margin-top: 10px;
}

.signup-text a {
    color: var(--glass-text);
    font-weight: 600;
    text-decoration: none;
    transition: opacity var(--transition);
}
.signup-text a:hover { opacity: 0.8; }

/* ── Registration Specifics ─────────────────────────────────────────────── */
.name-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.name-row .field {
    flex: 1;
    margin-bottom: 0;
}

.hint-text {
    display: block;
    color: var(--glass-text-muted);
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 15px;
    font-style: italic;
}

/* ── Account Recovery  (Multi-step form) ────────────────────────────────── */
#step1,
#step2 {
    transition: opacity var(--transition);
}

#step1.hidden,
#step2.hidden {
    display: none;
}


/* ==========================================================================
   6. EVALUATION PAGES — CLEAN WHITE THEME
   ========================================================================== */

.eval-body {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 40px 20px;
}

/* ── Container ──────────────────────────────────────────────────────────── */
.eval-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--color-white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ── Page Header ────────────────────────────────────────────────────────── */
.eval-header {
    border-bottom: 3px solid var(--color-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.eval-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* Presenter table section — no extra chrome */
.eval-section--presenter-grid {
    border: none;
    padding: 0;
}

/* ── Eval Inputs & Selects ──────────────────────────────────────────────── */
.eval-section select,
.eval-section input[type="text"],
.eval-section input[type="number"],
.eval-input,
.clean-input {                          /* .clean-input is an alias kept for compatibility */
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    font-size: 14px;
    transition: all var(--transition);
}

.eval-section input[readonly],
.eval-input[readonly] {
    background-color: var(--color-surface);
    cursor: default;
}

/* ── Score Cell (numeric input in CA eval grid) ─────────────────────────── */
.score-cell {
    padding: 4px;
}

.score-input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 14px;
    text-align: center;
    background: var(--color-white);
    color: var(--color-text);
    transition: border var(--transition);
}

.score-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ── Absent Dropdown ────────────────────────────────────────────────────── */
#absentDropdown {
    width: 100%;
    max-width: 100%;
}

/* ── Eval Tables ────────────────────────────────────────────────────────── */
.eval-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--color-white);
    table-layout: fixed;
}

.eval-table th,
.eval-table td {
    border: 1px solid var(--color-border);
    padding: 12px;
    text-align: left;
    word-wrap: break-word;
}

.eval-table th {
    background: var(--color-bg);
    font-size: 13px;
    text-transform: uppercase;
}

/* Cell that houses a full-bleed select/input (no internal padding) */
.eval-table__cell--full-bleed {
    padding: 0;
    height: 1px; /* lets child fill 100% height */
}

/* Full-bleed cell inputs (JC eval score dropdowns) */
.cell-input {
    width: 100%;
    height: 100%;
    min-height: 50px;
    border: none;
    outline: none;
    padding: 0;
    text-align: center;
    font-size: 16px;
    background: transparent;
    display: block;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.cell-input:focus { background-color: #f0f7ff; }

/* ── Group / Academic Year Separator Rows ───────────────────────────────── */
/* BUG FIX: JS was using class "group-row" — that class is now defined here
   AND the JS files have been updated to use "eval-table__group-row". */
.eval-table__group-row td,
.group-row td {                         /* .group-row kept as fallback alias */
    background-color: var(--color-surface-dark);
    font-weight: 700;
    text-align: center;
    color: #0f172a;
    border-top: 2px solid var(--color-border-dark);
    border-bottom: 2px solid var(--color-border-dark);
}

/* ── Presenter / Absent Selects ─────────────────────────────────────────── */
.presenter-select,
.absent-select {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: all var(--transition);
    cursor: pointer;
    display: block;
}

.presenter-select:focus,
.absent-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ── Absent Student Tags (chips) ────────────────────────────────────────── */
.absent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.absent-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--color-text);
}

.absent-tag span {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: var(--color-danger);
    transition: color var(--transition);
}
.absent-tag span:hover { color: var(--color-primary); }

/* ── Absent Row  (in scoring table) ────────────────────────────────────── */
.absent-row {
    opacity: 0.6;
    background-color: #f5f5f5;
}

.absent-row select {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Post-submission Success Container ──────────────────────────────────── */
.success-container {
    background: var(--color-surface);
    border: 2px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    color: var(--color-text);
}

.success-container h2 {
    color: var(--color-success);
    margin-bottom: 15px;
    font-size: 24px;
}

.success-container p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-home-redirect {
    display: inline-block;
    background: var(--color-success);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-home-redirect:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}


/* ==========================================================================
   7. FILTER & CHECKBOX GROUP
   ========================================================================== */

.filter-group {
    background: var(--color-bg);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.filter-group label {
    display: inline-block;
    margin-right: 20px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    font-weight: 500;
}

.filter-group input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--color-primary);
    transform: scale(1.1);
    cursor: pointer;
}


/* ==========================================================================
   8. JOURNAL CLUB SUMMARY PAGE
   ========================================================================== */

.summary-body {
    background-color: var(--color-white);
    color: #000000;
}

/* Summary extends .eval-container */
.summary-container {
    max-width: 1200px;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.summary-header-info { margin-bottom: 25px; }
.summary-header-info p {
    margin-bottom: 8px;
    color: #000000;
}

.summary-footer {
    margin-top: 30px;
    border-top: 1px solid var(--color-border);
    padding-top: 15px;
    color: #000000;
}

/* ── Summary Action Buttons ─────────────────────────────────────────────── */
.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 250px;
    margin-top: 20px;
}

/* ── Summary Table ──────────────────────────────────────────────────────── */
.summary-table {
    table-layout: auto;
    border: 2px solid #000000;
}

.summary-table th {
    text-align: center;
    vertical-align: middle;
    background: var(--color-surface);
    color: #000000;
    font-weight: 600;
    border: 1px solid #000000;
    border-bottom: 2px solid var(--color-border);
}

.summary-table td {
    text-align: center;
    color: #000000;
}

.summary-table td:first-child {
    text-align: left;
    font-weight: 500;
}

/* Thick right-border section dividers */
.summary-table tbody td:nth-child(1),    /* After Name              */
.summary-table tbody td:nth-child(2),    /* After No. Presentations */
.summary-table tbody td:nth-child(5),    /* After Presentation O/A/I */
.summary-table tbody td:nth-child(8),    /* After Discussion O/A/I  */
.summary-table tbody td:nth-child(11),   /* After Q&A O/A/I         */
.summary-table tbody td:nth-child(12),   /* After No. of Participant */
.summary-table tbody td:nth-child(13),   /* After No. of Absence    */
.summary-table tbody td:nth-child(15),   /* After On-time Y/N       */
.summary-table tbody td:nth-child(18)    /* After Participation O/A/I */
{
    border-right: 2px solid #000000;
}

/* Thick right edge on group/year separator rows too */
.eval-table__group-row td,
.group-row td {
    border-right: 2px solid var(--color-border-dark);
    border-left: 2px solid var(--color-border-dark);
}

/* Override summary-table's nth-child black border on group-separator rows */
.summary-table tbody .eval-table__group-row td,
.summary-table tbody .group-row td {
    border-right: 2px solid var(--color-border-dark);
    border-left: 2px solid var(--color-border-dark);
}

/* Date inputs inside summary header */
.summary-header-info input[type="date"] {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: var(--color-text);
}


/* ==========================================================================
   9. UG LAB / STUDENT MANAGEMENT PAGE
   ========================================================================== */

/* ── Page-level tab bar (Student Assignment / Seat Mock-up) ────────────── */
.page-tabs-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.page-tab-btn {
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;       /* sit flush on the bar border */
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 0;
    transition: color var(--transition), border-color var(--transition);
}

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

/* .page-tab-panel — visibility controlled via the shared .hidden utility class */

/* Instruction text (multi-line notes above form inputs) */
.instruction-note {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    line-height: 1.6;
}

/* Danger warning below remove button */
.danger-note {
    color: var(--color-danger);
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
}

/* Student management form groups */
.form-group {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
}


/* ==========================================================================
   10. SIM3 — SEAT MOCK-UP PANEL
   All rules scoped to .sim3-panel so they cannot bleed into other pages.
   ========================================================================== */

/* Panel container — mimics the original sim3 body layout */
.sim3-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f4f4f9;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.sim3-toolbar {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
}

.sim3-toolbar .auto-assign-box,
.sim3-toolbar .teacher-assign-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sim3-toolbar h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #f4f4f9;
    padding-bottom: 5px;
}

.sim3-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim3-input-group label {
    font-weight: bold;
    font-size: 14px;
    width: 110px;
    color: var(--color-text);
}

.sim3-input-group select,
.sim3-input-group input {
    padding: 6px;
    border: 1px solid #aaa;
    border-radius: 4px;
    font-size: 14px;
    width: 220px;
    font-family: 'Poppins', sans-serif;
}

.sim3-toolbar-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.sim3-toolbar-actions button,
.sim3-toolbar .auto-assign-box button {
    padding: 8px 12px;
    cursor: pointer;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
}
.sim3-toolbar-actions button:hover,
.sim3-toolbar .auto-assign-box button:hover { background: #555; }

.sim3-helper-text {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.5;
    background: #fdfdfd;
    padding: 10px;
    border-left: 4px solid #333;
}

/* ── Facility / Blueprint ───────────────────────────────────────────────── */
.sim3-facility-wrapper {
    width: 100%;
    max-width: 1500px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.sim3-title { margin-bottom: 5px; }

.blueprint-container {
    display: grid;
    grid-template-columns: 150px minmax(1200px, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
    width: max-content;
}

.room {
    border: 3px solid #222;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.room h3 {
    margin-top: 20px;
    color: #555;
    font-weight: normal;
    letter-spacing: 2px;
}

.wetlab   { grid-area: 1 / 1 / 2 / 2; }
.main-lab { grid-area: 1 / 2 / 2 / 3; padding: 10px; }

.bottom-rooms {
    grid-area: 2 / 2 / 3 / 3;
    display: flex;
    flex-direction: row-reverse;
    gap: 0;
    height: 100px;
    padding-left: 20px;
    margin-right: 365px;
}

.bottom-rooms .room {
    border: 3px solid #222;
    background: white;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room.toilet    { width: 280px; }
.room.xray-left { width: 110px; }
.room.control   { width: 280px; }
.room.xray-right{ width: 110px; }

.room-labels {
    display: flex;
    width: 100%;
    font-weight: bold;
    margin-bottom: 20px;
    color: #555;
    font-size: 20px;
}

/* ── Table layout engine ────────────────────────────────────────────────── */
.table-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 25px;
    background: #fafafa;
    padding: 20px;
}

.t-col   { display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.t-block { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.t-block-empty { height: 140px; }
.t-subcol { display: flex; flex-direction: column; justify-content: center; gap: 4px; }

.room-divider { width: 40px; border-right: 4px dashed #ccc; margin-right: 40px; }

.desk-wrapper + .desk-wrapper { margin-top: -1px; }
.col-stagger-down { margin-top: 24px; }
.col-stagger-up   { margin-top: -24px; }

/* ── Desk cell ──────────────────────────────────────────────────────────── */
.desk {
    border: 1px solid #333;
    width: 64px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: white;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    padding: 3px;
    box-sizing: border-box;
}
.desk:hover { outline: 2px solid blue; z-index: 10; transform: scale(1.05); }

.desk-num     { font-weight: bold; font-size: 12px; line-height: 1; margin-bottom: 2px; }
.desk-student {
    color: #0044cc;
    font-size: 10px;
    font-weight: bold;
    font-family: 'Sarabun', Arial, sans-serif;
    line-height: 1.2;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.desk-teacher {
    color: #000;
    font-size: 9px;
    font-family: 'Sarabun', Arial, sans-serif;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

/* ── Bottom action buttons ──────────────────────────────────────────────── */
.sim3-bottom-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.sim3-bottom-actions button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    font-family: 'Poppins', sans-serif;
}

.sim3-btn-temp-save { background-color: #ffc107; color: #333 !important; }
.sim3-btn-temp-save:hover { background-color: #e0a800; }

.sim3-btn-download { background-color: #0044cc; }
.sim3-btn-download:hover { background-color: #003399; }

.sim3-btn-finalize { background-color: #28a745; }
.sim3-btn-finalize:hover { background-color: #218838; }

/* ── Edit Modal ─────────────────────────────────────────────────────────── */
.sim3-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.sim3-modal.hidden { display: none; }

.sim3-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim3-modal-content input {
    padding: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
}

.sim3-modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.sim3-modal-actions button {
    padding: 8px 16px;
    cursor: pointer;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
}
.sim3-modal-actions button:hover { background: #555; }


/* ==========================================================================
   11. MEDIA QUERIES
   ========================================================================== */

/* ── Tablet / Mobile  (≤ 768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Auth cards stack vertically */
    .login-card {
        flex-direction: column-reverse;
        position: relative;
        top: 20px;
        margin: 0 auto 40px;
        width: 95%;
    }

    /* Evaluation container */
    .eval-container { padding: 15px; }

    /* Eval table — switch to auto layout for mobile readability */
    .eval-table {
        display: table;
        table-layout: auto;
    }

    .eval-table th,
    .eval-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    /* Rotate long presenter-column headers vertically */
    .eval-table th.presenter-header {
        height: 120px;
        vertical-align: bottom;
        text-align: center;
        padding: 10px 2px;
    }

    .eval-table th.presenter-header span {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        white-space: nowrap;
        display: inline-block;
    }

    /* Narrow first column on mobile */
    .eval-table td:first-child,
    .eval-table th:first-child {
        width: 100px;
        min-width: 100px;
        font-size: 11px;
    }

    /* Sidebar collapses to a top drawer */
    .layout-body { flex-direction: column; }

    .sidebar {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .sidebar__header { cursor: pointer; }

    .sidebar__menu-icon { display: block; }

    /* JS-toggled collapse / expand states */
    .sidebar-collapsed {
        max-height: 88px;
        overflow: hidden;
    }

    .sidebar-expanded {
        max-height: 80vh;
        overflow: hidden;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }

    /* Push main content below the fixed mobile sidebar header */
    .main-content { padding-top: 112px; }
}

/* ==========================================================================
   12. LAB EVALUATION PAGE  (ugt_lab1_eval)
   ========================================================================== */

/* ── Grader label strip ─────────────────────────────────────────────────── */
.lab-grader-label {
    padding: 8px 18px;
    font-size: 0.85rem;
    color: #555;
}

/* ── Hint text above table ──────────────────────────────────────────────── */
.lab-table-hint {
    font-size: 0.78rem;
    color: #7c3aed;
    padding: 6px 18px 2px;
    font-style: italic;
}

/* ── Eval panel (scrollable table wrapper) ──────────────────────────────── */
.lab-eval-panel {
    padding: 0;
    overflow: auto;          /* both scrollbars */
    max-height: calc(100vh - 230px);
}

/* ── Action bar ─────────────────────────────────────────────────────────── */
.lab-action-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid var(--color-border);
}

.lab-action-bar--hidden { display: none; }

/* Uniform Save / Submit button sizing */
.lab-action-bar .btn {
    width: 180px;
    text-align: center;
}

.lab-action-msg {
    font-size: 0.85rem;
    color: #555;
    margin-left: 8px;
}

/* ── Eval table (criteria = rows, students = columns) ───────────────────── */
.lab-eval-table,
.lab-quiz-table {
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: max-content;
    table-layout: auto;
}

/* Sticky header row (student names) */
.lab-eval-table thead th,
.lab-quiz-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f7ff;
}

/* Fixed left column: criterion label — sticky both axes at top-left corner */
.lab-th--criterion-label {
    min-width: 190px;
    max-width: 190px;
    text-align: left;
    background: #f8f7ff;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 4;  /* above both axis sticky elements */
    white-space: normal;
    word-break: break-word;
}

/* Student name column header */
.lab-th--student {
    min-width: 76px;
    width: 76px;
    text-align: center;
    vertical-align: bottom;
    padding: 6px 4px;
}

/* Container for name + ID inside the student header cell */
.lab-student-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Student first name — horizontal on normal screens */
.lab-student-name {
    font-size: 0.78rem;
    font-family: 'Sarabun', Arial, sans-serif;
    white-space: nowrap;
    line-height: 1.3;
    font-weight: 600;
}

/* Student ID shown below the name */
.lab-student-id {
    font-size: 0.65rem;
    color: #888;
    font-weight: normal;
    white-space: nowrap;
}

/* On small screens: rotate name vertically to save horizontal space */
@media (max-width: 768px) {
    .lab-th--student {
        min-width: 34px;
        width: 34px;
        vertical-align: bottom;
        padding-bottom: 4px;
    }

    .lab-student-name {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        white-space: nowrap;
        max-height: 110px;
        overflow: hidden;
    }

    .lab-student-id {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-size: 0.6rem;
    }
}

/* Quiz table: score column headers */
.lab-th--score {
    min-width: 100px;
    width: 100px;
    text-align: center;
    white-space: nowrap;
}

/* Greyed out header for submitted students */
.lab-th--submitted { opacity: 0.5; }

/* Eval table: restore native select arrow + ensure full-bleed fill */
.lab-eval-table .eval-table__cell--full-bleed,
.lab-eval-table td.eval-table__cell--full-bleed {
    padding: 0;
    height: 1px;
}

.lab-eval-table .cell-input {
    appearance: auto;
    -webkit-appearance: auto;
    min-height: 44px;
    font-size: 0.8rem;
    padding: 0 4px;
    cursor: pointer;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    display: block;
    box-sizing: border-box;
}

.lab-eval-table .cell-input:focus { background: #f0f7ff; }


/* Section header row (full-width band) */
.lab-td--section-header {
    background: #ede9fe;
    border-left: 3px solid #7c3aed;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 10px;
    color: #4a1d96;
}

/* Criterion name cell (left column, sticky) */
.lab-td--criterion {
    font-size: 0.8rem;
    padding: 6px 10px;
    cursor: default;
    background: #fafafa;
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 190px;
    max-width: 190px;
    width: 190px;
    border-right: 2px solid var(--color-border-dark);
    white-space: normal;
    word-break: break-word;
}

/* Criterion cells that open description popup */
.lab-td--criterion[onclick] {
    cursor: pointer;
}

.lab-td--criterion[onclick]:hover { background: #f0eeff; }

/* Critical-error label row */
.lab-td--critical-label {
    color: #c00;
    font-size: 0.78rem;
    background: #fff8f8;
}

/* Critical-error data cell */
.lab-td--critical {
    background: #fff8f8;
    text-align: center;
    vertical-align: middle;
}

/* Critical-error checkbox wrapper */
.lab-critical-label {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Error-type text input */
.lab-critical-input {
    width: 100px;
    margin-top: 4px;
    font-size: 0.72rem;
    display: block;
}

/* Sealer test checkbox cell */
.lab-td--sealer {
    text-align: center;
    vertical-align: middle;
}

/* Quiz table: student name+id sticky first column */
.lab-td--student-name {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fafafa;
    border-right: 2px solid var(--color-border-dark);
    min-width: 190px;
    max-width: 190px;
    font-size: 0.82rem;
    padding: 6px 10px;
    white-space: normal;
}

/* Full name text inside merged quiz student cell */
.lab-student-fullname {
    display: block;
    font-weight: 600;
    font-family: 'Sarabun', Arial, sans-serif;
}

/* ID tag below name */
.lab-student-idtag {
    display: block;
    font-size: 0.7rem;
    color: #888;
    margin-top: 1px;
}

/* Quiz table: student ID cell */
.lab-td--student-id {
    text-align: center;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Quiz table: score input cell */
.lab-td--score {
    text-align: center;
    vertical-align: middle;
    padding: 0;
    height: 1px;
}

.lab-score-input {
    width: 100%;
    height: 100%;
    min-height: 42px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 0.85rem;
    background: transparent;
    display: block;
    box-sizing: border-box;
    padding: 0 4px;
}

.lab-score-input:focus { background: #f0f7ff; }

/* ── Status messages inside panel ───────────────────────────────────────── */
.lab-panel-msg {
    padding: 24px;
    font-style: italic;
    color: #888;
}

.lab-panel-msg--error { color: #c00; font-style: normal; }

/* ── Description Modal ──────────────────────────────────────────────────── */
.lab-desc-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lab-desc-modal--open { display: flex; }

.lab-desc-modal__box {
    background: #fff;
    border-radius: 10px;
    max-width: 560px;
    width: 90%;
    padding: 28px 30px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.lab-desc-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #555;
}

.lab-desc-modal__title {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #4a1d96;
}

.lab-desc-modal__body {
    font-size: 0.85rem;
    line-height: 1.65;
    color: #333;
}

/* ── Description item inside modal body ────────────────────────────────── */
.lab-desc-item {
    margin-bottom: 12px;
}

.lab-desc-item__heading { color: #4a1d96; }

/* ── Info icon (ℹ) inside criterion label ───────────────────────────────── */
.info-icon {
    font-style: normal;
    font-size: 0.75rem;
    color: #9a7fd4;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.8;
}

/* ── Alternating row shading (quiz table) ───────────────────────────────── */
.eval-table__row--even td {
    background-color: #f9f8ff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   END §12 — LAB EVALUATION PAGE
══════════════════════════════════════════════════════════════════════════════ */