:root {
    --primary-color: #7D1D53;
    --primary-hover: #9A2466;
    --accent-pale-pink: #FDF2F8;
    --bg-bright: #F8FAFC;
    --white: #FFFFFF;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --radius-lg: 28px;
    --radius-md: 14px;
    --shadow-lux: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --inner-glow: inset 0 1px 1px rgba(255, 255, 255, 0.2);

    /* V5 Alert Categories Color Tokens */
    --alert-danger-bg: #FEE2E2;
    --alert-danger-text: #991B1B;
    --alert-info-bg: #E0F2FE;
    --alert-info-text: #075985;
    --alert-success-bg: #DCFCE7;
    --alert-success-text: #166534;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-bright);
    /* background-image: url("../img/dashboard_bg.jpg");  */
    background-size: cover;
    background-attachment: fixed;
    background-blend-mode: overlay;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Login page only — centers the login card */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-wrapper {
    display: flex;
    width: 92%;
    max-width: 1080px;
    min-height: 640px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lux);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 10;
}

/* --- Left Side: Brand Section --- */
.brand-section {
    flex: 1.1;
    background-color: var(--primary-color);
    /* background-image: 
        linear-gradient(135deg, rgba(125, 29, 83, 0.95), rgba(70, 10, 40, 1)), 
        url("../img/dashboard_bg.jpg"); */
    background-size: cover;
    background-blend-mode: normal, overlay;
    padding: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--inner-glow);
    position: relative;
    overflow: hidden;
}

.brand-section::after {
    content: '';
    position: absolute;
    top: -15%;
    right: -25%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.brand-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}

.brand-subtitle {
    font-size: 1.05rem;
    opacity: 0.85;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

/* --- Right Side: Form Section --- */
.form-section {
    flex: 1;
    padding: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
}

.university-badge {
    display: inline-block;
    background-color: var(--accent-pale-pink);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h2 {
    color: var(--text-dark);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.form-muted-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.input-group { margin-bottom: 1.8rem; }

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
}

.input-field {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: #F1F5F9;
    font-family: 'Inter', sans-serif;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(125, 29, 83, 0.08);
    transform: translateY(-1px);
}

.btn-signin {
    width: 100%;
    padding: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(125, 29, 83, 0.1);
}

.btn-signin:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(125, 29, 83, 0.3);
}

/* --- Flash Notification Message Components --- */
.flash-msg {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    animation: slideDown 0.4s ease-out;
}
.flash-danger  { background-color: var(--alert-danger-bg); color: var(--alert-danger-text); }
.flash-error   { background-color: var(--alert-danger-bg); color: var(--alert-danger-text); }
.flash-info    { background-color: var(--alert-info-bg); color: var(--alert-info-text); }
.flash-success { background-color: var(--alert-success-bg); color: var(--alert-success-text); }

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

/* ==========================================================================
   V5 Centralized Scoped Dashboard Layout Styles
   ========================================================================== */

body.db-page {
    display: block;
    overflow-y: auto;
    background-color: var(--bg-bright);
    /* background-image: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.95)), url("../img/dashboard_bg.jpg"); */
    background-size: cover;
    background-attachment: fixed;
    background-blend-mode: normal;
    min-height: 100vh;
}


/* Scoped Dashboard Header */
.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.75rem;
    margin-bottom: 2.5rem;
}

.db-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.db-header p {
    color: var(--text-muted);
    margin: 0.4rem 0 0 0;
    font-size: 1rem;
}

.db-header p strong {
    color: var(--primary-color);
    font-weight: 700;
}

.db-disconnect-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: 0 4px 6px -1px rgba(125, 29, 83, 0.05);
}

.db-disconnect-link:hover {
    color: var(--white);
    background-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(125, 29, 83, 0.2);
    transform: translateY(-1px);
}

/* Elegant Frosted/Solid White Control Panel */
.db-control-box {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 2.25rem;
    border-radius: var(--radius-lg);
    border-left: 8px solid var(--text-muted);
    box-shadow: var(--shadow-lux);
    margin-bottom: 3rem;
    transition: border-color 0.3s ease;
}

/* Semantic Status Glow Borders */
.db-control-box.Ready { border-left-color: #22C55E; }
.db-control-box.Offline { border-left-color: #EAB308; }
.db-control-box.Unavailable { border-left-color: var(--text-muted); }

/* Dynamic Status Badges matching Alert Category tokens */
.db-state-badge {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-block;
    margin-left: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.badge-ready { background: var(--alert-success-bg); color: var(--alert-success-text); }
.badge-offline { background: var(--alert-info-bg); color: var(--alert-info-text); }
.badge-unavailable { background: #F1F5F9; color: var(--text-muted); border: 1px solid var(--border-color); }

/* Interactive Action Trigger Buttons */
.db-action-row {
    margin-top: 1.75rem;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.btn-db-core {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-db-core:active { transform: scale(0.97); }
.btn-db-core:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Custom Palette Rules for Student Transitions */
.btn-join-matrix { background: var(--primary-color); color: var(--white); }
.btn-join-matrix:hover { background: var(--primary-hover); }

.btn-connect-cluster { background: #22C55E; color: var(--white); }
.btn-connect-cluster:hover { background: #16A34A; }

.btn-disconnect-cluster { background: #EAB308; color: var(--text-dark); }
.btn-disconnect-cluster:hover { background: #CA8A04; }

.btn-purge-node { background: #EF4444; color: var(--white); }
.btn-purge-node:hover { background: #DC2626; }

/* Unified Classroom Workspaces Grid Layout */
.db-workspace-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.75rem;
}

.db-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-lux);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.db-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08), 0 15px 15px -5px rgba(0, 0, 0, 0.03);
}

.db-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
}

.db-card p {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Classroom Action Link Gateways */
.btn-gateway {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(125, 29, 83, 0.1);
}

.btn-gateway:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(125, 29, 83, 0.25);
}

/* Container Wrapper to limit width and mimic the login page elegance */
.db-wrapper {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 0;
}

/* Control box internal header layout to fix the badge alignment */
.db-control-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.db-control-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
}

.db-vpn-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Styling for the empty workspaces list to look premium */
.db-empty-card {
    grid-column: span 3;
    background: var(--white);
    border: 1.5px dashed var(--border-color);
    padding: 2.5rem;
    text-align: center;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 1rem;
}

/* ==========================================================================
   Shared layout pieces for Developer/HR (sidebar, tables, cards)
   ========================================================================== */

.db-layout {
    display: flex;
    min-height: 100vh;
}

.db-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.db-sidebar .brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.db-sidebar .brand small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.db-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.db-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.db-sidebar nav a:hover { background: var(--accent-pale-pink); color: var(--primary-color); }
.db-sidebar nav a.active { background: var(--primary-color); color: var(--white); }

.db-sidebar .footer-nav {
    margin-top: auto;
    padding: 0 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.db-main { flex: 1; padding: 2.5rem 3rem; max-width: 1200px; }

.db-simple-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.9rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lux);
}

.db-simple-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1.1rem;
}

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

.db-table th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.6rem 0.7rem;
    border-bottom: 1.5px solid var(--border-color);
}

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

.db-table tbody tr:hover { background: var(--accent-pale-pink); }
.db-table tr:last-child td { border-bottom: none; }

.db-search {
    width: 100%;
    max-width: 320px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.db-search:focus { outline: none; border-color: var(--primary-color); }

.db-btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 8px;
}

.nav-group-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 1rem 1.5rem 0.4rem;
}

/* ==========================================================================
   Student Connecting badge
   ========================================================================== */
.badge-connecting {
    background-color: #f59e0b;
    color: #ffffff;
    animation: badgePulse 1.5s infinite alternate;
}

@keyframes badgePulse {
    from { opacity: 0.6; }
    to { opacity: 1.0; }
}


/* =========================================================================
   AI PROGRESS MODAL DESIGN SYSTEM
   ========================================================================= */

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

.modal-card {
    background: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #E2E8F0;
}

.modal-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #0F172A;
    font-weight: 700;
}

#modalStepText {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Progress Bar Track */
.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: #E2E8F0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

/* Progress Bar Fill */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #a855f7 100%);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-percent-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748B;
    display: block;
    text-align: right;
    margin-bottom: 1.5rem;
}

/* Inset Terminal Box for Steps */
.build-steps-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.build-steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.build-steps-list li {
    padding: 0.4rem 0;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Step State Styles */
.build-steps-list li.step-completed {
    color: #10B981; /* Green */
    font-weight: 600;
}

.build-steps-list li.step-active {
    color: #4F46E5; /* Indigo */
    font-weight: 700;
}

.build-steps-list li.step-pending {
    color: #94A3B8; /* Slate gray */
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-secondary-cancel {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-cancel:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.auto-close-hint {
    font-size: 0.8rem;
    color: #94A3B8;
    font-style: italic;
}

/* ==========================================================================
   V6 UX REFRESH — tokens, missing component styles, responsive layout
   Appended on top of the V5 system. Nothing above this line is removed;
   these rules extend/refine existing selectors and add the classes the
   templates reference but that were never defined (kpi-*, db-nav-link,
   db-user-*, empty-state*).
   ========================================================================== */

:root {
    --primary-light: #F5E6EE;
    --color-success: #22C55E;
    --color-success-dark: #16A34A;
    --color-warning: #EAB308;
    --color-warning-dark: #CA8A04;
    --color-danger: #EF4444;
    --color-danger-dark: #DC2626;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;

    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, 0.10), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
}

/* ---- Global scoped-dashboard body: full-bleed, no forced centering ---- */
body.db-page {
    align-items: stretch;
    justify-content: stretch;
    overflow: visible;
}

*, *::before, *::after { box-sizing: border-box; }

/* ==========================================================================
   Mobile topbar + off-canvas sidebar
   ========================================================================== */

.db-mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.db-mobile-topbar .brand {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
}

.db-sidebar-toggle {
    background: var(--accent-pale-pink);
    border: none;
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    cursor: pointer;
}

.db-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 45;
}

.db-layout.sidebar-open .db-sidebar-backdrop { display: block; }

/* ==========================================================================
   Sidebar polish
   ========================================================================== */

.db-sidebar { transition: transform 0.25s ease; }

.db-sidebar nav a.db-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.db-sidebar nav a.db-nav-link .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.db-sidebar nav a.db-nav-link:hover { background: var(--accent-pale-pink); color: var(--primary-color); }
.db-sidebar nav a.db-nav-link.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.db-user-control {
    margin-top: auto;
    padding: 1rem 0.9rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.db-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.db-user-trigger:hover { background: var(--accent-pale-pink); }

.db-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.db-user-meta { flex: 1; min-width: 0; }

.db-user-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.db-user-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0.9rem;
    right: 0.9rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lux);
    padding: 0.5rem;
    z-index: 50;
}

.db-user-menu.open { display: flex; }

.db-user-menu a {
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.db-user-menu a:hover { background: var(--accent-pale-pink); color: var(--primary-color); }
.db-user-menu a.danger { color: var(--color-danger); }
.db-user-menu a.danger:hover { background: #FEF2F2; }
.db-user-menu hr { border: none; border-top: 1px solid var(--border-color); margin: 0.4rem 0; }

/* ==========================================================================
   Page header refinements
   ========================================================================== */

.db-header h1 { display: flex; align-items: center; gap: 0.6rem; }

/* ==========================================================================
   KPI cards
   ========================================================================== */

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

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg { width: 20px; height: 20px; }

.kpi-body { min-width: 0; }

.kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.kpi-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.kpi-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    background: var(--bg-bright);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-state-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.empty-state-desc {
    font-size: 0.88rem;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Course cards (Overview + My Courses)
   ========================================================================== */

.course-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.course-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.course-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.course-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-card-meta strong { color: var(--primary-color); font-weight: 700; }

.course-card-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ==========================================================================
   Student cards
   ========================================================================== */

.student-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.student-card:hover { box-shadow: var(--shadow-md); }

.student-card-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-pale-pink);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.student-card-name { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.student-card-id { font-size: 0.75rem; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; }

.student-card-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.env-status-box {
    background: var(--bg-bright);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    margin-top: 0.9rem;
}

/* ==========================================================================
   Labs generation layout
   ========================================================================== */

.labs-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.prompt-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.prompt-chip {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-light);
    border: 1px solid transparent;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.prompt-chip:hover { background: var(--primary-color); color: var(--white); }

.student-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.student-picker-actions { display: flex; gap: 0.9rem; }
.student-picker-actions a { font-size: 0.8rem; font-weight: 700; color: var(--primary-color); text-decoration: none; }
.student-picker-actions a:hover { text-decoration: underline; }

.student-picker-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-bright);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
}

#student-checklist {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
}

#student-checklist label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.12s ease;
}

#student-checklist label:hover { background: var(--accent-pale-pink); }
#student-checklist label code { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }
#student-checklist input[type="checkbox"] { accent-color: var(--primary-color); width: 16px; height: 16px; flex-shrink: 0; }

.labs-summary-card {
    position: sticky;
    top: 1.5rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lux);
}

.labs-summary-card h3 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.labs-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.labs-summary-row:last-of-type { border-bottom: none; }
.labs-summary-row span:first-child { color: var(--text-muted); }
.labs-summary-row span:last-child { color: var(--text-dark); font-weight: 700; text-align: right; }

.labs-summary-card .btn-db-core { width: 100%; margin-top: 1.1rem; }

/* ==========================================================================
   Env instance box internals (replacing prior inline styles)
   ========================================================================== */

.env-instance + .env-instance {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.env-instance-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.env-instance-lab {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.env-live-dot {
    color: var(--color-success);
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.env-pod-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-dark);
    word-break: break-all;
    display: block;
}

.env-duration-row { display: flex; gap: 0.5rem; margin: 0.6rem 0 0.5rem; }
.env-duration-row .input-field { width: 70px; padding: 0.45rem 0.6rem; }
.env-duration-row select.input-field { padding: 0.45rem 0.5rem; }

.env-action-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.env-action-row .btn-db-core { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
.env-action-row .btn-db-core svg { width: 14px; height: 14px; }
.env-action-row form { flex: 1; }
.env-action-row .btn-db-core { width: 100%; }

.no-env-text { color: var(--text-muted); font-size: 0.85rem; }

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

@media (max-width: 900px) {
    .db-mobile-topbar { display: flex; }

    .db-layout { position: relative; }

    .db-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lux);
    }

    .db-layout.sidebar-open .db-sidebar { transform: translateX(0); }

    .db-main { padding: 1.5rem 1.25rem; max-width: 100%; }

    .db-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    .labs-layout { grid-template-columns: 1fr; }
    .labs-summary-card { position: static; }
}

@media (max-width: 560px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .db-grid { grid-template-columns: 1fr; }
    .env-duration-row { flex-wrap: wrap; }
}

/* ==========================================================================
   Focus visibility (accessibility floor)
   ========================================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   V6.1 — Profile page
   ========================================================================== */

.profile-card-head {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-avatar-wrap {
    text-align: center;
    flex-shrink: 0;
}

.profile-avatar-wrap img,
.profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-pale-pink);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.9rem;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
}

.profile-avatar-upload {
    display: inline-block;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-avatar-upload:hover { background: var(--primary-color); color: var(--white); }
.profile-avatar-upload input[type="file"] { display: none; }
.profile-avatar-filename {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-fields-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.3rem 1.5rem;
    min-width: 0;
}

.profile-field-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.profile-field-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

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

.col-span-2 { grid-column: span 2; }

.db-simple-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-simple-card h2 svg { width: 17px; height: 17px; color: var(--primary-color); }

.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-cancel-ghost {
    padding: 0.9rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-cancel-ghost:hover { background: var(--bg-bright); color: var(--text-dark); }

@media (max-width: 640px) {
    .profile-card-head { flex-direction: column; align-items: center; text-align: center; }
    .profile-fields-grid { grid-template-columns: 1fr; width: 100%; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .db-wrapper { padding: 1.5rem 0; }
}

/* ==========================================================================
   V6.2 — Profile page embedded in the app shell
   ========================================================================== */

.db-breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.db-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.db-breadcrumb a:hover { color: var(--primary-color); }

.db-breadcrumb .crumb-sep { color: var(--border-color); }

.db-breadcrumb .crumb-current { color: var(--text-dark); font-weight: 700; }

/* ==========================================================================
   V6.3 — Clickable Overview KPIs / course cards + Students filter chip
   ========================================================================== */

.kpi-clickable,
.course-card-clickable {
    cursor: pointer;
}

.kpi-clickable:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.kpi-clickable:active { transform: translateY(-1px); }

.course-card-clickable:hover {
    border-color: var(--primary-color);
}

.student-filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.35rem 0.5rem 0.35rem 0.8rem;
    border-radius: 50px;
    white-space: nowrap;
}

.filter-chip-clear {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 50%;
    font-weight: 700;
}

.filter-chip-clear:hover { background: var(--primary-color); color: var(--white); }

/* ==========================================================================
   V6.4 — Course / Student detail drawer
   ========================================================================== */

.db-table tbody tr[onclick] { cursor: pointer; }
.db-table tbody tr[onclick]:hover { background: var(--accent-pale-pink); }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 460px;
    max-width: 92vw;
    background: var(--white);
    box-shadow: var(--shadow-lux);
    z-index: 95;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 2rem 1.75rem;
}

.detail-drawer.open { transform: translateX(0); }

.drawer-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-bright);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-close:hover { background: var(--accent-pale-pink); color: var(--primary-color); }

.drawer-loading {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 3rem 0;
    text-align: center;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 2.5rem;
    margin-bottom: 1.75rem;
}

.detail-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.detail-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.detail-section h3 {
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

.detail-lab-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.detail-lab-item {
    background: var(--bg-bright);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
}

.detail-lab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.detail-lab-head strong { font-size: 0.9rem; color: var(--text-dark); }

.detail-lab-notes {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.4rem 0 0;
}

.detail-student-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-student-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-dark);
}

.detail-student-row:hover { background: var(--accent-pale-pink); }

.detail-student-row-id {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 560px) {
    .detail-drawer { width: 100vw; max-width: 100vw; padding: 1.5rem 1.25rem; }
}

/* ==========================================================================
   V6.5 — Existing Labs list, bulk actions, expiry warning, picker rows
   ========================================================================== */

.existing-labs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lab-summary-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lab-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: var(--bg-bright);
    cursor: pointer;
    flex-wrap: wrap;
}

.lab-summary-head:hover { background: var(--accent-pale-pink); }

.lab-summary-head strong { font-size: 0.92rem; color: var(--text-dark); }

.lab-summary-counts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lab-summary-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.lab-summary-body {
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--border-color);
}

.lab-bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
}

.lab-bulk-actions a { color: var(--primary-color); font-weight: 700; text-decoration: none; }
.lab-bulk-actions a:hover { text-decoration: underline; }

.lab-row-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.lab-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.lab-row:hover { background: var(--bg-bright); }

.lab-row input[type="checkbox"] { accent-color: var(--primary-color); width: 15px; height: 15px; flex-shrink: 0; }

.lab-row-student {
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
}

.lab-row-student:hover { color: var(--primary-color); text-decoration: underline; }

.lab-row-podname {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.lab-row-expiry {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.lab-row-expiry.expiring-soon {
    color: #B45309;
    font-weight: 700;
}

/* Reused for the per-instance expiry line inside render_env_box output */
.env-expiry-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.4rem 0;
    display: flex;
    align-items: center;
}

.env-expiry-text.expiring-soon {
    color: #B45309;
    font-weight: 700;
    animation: badgePulse 1.5s infinite alternate;
}

/* Student picker rows (Labs > generate form) - replaces old <label>-wrapped
   rows so the checkbox and the "view student" click target are independent */
.picker-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    font-size: 0.88rem;
}

.picker-row:hover { background: var(--accent-pale-pink); }

.picker-row input[type="checkbox"] { accent-color: var(--primary-color); width: 16px; height: 16px; flex-shrink: 0; }

.picker-row-name {
    color: var(--text-dark);
    cursor: pointer;
}

.picker-row-name:hover { color: var(--primary-color); text-decoration: underline; }

.picker-row code { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }

/* ==========================================================================
   V6.6 — Persistent student filter toggles, lab bulk duration input
   ========================================================================== */

.student-filter-toggles {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-toggle-btn {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-bright);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

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

.lab-bulk-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lab-bulk-duration .input-field { font-size: 0.8rem; }

/* ==========================================================================
   V6.7 — Disabled state for bulk action buttons
   ========================================================================== */

.btn-db-core:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   V6.8 — Notification bell, dropdown, toasts (student dashboard)
   ========================================================================== */

.notif-bell-wrap {
    position: relative;
    margin-bottom: 0.5rem;
}

.notif-bell-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.notif-bell-btn:hover { background: var(--accent-pale-pink); color: var(--primary-color); }
.notif-bell-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.notif-unread-badge {
    position: absolute;
    top: 0.35rem;
    left: 1.55rem;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 50px;
    background: var(--color-danger);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-dropdown {
    display: none;
    position: fixed;
    width: 320px;
    max-width: 88vw;
    max-height: 400px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lux);
    z-index: 70;
}

.notif-dropdown.open { display: block; }

.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    position: sticky;
    top: 0;
    background: var(--white);
}

.notif-dropdown-head a { color: var(--primary-color); font-weight: 700; text-decoration: none; font-size: 0.78rem; }
.notif-dropdown-head a:hover { text-decoration: underline; }

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.notif-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.12s ease;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-bright); }

.notif-item.unread { background: var(--accent-pale-pink); }
.notif-item.unread:hover { background: #FBE3EF; }

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.notif-item-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notif-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ---- Toasts ---- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 320px;
}

.toast-item {
    background: var(--text-dark);
    color: var(--white);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lux);
    font-size: 0.85rem;
    animation: toastIn 0.25s ease;
}

.toast-item strong { display: block; margin-bottom: 0.2rem; }
.toast-item div { color: rgba(255,255,255,0.75); font-size: 0.78rem; }

.toast-item.toast-out { animation: toastOut 0.3s ease forwards; }

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

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

@media (max-width: 560px) {
    .toast-container { left: 1rem; right: 1rem; max-width: none; }
}

/* ==========================================================================
   V6.9 — HR console: warning tokens, soft action buttons, reusable grids,
   table avatars, badges, checkbox pills, inline warning banners
   ========================================================================== */

:root {
    --alert-warning-bg: #FEF3C7;
    --alert-warning-text: #B45309;
}

/* ---- Soft action buttons (formalizes the inline-color pattern repeated
   throughout the HR templates - View/Enable-Disable/Delete/Export) ---- */
.btn-soft-primary { background: var(--accent-pale-pink); color: var(--primary-color); }
.btn-soft-primary:hover { background: var(--primary-color); color: var(--white); }

.btn-soft-warning { background: var(--alert-warning-bg); color: var(--alert-warning-text); }
.btn-soft-warning:hover { background: var(--alert-warning-text); color: var(--white); }

.btn-soft-danger { background: var(--alert-danger-bg); color: var(--alert-danger-text); }
.btn-soft-danger:hover { background: var(--alert-danger-text); color: var(--white); }

.btn-soft-success { background: var(--alert-success-bg); color: var(--alert-success-text); }
.btn-soft-success:hover { background: var(--alert-success-text); color: var(--white); }

/* ---- Extra badge variants (badge-ready/offline/unavailable already exist;
   these cover "Disabled account" red and complement badge-offline for
   "Graduated" info-blue, which already matches these exact tokens) ---- */
.badge-danger { background: var(--alert-danger-bg); color: var(--alert-danger-text); }

/* ---- Inline informational warning banners (e.g. "create a cohort first") -
   distinct from .flash-msg since these are static, not dismissible toasts ---- */
.inline-warning {
    background: var(--alert-warning-bg);
    color: var(--alert-warning-text);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---- Reusable form grids (replace repeated inline grid-template-columns) ---- */
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.form-row-end {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

/* ---- Small table-row avatar (32px variant of .student-avatar) ---- */
.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-pale-pink);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ---- Checkbox pill group (course-assignment group picker) ---- */
.checkbox-pill-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0;
}
.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-bright);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.9rem;
    border-radius: 50px;
}
.checkbox-pill.select-all { background: var(--primary-light); color: var(--primary-color); border-color: transparent; }
.checkbox-pill input[type="checkbox"] { accent-color: var(--primary-color); width: 15px; height: 15px; }

/* ---- Table cell inline edit row (description/notes save form inside a cell) ---- */
.table-inline-edit {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.table-inline-edit .input-field { padding: 0.5rem 0.7rem; font-size: 0.85rem; }

/* ---- Row action group (multiple buttons/forms side by side in a table cell) ---- */
.table-row-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ---- Detail page person header (photo + field grid, used by
   professor_detail / student_detail) ---- */
.person-detail-head {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.person-detail-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}
.person-detail-field-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.person-detail-field-value {
    font-weight: 600;
    color: var(--text-dark);
}
.person-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-pale-pink);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
    .person-detail-head { flex-direction: column; align-items: center; text-align: center; }
    .person-detail-fields { grid-template-columns: 1fr; width: 100%; }
}
@media (max-width: 480px) {
    .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}