/**
 * LabPulse Component Library
 * -----------------------------------------------------------------
 * Reusable, page-agnostic UI pieces: buttons, icon buttons, cards,
 * stat cards, status badges, tables, forms, alerts, empty states,
 * dropdowns and modals. See pages/ui-kit.php for a live reference.
 * -----------------------------------------------------------------
 */

/* ---------------------------------------------------------------
 * Buttons
 * --------------------------------------------------------------- */
/* One button system for every role and page (Button UI standardization, 2026-11-05):
 *   .btn-primary   the one main action of a form / dialog / section (solid navy)
 *   .btn-secondary other actions (outlined)
 *   .btn-ghost     low-emphasis actions inside rows, toolbars and filters (no border)
 *   .btn-danger    anything that removes, clears, revokes, archives or ends (red outline); inside a dialog footer it is
 *                  the final confirmation and turns solid red
 * Sizes: default 38px, .btn-sm 32px (rows, toolbars, cards), .btn-lg 44px (sign-in pages). .btn-block = full width.
 * States (all variants): hover, :focus-visible ring, :disabled, and aria-busy="true" (loading - set automatically by
 * labpulse-core.js while the request a button started is in flight). Dialog footers: Cancel / Close first, the main
 * action last (right); a secondary destructive action ("Remove ...") sits alone on the left. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 38px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-md); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after {
    content: "";
    width: 0.9em;
    height: 0.9em;
    flex: none;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-busy-spin 0.7s linear infinite;
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }
:root[data-lp-motion="reduced"] .btn[aria-busy="true"]::after { animation-duration: 1.6s; }

.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 0.8rem; }
.btn-lg { height: 44px; padding: 0 var(--space-5); font-size: 0.95rem; }
.btn-block { display: flex; width: 100%; }
/* A group of related buttons (wraps on narrow screens). */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.btn-row-end { justify-content: flex-end; }

.btn-primary {
    background: var(--primary-500);
    color: var(--neutral-0);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-600); }

.btn-secondary {
    background: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger {
    background: var(--surface-card);
    color: var(--danger-text);
    border-color: var(--danger-200);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-50); }
.modal-footer > .btn-danger { background: var(--danger-600); border-color: var(--danger-600); color: var(--neutral-0); }
.modal-footer > .btn-danger:hover:not(:disabled) { background: var(--danger-600); filter: brightness(0.88); } /* --danger-700 turns pale in dark mode */
/* The secondary destructive action of an edit dialog (e.g. "Remove from Class") stays outlined, on the left. */
.modal-footer > .btn-danger.btn-footer-start { background: var(--surface-card); color: var(--danger-text); border-color: var(--danger-200); margin-right: auto; }
.modal-footer > .btn-danger.btn-footer-start:hover:not(:disabled) { background: var(--danger-50); }

/* Public website hero only (marketing call to action on the navy hero). */
.btn-accent {
    background: var(--accent-500);
    color: var(--primary-900);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-600); }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.icon-btn-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-500);
    border: 2px solid var(--surface-topbar);
}

/* ---------------------------------------------------------------
 * Cards
 * --------------------------------------------------------------- */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--motion-fast) var(--motion-ease),
                transform var(--motion-fast) var(--motion-ease),
                border-color var(--motion-fast) var(--motion-ease);
}
/* Hover elevation is opt-in (.card-hover), not automatic on every
   .card - most cards are static content containers, not interactive
   surfaces, and elevating on hover only makes sense where the card
   itself is the clickable/actionable unit (e.g. a PC card, a
   laboratory card). */
.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-200);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) 0;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-subtitle {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.card-body {
    padding: var(--space-5);
}

.card-body-tight {
    padding: var(--space-3) var(--space-5) var(--space-5);
}

.grid {
    display: grid;
    gap: var(--space-4);
}
.grid-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* Was referenced by assets/js/modules/maintenance.js's health tiles
   (System Health page) but never actually defined - a genuine
   pre-existing layout bug found during this pass: those 6 tiles were
   silently falling back to a single implicit column (no
   grid-template-columns at all) instead of the intended 3-column
   layout. */
.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .grid-stats, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .grid-stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Stat card */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--motion-fast) var(--motion-ease),
                transform var(--motion-fast) var(--motion-ease);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--accent-text);
}
.stat-card-icon .icon { width: 20px; height: 20px; }

.stat-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-card-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.stat-card-value.is-placeholder {
    /* 2026-11-23: was --neutral-400 (2.57:1 on a white card, below the 3:1 large-text minimum); the number also fades in from this colour */
    color: var(--text-secondary);
}

.stat-card-note {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------
 * PC cards (Computers page) - one physical laboratory workstation
 * per card, replacing the old flat table so "which student is on
 * this PC right now" is visible without a trip to Session
 * Monitoring. See assets/js/modules/computer-management.js's
 * renderComputerCard() / assets/js/modules/teacher-controls.js's
 * equivalent - both build this same markup shape.
 * --------------------------------------------------------------- */
.pc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}
.pc-card {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.pc-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pc-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--accent-text);
}
.pc-card-icon .icon { width: 20px; height: 20px; }
.pc-card-name {
    margin: 0;
    font-size: 1.05rem;
}
.pc-card-lab {
    margin: -6px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.pc-card-student {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    background: var(--surface-subtle);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--status-inuse-fg);
}
.pc-card-student-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.pc-card-student-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.pc-card-student-number {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.pc-card-note {
    margin: 0;
    padding: var(--space-3);
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border-radius: var(--radius-md);
}
.pc-card-monitoring {
    margin-top: -2px;
}
/* 2026-11-17: row actions - the buttons wrap inside their cell instead of pushing past it */
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.table td:has(> .table-actions) { min-width: 140px; }
/* 2026-11-17: what the PC's screen confirms (PC Control) */
.pc-card-screen {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.pc-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* ---------------------------------------------------------------
 * Status badges
 * --------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color var(--motion-fast) var(--motion-ease),
                color var(--motion-fast) var(--motion-ease);
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-available    { color: var(--status-available-fg);   background: var(--status-available-bg); }
.badge-inuse        { color: var(--status-inuse-fg);       background: var(--status-inuse-bg); }
.badge-idle         { color: var(--status-idle-fg);        background: var(--status-idle-bg); }
.badge-offline      { color: var(--status-offline-fg);     background: var(--status-offline-bg); }
.badge-disabled     { color: var(--status-disabled-fg);    background: var(--status-disabled-bg); }
.badge-maintenance  { color: var(--status-maintenance-fg); background: var(--status-maintenance-bg); }
/* LOCKED (a computer restricted by system/admin action) previously had
   no badge of its own and silently fell back to .badge-offline - see
   assets/js/modules/computer-management.js's computerStatusBadge() -
   making a locked PC visually indistinguishable from one that's
   simply lost its heartbeat. Teal shares no hue family with any other
   status color here, so it can never collapse into Offline (gray) or
   Disabled (red) again. */
.badge-locked       { color: var(--status-locked-fg);      background: var(--status-locked-bg); }
.badge-pending      { color: var(--status-pending-fg);     background: var(--status-pending-bg); }

/* Generic semantic aliases - same six status-color pairs above, under
   names that read naturally outside a computer-status context (e.g. a
   backup's "Success" badge, an announcement's "Active" state) instead
   of borrowing "Available"/"In Use" where those words would be odd. */
.badge-success      { color: var(--status-available-fg);   background: var(--status-available-bg); }
.badge-active       { color: var(--status-inuse-fg);       background: var(--status-inuse-bg); }
.badge-warning      { color: var(--status-idle-fg);        background: var(--status-idle-bg); }
.badge-info         { color: var(--status-inuse-fg);       background: var(--status-inuse-bg); }
.badge-error        { color: var(--status-disabled-fg);    background: var(--status-disabled-bg); }

/* Generic neutral / brand pill tag (e.g. "Soon") uses .sidebar-tag above */

/* ---------------------------------------------------------------
 * Tables
 * --------------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
.table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--surface-subtle);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr {
    transition: background var(--motion-fast) var(--motion-ease);
}
.table tbody tr:hover {
    background: var(--surface-subtle);
}

/* ---------------------------------------------------------------
 * Forms
 * --------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-4);
}
.field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}
.field-hint {
    font-size: 0.76rem;
    color: var(--text-secondary);
}
.input, .select, .textarea {
    height: 40px;
    padding: 0 var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.textarea {
    height: auto;
    min-height: 96px;
    padding: var(--space-3);
    resize: vertical;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: var(--focus-ring);
}
.input::placeholder, .textarea::placeholder {
    color: var(--text-muted);
}
.input:disabled, .select:disabled, .textarea:disabled {
    background: var(--surface-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Password show/hide (Login + Change Password forms - see
   assets/js/modules/password-toggle.js). Wraps just the <input>, not
   the whole .field, so the label/hint stay exactly where they were. */
.password-field {
    position: relative;
    width: 100%;
}
.password-field .input {
    width: 100%;
    padding-right: 40px;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.password-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}
.password-toggle-btn .icon { width: 18px; height: 18px; }
.password-toggle-btn .password-icon-hide { display: none; }
.password-toggle-btn[data-visible="true"] .password-icon-show { display: none; }
.password-toggle-btn[data-visible="true"] .password-icon-hide { display: block; }

/* ---------------------------------------------------------------
 * Alerts
 * --------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.87rem;
}
.alert p { margin: 0; color: inherit; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

.alert-info    { background: var(--status-inuse-bg);       color: var(--status-inuse-fg); }
.alert-success { background: var(--status-available-bg);   color: var(--status-available-fg); }
.alert-warning { background: var(--status-idle-bg);        color: var(--status-idle-fg); }
.alert-danger  { background: var(--danger-50);             color: var(--danger-700); }

/* ---------------------------------------------------------------
 * Empty state
 * --------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-10) var(--space-5);
    color: var(--text-secondary);
}
.empty-state-icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}
.empty-state-text {
    margin: 0;
    font-size: 0.88rem;
}
.empty-state-compact {
    padding: var(--space-6) var(--space-3);
}
.empty-state-compact .empty-state-icon {
    width: 28px;
    height: 28px;
}

/* ---------------------------------------------------------------
 * Dropdown (topbar notifications / user menu)
 * --------------------------------------------------------------- */
.dropdown {
    position: relative;
}
.dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    min-width: 240px;
    /* No ceiling previously existed, so a single long, unbroken
       notification message (e.g. a long announcement) could grow the
       whole panel wider instead of wrapping - this caps it to a
       comfortable reading width and forces normal word-wrap inside,
       on any dropdown (notifications or user menu), at any viewport. */
    max-width: min(340px, calc(100vw - var(--space-4) * 2));
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    z-index: 50;
    /* Same open/closed toggle as before (JS only ever sets
       data-open="true"/removes it - unchanged), now transitioned
       instead of a hard display:none/block cut. visibility (not just
       opacity) keeps it out of tab order and unclickable while
       closed. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity var(--motion-fast) var(--motion-ease),
                transform var(--motion-fast) var(--motion-ease),
                visibility 0s linear var(--motion-fast);
}
.dropdown-panel-right { right: 0; }
.dropdown[data-open="true"] .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

.dropdown-title {
    margin: var(--space-2) var(--space-3);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.dropdown-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    color: var(--text-primary);
}
.dropdown-item:hover {
    background: var(--surface-hover);
    text-decoration: none;
}
.dropdown-separator {
    height: 1px;
    margin: var(--space-2) var(--space-1);
    background: var(--border-subtle);
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px var(--space-2) 6px 6px;
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast);
}
.user-menu-trigger:hover { background: var(--surface-hover); }
.user-menu-info {
    display: none;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}
.user-menu-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-menu-role { font-size: 0.72rem; color: var(--text-secondary); }
@media (min-width: 640px) {
    .user-menu-info { display: flex; }
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-500);
    color: var(--neutral-0);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* v1.0.1 "profile pictures throughout": a smaller variant for dense
   table rows (Users/Sessions/Activity Logs/Audit Logs/Announcements) -
   same shared .avatar base topbar/profile already use, not a second
   avatar style. */
.avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

/* ---------------------------------------------------------------
 * Modal
 * --------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 22, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: 100;
    /* modal.js only ever toggles data-open="true"/"false" (unchanged) -
       transitioned here instead of a hard display:none/flex cut.
       pointer-events:none while closed keeps the (invisible) full-
       screen overlay from blocking clicks to the page behind it. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--motion-fast) var(--motion-ease),
                visibility 0s linear var(--motion-fast);
}
.modal-backdrop[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}
.modal {
    width: 100%;
    max-width: 420px;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.96) translateY(6px);
    transition: transform var(--motion-fast) var(--motion-ease);
}
.modal-backdrop[data-open="true"] .modal {
    transform: scale(1) translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { margin: 0; }
.modal-body { padding: var(--space-5); }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

/* ---------------------------------------------------------------
 * Loading state
 * --------------------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: skeleton-sweep 1.4s infinite;
}
@keyframes skeleton-sweep {
    100% { transform: translateX(100%); }
}

/* ---------------------------------------------------------------
 * Entrance / status-change motion utilities - opt-in, not automatic
 * on every .card/.stat-card. Meant for content that is genuinely
 * created once (a server-rendered section on page load, a freshly-
 * built PC/lab card the first time a poll discovers a NEW item) -
 * never applied to markup that gets replaced wholesale on every poll
 * tick, which would replay the entrance animation every 15-20s and
 * read as constant, distracting motion (explicitly avoided per this
 * project's animation guidelines). Durations/easing come from
 * variables.css's --motion-* tokens; prefers-reduced-motion is
 * neutralized globally in base.css.
 * --------------------------------------------------------------- */
@keyframes anim-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes anim-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes anim-pop {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}
.anim-fade-in  { animation: anim-fade-in  var(--motion-base) var(--motion-ease) backwards; }
.anim-slide-up { animation: anim-slide-up var(--motion-base) var(--motion-ease) backwards; }
.anim-pop      { animation: anim-pop      var(--motion-fast) var(--motion-ease) backwards; }

/* Stagger helper - up to 8 siblings, 40ms apart, so a grid of cards
   built once on load doesn't all pop in on the exact same frame. */
.anim-stagger > *:nth-child(1) { animation-delay: 0ms; }
.anim-stagger > *:nth-child(2) { animation-delay: 40ms; }
.anim-stagger > *:nth-child(3) { animation-delay: 80ms; }
.anim-stagger > *:nth-child(4) { animation-delay: 120ms; }
.anim-stagger > *:nth-child(5) { animation-delay: 160ms; }
.anim-stagger > *:nth-child(6) { animation-delay: 200ms; }
.anim-stagger > *:nth-child(7) { animation-delay: 240ms; }
.anim-stagger > *:nth-child(8) { animation-delay: 280ms; }

/* ---------------------------------------------------------------
 * Small helpers
 * --------------------------------------------------------------- */
.section {
    margin-bottom: var(--space-8);
}
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.section-header h2 { margin: 0; }
.section-header p { margin: 2px 0 0; }

.text-secondary { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }

/* ---------------------------------------------------------------
 * Theme toggle (Step 22, single-icon revision)
 * One reusable icon-only button - same markup/behavior wherever it
 * appears (the full topbar, next to the notification bell, and the
 * minimal shell's slim topbar for Student pages - see
 * includes/layout/topbar.php and minimal-start.php). Built on the
 * existing .icon-btn (same size/hover/focus as the bell and sidebar-
 * collapse buttons, so it reads as "one more topbar icon," not a new
 * kind of control) with both icons always in the markup and CSS
 * showing only the one for whichever theme a click would switch TO
 * (sun while dark is active, moon while light is active).
 * assets/js/modules/theme.js keeps [data-icon] in sync with the
 * actual effective theme, including the no-explicit-preference/
 * OS-default case, and updates aria-label to match.
 * --------------------------------------------------------------- */
[data-theme-toggle-btn] .theme-icon-sun,
[data-theme-toggle-btn] .theme-icon-moon {
    display: none;
}
[data-theme-toggle-btn][data-icon="sun"] .theme-icon-sun,
[data-theme-toggle-btn][data-icon="moon"] .theme-icon-moon {
    display: block;
}

/* Compact variant: the minimal shell's slim topbar (Student pages) has
   less room and no dropdown to tuck this into, so it sits directly in
   topbar-right - same control, same behavior, just icon-only. */
.theme-toggle-compact .theme-toggle-option span { display: none; }
.theme-toggle-compact .theme-toggle-option { padding: 6px; }

/* ---------------------------------------------------------------
 * Activity Logs - grouped monitoring view (Laboratory -> Computer ->
 * Student) - see assets/js/modules/activity-logs.js. Deliberately no
 * .anim-fade-in/.anim-slide-up anywhere in here: this whole subtree is
 * rebuilt wholesale on every poll tick (as often as every ~1s, see
 * that module's header comment), and those entrance utilities are
 * documented above as only for content created once - replaying them
 * this often would read as constant distracting motion. .card-hover is
 * still used on the student row below since that's a real, static
 * hover affordance (not an entrance animation) and that card's whole
 * header is genuinely the clickable expand/collapse target.
 * --------------------------------------------------------------- */
.activity-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}
.activity-lab-group + .activity-lab-group {
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
}
.activity-lab-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}
.activity-lab-header h4 {
    margin: 0;
    color: var(--text-primary);
}
.activity-lab-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.activity-computer-group {
    margin-left: var(--space-5);
    margin-bottom: var(--space-4);
}
.activity-computer-group:last-child {
    margin-bottom: 0;
}
.activity-computer-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}
.activity-computer-meta {
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
}
.activity-student-group {
    margin-left: var(--space-5);
    margin-bottom: var(--space-3);
    overflow: hidden;
}
.activity-student-group:last-child {
    margin-bottom: 0;
}
.activity-student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
.activity-student-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.activity-student-toggle-icon {
    flex: none;
    display: inline-block;
    color: var(--text-muted);
    transition: transform var(--motion-fast) var(--motion-ease);
}
.activity-student-group[data-expanded="true"] .activity-student-toggle-icon {
    transform: rotate(90deg);
}
.activity-student-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-width: 0;
}
.activity-student-name {
    font-weight: 700;
    color: var(--text-primary);
}
.activity-student-number {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.activity-student-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.activity-student-view-btn {
    flex: none;
    margin-right: var(--space-3);
}
.activity-student-body {
    padding: 0 var(--space-4) var(--space-4);
}
.activity-student-body .table-wrap {
    border-radius: var(--radius-md);
}

/* "Filtering to one student" bar - see viewStudentActivity()/
   clearStudentFilter() in activity-logs.js. Reuses the Pending status
   pair (indigo) purely as a neutral "this view is scoped" tint, not to
   claim anything is actually in a pending state. */
.activity-student-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--status-pending-bg);
    color: var(--status-pending-fg);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}
.activity-student-filter-bar strong {
    color: inherit;
}

/* ---------------------------------------------------------------
 * Compact System Status strip (Admin Overview) - replaces the old
 * "Backend Connectivity" development card. A production-appropriate,
 * small horizontal strip: three dots, no raw endpoint URLs/step
 * numbers/debug text. See assets/js/modules/health-check.js
 * (retargeted, same GET /api/health + GET /api/health/database calls)
 * and dashboard.js (the "Monitoring Active" dot, derived from whether
 * any computer is currently online).
 * --------------------------------------------------------------- */
.system-status-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-3) var(--space-5);
}
.system-status-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral-400);
    flex: none;
    transition: background-color var(--motion-fast) var(--motion-ease);
}
.status-dot[data-state="ok"]    { background: var(--status-available-fg); }
.status-dot[data-state="warn"]  { background: var(--status-idle-fg); }
.status-dot[data-state="error"] { background: var(--danger-500); }

/* Laboratory Health card breakdown chips (Admin Overview + Teacher
   Overview both use this via assets/js/modules/dashboard.js's
   renderLabHealthCard()) - a compact Available/In Use/Locked/
   Disabled/Offline row under the headline online/total count. */
.lab-health-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}
.lab-health-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--text-secondary);
}
.lab-health-chip strong {
    color: var(--text-primary);
}

/* =================================================================
 * Visual polish pass - Profile / Notifications / Admin Settings
 * -----------------------------------------------------------------
 * Presentation only, for three pages: pages/profile.php, the shared
 * Notifications page + topbar bell dropdown (pages/notifications.php,
 * assets/js/modules/notifications.js), and the Admin System
 * Configuration page (pages/admin/settings.php, assets/js/modules/
 * system-config.js). Every class below is built entirely from the
 * existing tokens defined earlier in this file/variables.css - no new
 * colors, no endpoint/behavior changes anywhere these are used.
 * ----------------------------------------------------------------- */

/* --- Profile page: hero identity card ---------------------------- */
.profile-hero {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.profile-hero-avatar {
    width: 72px;
    height: 72px;
    font-size: 26px;
    box-shadow: var(--shadow-sm);
}
.profile-hero-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
}
.profile-hero-name {
    margin: 0;
    overflow-wrap: anywhere;
}
.profile-hero-username {
    margin: 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
}

/* Generic neutral pill - a role label (Administrator/Teacher/Student)
   is identity, not a monitoring state, so it deliberately does NOT
   borrow any of the Available/In Use/etc. status-color pairs above
   (that would wrongly imply the account itself has a device status). */
.badge-neutral {
    color: var(--text-secondary);
    background: var(--surface-subtle);
}

/* --- Notifications: shared row treatment - the full Dashboard list
   AND the topbar bell dropdown both use these same classes (see
   assets/js/modules/notifications.js's renderDashboardRow()/
   renderDropdownItem()) --------------------------------------------- */
.notif-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    border-left: 3px solid transparent;
    transition: background-color var(--motion-fast) var(--motion-ease),
                border-color var(--motion-fast) var(--motion-ease),
                opacity var(--motion-fast) var(--motion-ease);
}
.notif-row:last-child {
    border-bottom: none;
}
/* Unread: a colored left border (reliably visible in both themes,
   unlike a background tint alone) plus a bold title. Read: dimmed via
   opacity, normal-weight title. Never opacity/tint as the ONLY signal. */
.notif-row-unread {
    border-left-color: var(--primary-500);
    background: var(--surface-subtle);
}
.notif-row-read {
    opacity: 0.7;
}
.notif-row-body {
    flex: 1;
    min-width: 0;
}
.notif-row-title {
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: break-word;
}
.notif-row-read .notif-row-title {
    font-weight: 400;
}
.notif-row-message {
    margin-top: var(--space-1);
    font-size: 0.87rem;
    line-height: 1.45;
    color: var(--text-secondary);
    overflow-wrap: break-word;
}
.notif-row-meta {
    margin-top: var(--space-2);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.notif-row-category {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Type/severity indicator - a colored dot (same visual language as
   .status-dot above), not an emoji, so its color always comes from a
   real token and stays legible in dark mode. */
.notif-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    flex: none;
}
.notif-dot[data-tone="danger"]  { background: var(--danger-500); }
.notif-dot[data-tone="success"] { background: var(--status-available-fg); }
.notif-dot[data-tone="warning"] { background: var(--status-idle-fg); }
.notif-dot[data-tone="info"]    { background: var(--status-inuse-fg); }
.notif-dot[data-tone="pending"] { background: var(--status-pending-fg); }
.notif-dot[data-tone="neutral"] { background: var(--status-offline-fg); }

/* Compact variant - the topbar bell dropdown (less room, no visible
   "Mark as read" button, the entire row is the click target). Same
   specificity as .notif-row (one class each) and declared after it,
   so this padding override wins for elements that carry both classes. */
.notif-row-compact {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.notif-row-compact .notif-row-title {
    font-size: 0.85rem;
}
.notif-row-compact .notif-row-message {
    font-size: 0.78rem;
}
.notif-row-compact .notif-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
}

/* --- Admin System Configuration: setting-group cards/rows ---------
   Replaces settingRow()'s previous inline
   `border-bottom:1px solid var(--border-color, #2a2a2e)` - --border-color
   was never a defined token anywhere in variables.css, so that rule
   always silently fell through to its hardcoded dark-gray fallback
   hex in EVERY theme; .sysconfig-row below uses the real
   --border-subtle token instead, so the row divider now actually
   themes correctly in light/dark like every other border in the app. */
.sysconfig-group-card {
    margin-bottom: var(--space-4);
}
.sysconfig-row {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
}
.sysconfig-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.sysconfig-row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.sysconfig-row-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-2);
}

/* ---------------------------------------------------------------
 * Role badges (Admin: User Management) - a third .badge palette,
 * distinct from the status-color pairs above, purely re-presenting
 * the same `role` string that was already rendered as plain text.
 * Navy/gold reuse --primary-* / --accent-* exactly as the rest of the
 * app already uses them (brand fill + selective accent); Student uses
 * the neutral surface/text-secondary pair rather than a fourth hue,
 * since it's the most common role and doesn't need to compete
 * visually with Administrator/Teacher. All three pairs are redefined
 * per-theme already (variables.css), so this needs no dark-mode rules
 * of its own. See assets/js/modules/user-management.js's roleBadge().
 * --------------------------------------------------------------- */
.badge-role-administrator { color: var(--primary-700); background: var(--primary-50); }
.badge-role-teacher       { color: var(--accent-700);  background: var(--accent-50); }
.badge-role-developer     { color: var(--primary-700); background: var(--primary-50); } /* 2026-11-17: same look as the other role badges */
.badge-role-student       { color: var(--text-secondary); background: var(--surface-hover); }

/* ---------------------------------------------------------------
 * Table row action menu (Admin: User Management) - a compact
 * per-row "..." menu, visually matching .dropdown-panel/.dropdown-item
 * above (same tokens, same look) but positioned with `position:fixed`
 * instead of `position:absolute`. The trigger lives inside
 * .table-wrap, and that element's `overflow-x:auto` also makes the
 * browser compute its overflow-y as auto (CSS Overflow Module spec),
 * which would silently clip an absolutely-positioned panel for any
 * row near the bottom of the table. See
 * assets/js/modules/user-management.js's initRowActionMenus(), which
 * computes .table-row-menu-panel's top/left from the trigger's own
 * getBoundingClientRect() before opening it.
 * --------------------------------------------------------------- */
.table-row-menu {
    position: relative;
    display: inline-flex;
}
.table-row-menu-panel {
    position: fixed;
    min-width: 190px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity var(--motion-fast) var(--motion-ease),
                transform var(--motion-fast) var(--motion-ease),
                visibility 0s linear var(--motion-fast),
                display var(--motion-fast) allow-discrete;
}
/* A closed panel takes no space at all (SOE Phase 2.3): left in its row it was a hidden fixed box, and a row that is
   moving (arriving, hovered) becomes the containing block of a fixed box - the hidden 190 px panel then reached past
   the right edge and the whole page scrolled sideways, which also closed a menu the moment it opened. */
.table-row-menu-panel:not([data-open="true"]) { display: none; }
/* While open, user-management.js moves the panel to <body> (so a
   transformed ancestor - e.g. a hovered folder card - can't capture its
   position:fixed) and marks the panel itself open. */
.table-row-menu[data-open="true"] .table-row-menu-panel,
.table-row-menu-panel[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}
@starting-style {
    .table-row-menu-panel[data-open="true"] { opacity: 0; transform: translateY(-6px); }
}

/* ---------------------------------------------------------------
 * Session cards (Admin/Teacher Session Monitoring - Active Sessions).
 * Same card language as the PC cards above (.card + card-specific
 * layout classes, same left-accent-border treatment as
 * .pc-card-student) but shaped around a session's own fields
 * (student first, not device first). Used only where
 * #activeSessionsBody is a <div> rather than a <table> - see
 * assets/js/modules/session-monitoring.js's loadActive(). No
 * .anim-* entrance classes anywhere here: this grid is rebuilt
 * wholesale on every ~15s poll tick, and those utilities are
 * documented above as only for content created once.
 * --------------------------------------------------------------- */
.session-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-4);
}
.session-card {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-left: 3px solid var(--status-inuse-fg);
}
.session-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}
.session-card-student {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.session-card-student-number {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.session-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.session-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}
.session-card-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 96px;
}
.session-card-meta-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.session-card-meta-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---------------------------------------------------------------
 * Visual polish pass additions (Teacher Overview / Admin Emergency
 * Access / Admin Reports / Admin Laboratories) - appended at the end
 * of this file per that pass's own ground rule (only append here,
 * never edit an existing rule above, since other pages' CSS work is
 * happening in this same file concurrently). Every rule below reads
 * exclusively from the existing design tokens (variables.css) and
 * reuses existing component primitives (.card/.pc-card/.badge/etc.)
 * wherever one already fit - these are the few cases where nothing
 * existing quite covered the need.
 * --------------------------------------------------------------- */

/* Teacher Overview "Quick Links" row (pages/teacher/index.php) - a
   .card wrapped in an <a> so the whole tile is clickable; only a
   link-reset is needed; hover elevation itself already comes free
   from the existing .card-hover class applied alongside this one. */
.quick-link-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Admin Reports (pages/admin/reports.php) - one shared filter-bar
   layout for all four report sections (Laboratory Health/Computer/
   Session/Activity) so their search/select/date controls can never
   drift out of alignment with each other. Same visual spacing the
   inline style each filter bar used before this pass had, plus
   align-items so a mix of text/select/date inputs of slightly
   different intrinsic heights still lines up on one row. */
.report-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0 var(--space-4);
}

/* SOE Batch 1 (Feature 4) - Reports: category tabs, labelled filters, summary strip, result line */
.report-intro { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4);
    background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 0.88rem; }
.report-intro p { margin: 0; max-width: 90ch; }
.report-intro .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--accent-600); }
.report-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-4); }
.report-tab {
    font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
    padding: var(--space-3); background: var(--surface-card); border: 1px solid var(--border-subtle); border-bottom: 3px solid transparent;
    border-radius: var(--radius-md);
}
.report-tab:hover { background: var(--surface-hover); }
.report-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.report-tab[aria-selected="true"] { border-bottom-color: var(--accent-500); box-shadow: var(--shadow-sm); }
.report-tab-label { font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
.report-tab-hint { font-size: 0.78rem; color: var(--text-secondary); }
.report-tab-count:not(:empty) { font-size: 0.72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-subtle);
    color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.report-filters {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); align-items: end;
    padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle);
}
.report-filters .field { margin: 0; }
.report-filters .report-filter-wide { grid-column: span 2; }
.report-reset { justify-self: start; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); padding: var(--space-4) var(--space-5) 0; }
.report-summary:empty { display: none; }
.report-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border-radius: var(--radius-md);
    background: var(--surface-subtle); border-top: 3px solid var(--primary-500); }
.report-stat-value { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--text-primary); }
.report-stat-label { font-size: 0.76rem; color: var(--text-secondary); }
.report-result { margin: var(--space-3) var(--space-5); font-size: 0.82rem; color: var(--text-secondary); }
.report-result.is-truncated { color: var(--status-idle-fg); font-weight: 600; }
.report-table th.num, .report-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
    .report-filters { padding: var(--space-3); }
    .report-filters .report-filter-wide { grid-column: 1 / -1; }
    .report-summary { padding: var(--space-3) var(--space-3) 0; }
    .report-result { margin: var(--space-3); }
}

/* ---------------------------------------------------------------
 * System Announcement banner (web) - assets/js/modules/
 * announcement-banner.js. Previously a plain .alert-info (generic
 * blue "info" wash + a loudspeaker emoji), inconsistent with the rest
 * of the redesigned app and with the C# Agent's own already-reskinned
 * AnnouncementBannerForm. Same navy icon-chip + small gold accent
 * border language as PC cards/stat cards elsewhere - gold used only
 * as a thin accent border, never a large fill.
 * --------------------------------------------------------------- */
.announcement-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    position: relative;
    margin-bottom: var(--space-4);
    padding: var(--space-4) var(--space-8) var(--space-4) var(--space-4);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-500);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.announcement-banner-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--accent-text);
}
.announcement-banner-icon .icon { width: 18px; height: 18px; }
.announcement-banner-body {
    flex: 1;
    min-width: 0;
}
.announcement-banner-title {
    margin: 0 0 2px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.announcement-banner-message {
    margin: 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
    word-break: break-word;
}
.announcement-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    opacity: 0.8;
    transition: color var(--motion-fast) var(--motion-ease), opacity var(--motion-fast) var(--motion-ease);
}
.announcement-banner-close:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* ---------------------------------------------------------------
 * v1.0.1 "real data graphs" - shared chart primitives rendered by
 * assets/js/charts.js (window.LabPulse.charts.donut/line/bar). Every
 * chart lives inside a plain .card wrapper on the page itself (no
 * card-level styling here); these rules only style what charts.js
 * actually generates - the SVGs, their legends, and the bar-list
 * variant used for Laboratory Utilization / Top Visited Domains.
 * --------------------------------------------------------------- */
.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
    text-align: center;
}
.chart-empty-state svg { color: var(--text-muted); opacity: 0.6; }
.chart-empty-state p { margin: 0; font-size: 0.85rem; }

.chart-donut-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
}
.chart-donut-total {
    font-size: 1.4rem;
    font-weight: 700;
    fill: var(--text-primary);
}
.chart-donut-total-label {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    fill: var(--text-muted);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.chart-legend-item strong { color: var(--text-primary); }
.chart-legend-swatch {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
}

.chart-line-wrap { width: 100%; }
.chart-line { display: block; width: 100%; height: auto; }
.chart-axis-label {
    font-size: 9px;
    fill: var(--text-muted);
}

.chart-bar-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.chart-bar-row {
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr) minmax(80px, 2fr) auto;
    align-items: center;
    gap: var(--space-3);
}
.chart-bar-icon {
    flex: none;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
}
.chart-bar-icon svg { width: 16px; height: 16px; }
.chart-bar-label {
    font-size: 0.83rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chart-bar-track {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--border-subtle);
    overflow: hidden;
}
.chart-bar-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width var(--motion-slow) var(--motion-ease);
}
.chart-bar-value {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .chart-bar-row {
        grid-template-columns: auto 1fr auto;
        row-gap: var(--space-1);
    }
    .chart-bar-track { grid-column: 1 / -1; }
}

/* v1.0.1: Student Profile's "Back to Dashboard" link (pages/profile.php,
   the one page still using the sidebar-less minimal shell). */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.back-link:hover {
    color: var(--primary-500);
    text-decoration: none;
}

/* ---------------------------------------------------------------
 * Info note - plain, calm explanatory text (not a warning/caution).
 * For background/context copy that doesn't warrant a bordered,
 * backgrounded .alert box (e.g. "here's what this control does").
 * Sits inline above the content it explains, muted-toned, with a
 * small inline info glyph. Added for Teacher > PC Controls; safe to
 * reuse anywhere plain informational text is needed instead of an
 * alert. Deliberately not touching .alert/.alert-info, which is also
 * used unchanged elsewhere.
 * --------------------------------------------------------------- */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}
.info-note .icon {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--text-muted);
}
.info-note p {
    margin: 0;
}
.info-note a { text-decoration: underline; text-underline-offset: 2px; } /* a link inside text must not rely on color alone */
.back-link-icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------
 * v1.0.1 "announcement creator info" - compact "Posted by X · Role ·
 * <time>" line inside .announcement-banner (see assets/js/modules/
 * announcement-banner.js's metaLine()). Appended-only, true end of
 * file per this pass's concurrent-agent convention - never reorders
 * or edits any rule above.
 * --------------------------------------------------------------- */
.announcement-banner-meta {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-word;
}

/* v1.0.1 "profile pictures throughout": generic avatar+name pairing for
   table cells / card headers that don't already have their own flex
   container (Users Management, Session Monitoring, Audit Logs - Activity
   Logs' .activity-student-info was already flex and reuses it as-is). */
.cell-avatar-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ---------------------------------------------------------------
 * v1.0.1 UI/UX polish pass - small icon badges added to previously
 * icon-less card/tile headers (Database Backup & Restore's "Database
 * Status" card, System Health & Recovery's health tiles, System
 * Configuration's per-group cards) and a small per-type icon added to
 * notification rows (bell dropdown + full Notifications page). Purely
 * decorative additions - no existing rule above is edited or
 * reordered; appended-only, true end of file per this pass's
 * concurrent-agent convention.
 * --------------------------------------------------------------- */
.card-header-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--accent-text);
    flex: none;
}
.card-header-icon .icon { width: 18px; height: 18px; }

.notif-type-icon-inline {
    display: inline-flex;
    vertical-align: -3px;
    margin-right: 6px;
}
.notif-type-icon-inline .icon { width: 14px; height: 14px; }
.notif-type-icon-inline[data-tone="danger"]  { color: var(--danger-500); }
.notif-type-icon-inline[data-tone="success"] { color: var(--status-available-fg); }
.notif-type-icon-inline[data-tone="warning"] { color: var(--status-idle-fg); }
.notif-type-icon-inline[data-tone="info"]    { color: var(--status-inuse-fg); }
.notif-type-icon-inline[data-tone="pending"] { color: var(--status-pending-fg); }
.notif-type-icon-inline[data-tone="neutral"] { color: var(--status-offline-fg); }

/* ---------------------------------------------------------------
 * Student Folder Grid (Activity Logs + User Management) - one folder
 * card per Student account. Reuses the exact same design tokens/card
 * language as .session-card above (border-radius/shadow/hover already
 * come from the shared .card/.card-hover base class this extends),
 * just a grid of buttons instead of rows, and a folder glyph instead of
 * a left accent bar. Responsive via auto-fill/minmax - no breakpoint
 * media queries needed, matches .session-card-grid's own approach.
 * --------------------------------------------------------------- */
.activity-folder-grid,
.student-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--space-4);
}
.student-folder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: box-shadow var(--motion-fast) var(--motion-ease),
                transform var(--motion-fast) var(--motion-ease),
                border-color var(--motion-fast) var(--motion-ease);
}
.student-folder-card:hover,
.student-folder-card:focus-visible {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
    transform: translateY(-2px);
}
.student-folder-card:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}
.student-folder-icon {
    color: var(--accent-text);
    opacity: 0.55;
}
.student-folder-icon .icon { width: 40px; height: 40px; }
.student-folder-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.15rem;
    /* Small positive offset (not the card's own default --space-2 gap
       alone) so the avatar rests a bit lower than the folder icon with
       a clear, balanced gap between them, instead of overlapping it. */
    margin-top: var(--space-1);
    border: 3px solid var(--surface-card);
    box-shadow: var(--shadow-sm);
}
.student-folder-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: break-word;
}
.student-folder-number {
    font-size: 0.76rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.student-folder-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-text);
}
.student-folder-latest {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow-wrap: break-word;
}

/* User Management's own folder cards add one more row (status badge +
   management actions) below the same base card above - see
   pages/admin/users.php / assets/js/modules/user-management.js. */
.user-folder-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

/* ---------------------------------------------------------------
 * Feature #40: Admin Live Computer Monitor (index.php,
 * assets/js/modules/live-monitor.js). Appended per this file's
 * append-only rule; built only from existing tokens and the existing
 * .stat-card / .pc-card / .badge / .session-card-meta primitives.
 * Cards are updated in place by the poll (never rebuilt wholesale), so
 * no entrance animation here.
 * --------------------------------------------------------------- */
.live-monitor-header {
    align-items: flex-end;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.live-monitor-header p { max-width: 72ch; }
.live-monitor-sync {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.live-monitor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
}
.live-monitor-toolbar .field { margin-bottom: 0; min-width: 180px; }
.live-monitor-toolbar .live-monitor-search { flex: 1; min-width: 220px; }
.live-monitor-error { margin-bottom: var(--space-4); }

/* Counter cards are buttons: clicking one filters the list to it. */
.live-stat {
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    width: 100%;
}
.live-stat .stat-card-value { font-variant-numeric: tabular-nums; }
.live-stat[aria-pressed="true"] {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 1px var(--accent-500), var(--shadow-sm);
}
.live-stat:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.live-monitor-result {
    margin: var(--space-4) 0 var(--space-3);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Computer cards */
.live-monitor-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.live-pc-card { gap: var(--space-3); }
.live-pc-card.is-offline .pc-card-icon { background: var(--surface-subtle); color: var(--text-muted); }
.live-pc-card.is-attention { border-color: var(--status-idle-fg); }

/* SOE Batch 1 - Live Laboratory Monitoring tiles, PC IP, Emergency Access in use */
.live-lab-status { margin: var(--space-4) 0 var(--space-4); }
.live-lab-status-title { margin: 0 0 var(--space-2); font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.live-lab-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.live-lab-tile {
    font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
    display: flex; flex-direction: column; gap: 4px; padding: var(--space-3);
    background: var(--surface-card); border: 1px solid var(--border-subtle); border-left: 4px solid var(--status-available-fg);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.live-lab-tile[data-lab-status="CRITICAL"] { border-left-color: var(--status-disabled-fg); }
.live-lab-tile[data-lab-status="MAINTENANCE"] { border-left-color: var(--status-maintenance-fg); }
.live-lab-tile[aria-pressed="true"] { border-color: var(--accent-500); box-shadow: 0 0 0 1px var(--accent-500), var(--shadow-sm); }
.live-lab-tile:hover { background: var(--surface-hover); }
.live-lab-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.live-lab-tile-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.live-lab-tile-name { font-weight: 600; overflow-wrap: anywhere; }
.live-lab-tile-value { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.live-lab-tile-value strong { font-size: 1.25rem; }
.live-lab-tile-counts, .live-lab-tile-note { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pc-card-ip { margin: 2px 0 0; font-size: 0.78rem; color: var(--text-secondary); }
.pc-card-ip-value { font-family: var(--font-mono, ui-monospace, monospace); color: var(--text-primary); }
.live-pc-card.is-emergency { border-color: var(--danger-600); }
.live-pc-ea {
    display: flex; flex-direction: column; gap: 3px; padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md); background: var(--surface-subtle); border: 1px solid var(--border-subtle); font-size: 0.8rem;
}
.live-pc-ea p { margin: 0; }
.live-pc-ea-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-weight: 600; }
.live-pc-ea-account { overflow-wrap: anywhere; }
.live-pc-ea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.live-pc-ea-problem { color: var(--danger-text); font-weight: 600; }
.live-pc-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-1);
}
.live-pc-alert {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--status-idle-fg);
    background: var(--status-idle-bg);
    border-radius: var(--radius-md);
}
.live-pc-class {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent-text);
}
.live-pc-session-time {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.live-pc-session-time strong { color: var(--text-primary); }
.live-pc-section-label {
    margin: 0 0 var(--space-1);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.live-pc-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.live-pc-activity-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: 0.8rem;
}
.live-pc-domain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-primary);
}
.live-pc-domain-icon { display: inline-flex; flex: none; }
.live-pc-domain-icon svg { width: 16px; height: 16px; }
.live-pc-domain-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-pc-domain-time {
    flex: none;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.live-pc-empty {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.live-pc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}
.live-pc-seen {
    font-size: 0.76rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.live-pc-seen strong { color: var(--text-primary); font-weight: 600; }

/* Details modal - wider than the default form modal, body scrolls. */
.live-detail-modal {
    max-width: 640px;
    max-height: calc(100vh - 2 * var(--space-4));
    display: flex;
    flex-direction: column;
}
.live-detail-modal .modal-header { align-items: flex-start; }
.live-detail-modal .modal-header .card-subtitle { margin: 2px 0 0; }
.live-detail-modal .modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.live-detail-section h4 {
    margin: 0 0 var(--space-2);
    font-size: 0.85rem;
}
.live-detail-section h4 small { font-weight: 500; color: var(--text-muted); }
.live-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-3);
}
.live-detail-grid .session-card-meta-value small { font-weight: 500; color: var(--text-secondary); }
.live-detail-text {
    margin: 0 0 var(--space-2);
    font-size: 0.84rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.live-detail-hint {
    margin: var(--space-2) 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
}
@media (max-width: 560px) {
    .live-monitor-toolbar .field { min-width: 100%; }
    .live-monitor-sync { white-space: normal; }
}
@media (max-width: 560px) {
    .grid-stats.live-monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-stat { padding: var(--space-4); }
}

/* ---------------------------------------------------------------
 * Feature #40 refinement: Live Computer Monitor on the Computers page
 * (management actions, "Show more"), compact Overview counters as
 * links, and the shared scheduler's "session ended" notice
 * (assets/js/live-refresh.js). Appended per this file's append-only rule.
 * --------------------------------------------------------------- */
.live-monitor-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}
a.stat-card {
    color: inherit;
    text-decoration: none;
}
a.stat-card:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.live-pc-actions {
    margin-top: 0;
    padding-top: var(--space-2);
}
.live-monitor-more {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
}
.live-detail-modal .modal-footer {
    justify-content: space-between;
    flex-wrap: wrap;
}
.live-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.live-session-ended {
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    max-width: 360px;
    z-index: 300;
    box-shadow: var(--shadow-lg);
}
.live-session-ended a { color: inherit; font-weight: 700; }
@media (max-width: 560px) {
    .live-session-ended { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); }
}
/* ---------------------------------------------------------------
 * Feature #42: Full My Profile + Secure Email Change (pages/profile.php,
 * assets/js/modules/profile.js). Appended per this file's append-only
 * rule; existing tokens only, so dark mode follows automatically.
 * --------------------------------------------------------------- */
/* Fills the dashboard content area (no centred max-width): one column on
   phones/tablets, two balanced columns once each can hold a full card -
   left = who you are (profile, account info, image), right = sign-in &
   security (email, password, trusted devices). */
.profile-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.profile-page > .alert { margin: 0; }
.profile-layout,
.profile-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
}
@media (min-width: 1100px) {
    .profile-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start; /* each column keeps its natural height - no stretched cards */
    }
}
.profile-card { margin: 0; }
.profile-card .card-header { gap: var(--space-3); flex-wrap: wrap; }
/* A card that is only its header until opened (Change Password). */
.profile-card-compact > .card-header { padding-bottom: var(--space-5); }
.profile-image-form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.profile-image-form .field { width: 100%; margin: 0; }
.profile-image-form .alert { width: 100%; margin: 0; }
.profile-inline-alert { margin: 0 var(--space-5) var(--space-5); }
.profile-edit-form { border-top: 1px solid var(--border-subtle); }
.profile-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
}
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4) var(--space-5);
    margin: 0;
}
.profile-info-row { min-width: 0; }
.profile-info-row dt {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.profile-info-row dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.profile-info-note { font-size: 0.74rem; color: var(--text-muted); }
.profile-email-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}
.profile-email-value { font-weight: 600; overflow-wrap: anywhere; }
.profile-email-change {
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.profile-email-change .alert { margin: 0; }
.profile-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.profile-steps li { display: inline-flex; align-items: center; gap: var(--space-2); }
.profile-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
}
.profile-steps li.is-current { color: var(--text-primary); font-weight: 700; }
.profile-steps li.is-current .profile-step-num { background: var(--primary-500); border-color: var(--primary-500); color: #fff; }
.profile-steps li.is-done .profile-step-num { background: var(--status-available-bg); border-color: var(--status-available-fg); color: var(--status-available-fg); }
.profile-steps li.is-skipped { text-decoration: line-through; opacity: 0.6; }
.profile-step-intro { margin: 0; font-size: 0.86rem; color: var(--text-secondary); }
.profile-step-note { margin: 0; }
.profile-code-input {
    max-width: 220px;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    letter-spacing: 0.3em;
    text-align: center;
}
@media (max-width: 560px) {
    .profile-form-actions { justify-content: stretch; }
    .profile-form-actions .btn { flex: 1 1 auto; }
}
/* ---------------------------------------------------------------
 * Inquiry Inbox (Features #56-58) - pages/admin/inquiries.php
 * Status badges reuse the existing status colour tokens (both themes):
 * New = blue, In Progress = amber, Resolved = green, Closed = gray.
 * --------------------------------------------------------------- */
.inquiry-badge-new         { color: var(--status-inuse-fg);     background: var(--status-inuse-bg); }
.inquiry-badge-in_progress { color: var(--status-idle-fg);      background: var(--status-idle-bg); }
.inquiry-badge-resolved    { color: var(--status-available-fg); background: var(--status-available-bg); }
.inquiry-badge-closed      { color: var(--status-offline-fg);   background: var(--status-offline-bg); }
/* Post-SOE #2: archived = soft-archived closed reports (neutral, dashed so it never reads as a live status) */
.inquiry-badge-archived    { color: var(--text-secondary); background: var(--surface-subtle); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.inquiry-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.inquiry-summary-item[data-view-chip] { border-style: dashed; }
.report-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border-subtle); background: var(--surface-subtle); }
.report-bulk-count { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 6.5em; }
.report-bulk-spacer { flex: 1 1 auto; }
.report-select-cell { width: 2.5rem; text-align: center; }
.report-select-cell input { width: 1.05rem; height: 1.05rem; cursor: pointer; accent-color: var(--accent-500); }
.report-select-cell input:disabled { cursor: not-allowed; opacity: 0.35; }
.report-row-archived td { color: var(--text-secondary); }
.report-closed-note { margin-bottom: var(--space-3); }
/* Post-SOE #7: shown only while the 1-second live pulse cannot reach the server */
.live-pulse-notice {
    position: fixed; left: var(--space-4); bottom: var(--space-4); z-index: 210;
    padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
    background: var(--surface-card); color: var(--text-secondary); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md);
    font-size: 0.85rem;
}
.live-pulse-notice[hidden] { display: none; }
/* Post-SOE #6: Maintenance Mode - Computer Maintenance filters */
.cm-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.cm-filters .input { flex: 1 1 220px; min-width: 0; }
.cm-filters .select { flex: 0 1 200px; }
/* Post-SOE #6: Edit Computer - the Agent-detected address */
.computer-ip-detected { margin: 0 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-subtle); border: 1px solid var(--border-subtle); }
.computer-ip-detected p { margin: 0; }
.computer-ip-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-bottom: 4px !important; }
.computer-ip-value { font-family: var(--font-mono); font-size: 1rem; font-variant-numeric: tabular-nums; }
.inquiry-summary-item {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-4); border-radius: var(--radius-lg); cursor: pointer;
    background: var(--surface-card); border: 1px solid var(--border-subtle); color: var(--text-primary);
    font: inherit; text-align: left; transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.inquiry-summary-item strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.inquiry-summary-item:hover { box-shadow: var(--shadow-sm); }
.inquiry-summary-item[aria-pressed="true"] { border-color: var(--accent-500); box-shadow: 0 0 0 1px var(--accent-500); }
.inquiry-filters { border-bottom: 1px solid var(--border-subtle); }
.inquiry-filters .field { margin-bottom: var(--space-3); }
.inquiry-filter-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.inquiry-filter-row .select { min-width: 170px; }
.inquiry-filter-row .input[type="date"] { max-width: 170px; }
.inquiry-filter-row .field-hint { margin: 0; }
#inquiryResultCount { margin: var(--space-3) 0 0; }
.inquiry-ref { font-family: var(--font-mono); font-size: 0.82rem; white-space: nowrap; }
.inquiry-cell-subject { max-width: 360px; overflow-wrap: anywhere; }
.inquiry-cell-email { overflow-wrap: anywhere; }
.inquiry-pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-3) 0 0; }
/* Inquiry Details modal: never taller than the screen. The header (title +
   close) stays put; only the body scrolls. Scoped to this modal - the
   shared .modal component used elsewhere is unchanged. */
.inquiry-modal {
    max-width: 720px;
    width: 100%;
    max-height: 90vh;            /* fallback */
    max-height: 90dvh;           /* follows mobile browser bars */
    display: flex;
    flex-direction: column;
    /* As a flex item of .modal-backdrop it must be allowed to shrink to the
       screen (default min-width:auto let its widest unbroken text - e.g. an
       email address - widen the whole page on phones, even while closed). */
    min-width: 0;
    overflow-wrap: anywhere;
}
/* The inbox's "View" buttons carry an absolutely positioned .sr-only label; making the
   scroll wrapper their containing block keeps that label inside its clip, so a narrow
   screen scrolls the table instead of widening the whole page. */
#inquiryInboxApp .table-wrap { position: relative; }
.inquiry-modal:focus { outline: none; }
.inquiry-modal > .modal-header { flex: none; gap: var(--space-3); }
.inquiry-modal > .modal-header > div { min-width: 0; }
.inquiry-modal > .modal-header h3 { overflow-wrap: anywhere; }
.inquiry-modal > .modal-body {
    flex: 1 1 auto;
    min-height: 0;               /* lets the flex child shrink and scroll */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain; /* scrolling the modal never scrolls the page behind */
    -webkit-overflow-scrolling: touch;
}
/* Background scroll lock while the modal is open (scroll position is kept). */
html.inquiry-modal-open, html.inquiry-modal-open body { overflow: hidden; }
@media (max-width: 520px) {
    .modal-backdrop:has(.inquiry-modal) { padding: var(--space-2); }
    .inquiry-modal { max-height: 94vh; max-height: 94dvh; }
    .inquiry-modal > .modal-body { padding: var(--space-4); }
}
.inquiry-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-4); }
.inquiry-meta dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.inquiry-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.inquiry-section-title { margin: var(--space-5) 0 var(--space-2); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.inquiry-message {
    white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; max-height: 320px; overflow: auto;
    padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-subtle); border: 1px solid var(--border-subtle);
}
.inquiry-status-form { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; }
.inquiry-status-form .field { margin: 0; }
.inquiry-history { list-style: none; margin: 0; padding: 0 0 0 var(--space-4); border-left: 2px solid var(--border-subtle); display: grid; gap: var(--space-3); }
.inquiry-history li { position: relative; }
.inquiry-history li::before { content: ""; position: absolute; left: calc(-1 * var(--space-4) - 6px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-500); }
.inquiry-history-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.inquiry-history-note { font-size: 0.86rem; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inquiry-emails { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); font-size: 0.88rem; }
@media (max-width: 1100px) {
    .inquiry-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .inquiry-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inquiry-status-form { grid-template-columns: minmax(0, 1fr); }
}
/* Feature #59B - inquiry conversation, replies and internal notes */
.inquiry-conversation { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.inquiry-convo { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--surface-card); }
.inquiry-convo-public { border-left: 3px solid var(--accent-500); }
.inquiry-convo-internal { border: 1px dashed var(--status-idle-fg); background: var(--status-idle-bg); }
.inquiry-convo-status { background: var(--surface-subtle); }
.inquiry-convo-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.inquiry-convo-head strong { display: inline-flex; align-items: center; gap: 6px; }
.inquiry-convo-body { margin-top: var(--space-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.inquiry-vis { display: inline-block; padding: 0 8px; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: 1px; }
.inquiry-vis-public { color: var(--status-available-fg); background: var(--status-available-bg); }
.inquiry-vis-internal { color: var(--status-idle-fg); background: var(--status-idle-bg); }
.inquiry-reply-form { display: grid; gap: var(--space-3); }
.inquiry-reply-form .field { margin: 0; }
.inquiry-reply-type { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.inquiry-reply-option { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); cursor: pointer; }
.inquiry-reply-option:has(input:checked) { border-color: var(--accent-500); box-shadow: 0 0 0 1px var(--accent-500); }
.inquiry-reply-option input { margin-top: 3px; }
.inquiry-reply-option > span { display: grid; gap: 2px; }
.inquiry-reply-form button { justify-self: start; }
.inquiry-note-public { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: 0.86rem; }
@media (max-width: 760px) { .inquiry-reply-type { grid-template-columns: 1fr; } }
/* ---------------------------------------------------------------
 * Developer pages (Features #60-67) - pages/developer/*.php.
 * Built only from existing tokens/components (cards, stat cards,
 * badges, tables, modals); light/dark follow the shared variables.
 * --------------------------------------------------------------- */
.dev-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); padding: var(--space-5); border-top: 3px solid var(--accent-500); }
.dev-hero-text { min-width: 0; flex: 1 1 320px; }
.dev-hero h2 { margin: 2px 0 var(--space-2); }
.dev-hero .card-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dev-eyebrow { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-700); }
.dev-view-switch { display: grid; gap: var(--space-1); min-width: min(100%, 280px); }
.dev-view-switch label { font-size: 0.82rem; font-weight: 600; }
.dev-view-switch-row { display: flex; gap: var(--space-2); }
.dev-view-switch-row .select { flex: 1 1 auto; min-width: 0; }
.dev-rank-badge.dev-rank-lead    { color: var(--accent-800); background: var(--accent-50); border: 1px solid var(--accent-200); }
.dev-rank-badge.dev-rank-senior  { color: var(--primary-700); background: var(--primary-50); border: 1px solid var(--primary-200); }
.dev-rank-badge.dev-rank-support { color: var(--text-secondary); background: var(--surface-hover); border: 1px solid var(--border-subtle); }
.dev-stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.dev-activity { list-style: none; margin: 0; padding: 0; display: grid; }
.dev-activity li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); align-items: start; }
.dev-activity li:last-child { border-bottom: 0; }
.dev-activity .field-hint { grid-column: 2; }
.dev-activity-text { display: block; min-width: 18ch; overflow-wrap: break-word; line-height: 1.45; }
.dev-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-4); }
.dev-facts dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.dev-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.dev-perm-list { list-style: none; margin: 0; padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.dev-filters .field { flex: 1 1 260px; margin: 0; }
.dev-filters .field-hint { margin: 0; }
.dev-filters > p.field-hint { flex-basis: 100%; }
.dev-modal { max-width: 520px; width: 100%; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; min-width: 0; }
.dev-modal-wide { max-width: 720px; }
.dev-modal:focus { outline: none; }
.dev-modal > .modal-body, .dev-modal > form > .modal-body { overflow-y: auto; min-height: 0; }
.dev-modal > form { display: flex; flex-direction: column; min-height: 0; }
.dev-form { display: grid; gap: var(--space-3); }
.dev-form .field { margin: 0; }
.dev-check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 0.88rem; }
.dev-check input { margin-top: 3px; }
.dev-secret { font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.35rem; letter-spacing: 0.06em; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-subtle); border: 1px dashed var(--border-strong, var(--border-subtle)); text-align: center; user-select: all; overflow-wrap: anywhere; }
.dev-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin-bottom: var(--space-3); }
.dev-inline-form .field { flex: 1 1 220px; margin: 0; }
.dev-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.dev-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: 0.88rem; overflow-wrap: anywhere; }
.dev-rank-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.dev-rank-card.dev-rank-lead    { border-left: 4px solid var(--accent-500); }
.dev-rank-card.dev-rank-senior  { border-left: 4px solid var(--primary-400); margin-left: var(--space-5); }
.dev-rank-card.dev-rank-support { border-left: 4px solid var(--border-subtle); margin-left: calc(var(--space-5) * 2); }
.dev-rank-card .card-header h3 { margin: 0 0 var(--space-1); }
.dev-rank-level { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.dev-member-list { list-style: none; margin: 0; padding: 0; }
.dev-member-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.dev-member-list li:last-child { border-bottom: 0; }
.dev-perm-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dev-picker { list-style: none; margin: 0; padding: var(--space-2); display: grid; gap: var(--space-1); }
.dev-picker-item { width: 100%; display: grid; gap: 4px; text-align: left; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
.dev-picker-item:hover { background: var(--surface-hover); }
.dev-picker-item[aria-pressed="true"] { border-color: var(--accent-500); background: var(--accent-50); }
.dev-perm-tools { display: flex; gap: var(--space-2); }
.dev-perm-group { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4) var(--space-3); margin: 0 0 var(--space-4); min-width: 0; }
.dev-perm-group legend { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); padding: 0 var(--space-2); }
.dev-perm-row { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
.dev-perm-row:last-child { border-bottom: 0; }
.dev-perm-row > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.dev-perm-row input { margin-top: 4px; }
.dev-perm-row.is-ineligible { opacity: 0.6; }
.dev-perm-row code, .dev-perm-list code { font-size: 0.76rem; color: var(--text-secondary); }
.dev-profile-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dev-visibility { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.dev-visibility legend { font-weight: 600; margin-bottom: var(--space-2); }
.dev-public-preview { display: flex; justify-content: center; }
.dev-public-preview .public-dev { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-5); max-width: 260px; width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--surface-card); }
.dev-public-preview .public-dev-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.dev-public-preview h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.dev-public-preview .public-dev-rank { margin: 2px 0 0; font-size: 0.8rem; font-weight: 700; color: var(--accent-700); }
.dev-public-preview .public-dev-bio { margin: var(--space-2) 0 0; font-size: 0.88rem; color: var(--text-secondary); overflow-wrap: anywhere; white-space: pre-line; }
.dev-preview-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 2px dashed var(--accent-500); background: var(--accent-50); }
.dev-preview-banner > div { flex: 1 1 280px; min-width: 0; }
.dev-preview-banner p { margin: 0; }
.dev-preview-title { font-weight: 700; font-size: 1.05rem; }
.dev-preview-layout { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dev-preview-nav ul { list-style: none; margin: 0; padding: var(--space-2) var(--space-4) var(--space-4); display: grid; gap: var(--space-1); }
.dev-preview-nav li { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--text-secondary); background: var(--surface-subtle); font-size: 0.88rem; }
.dev-preview-main { min-width: 0; }
.dev-preview-hidden { display: inline-block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); padding: 2px var(--space-2); border-radius: var(--radius-sm, 4px); border: 1px dashed var(--border-subtle); }
.dev-view-card { color: inherit; text-decoration: none; transition: border-color var(--motion-fast) var(--motion-ease); }
.dev-view-card:hover, .dev-view-card:focus-visible { border-color: var(--accent-500); }
.dev-view-card h3 { margin: 0 0 var(--space-1); }
@media (max-width: 900px) {
    .dev-perm-layout, .dev-profile-layout, .dev-preview-layout { grid-template-columns: minmax(0, 1fr); }
    .dev-rank-card.dev-rank-senior, .dev-rank-card.dev-rank-support { margin-left: 0; }
}
/* As on the Inquiries page: row buttons carry an absolutely positioned
   .sr-only label, so each scroll wrapper must be its containing block or
   the label widens the whole page on narrow screens. */
#devAccountsApp .table-wrap, #devRanksApp .table-wrap, #devAuditApp .table-wrap { position: relative; }
.dev-preview-banner p { color: var(--text-primary); }

/* ---------------------------------------------------------------
 * Phase 7A - Developer oversight + operational views.
 * --------------------------------------------------------------- */
.dev-sync { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.82rem; color: var(--text-secondary); }
#devGlobalOverview > .dev-sync { margin-bottom: var(--space-4); }
.is-stale [data-dev-global-body], .is-stale #devActBody { opacity: 0.6; }
.dev-global-section .section-header { margin-bottom: var(--space-3); }
.dev-global-section .card { margin-top: var(--space-4); }
.stat-card.is-good .stat-card-value { color: var(--status-available-fg); }
.stat-card.is-warn .stat-card-value { color: var(--status-idle-fg); }
.dev-role-administrator { color: var(--primary-700); background: var(--primary-50); }
.dev-role-teacher       { color: var(--accent-700);  background: var(--accent-50); }
.dev-role-student       { color: var(--text-secondary); background: var(--surface-hover); }
.dev-role-developer     { color: var(--status-maintenance-fg); background: var(--status-maintenance-bg); }
.dev-role-system        { color: var(--status-offline-fg); background: var(--status-offline-bg); }
.dev-op-banner { flex-wrap: wrap; }
.dev-op-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dev-op-stack { display: grid; gap: var(--space-4); }
.dev-op-panel .card-header h3 { margin: 0; }
.dev-op-tools { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.dev-op-locked { margin: 0; display: flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); }
.dev-op-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dev-op-link h3 { margin: 0 0 var(--space-1); }
.dev-op-lab { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-top: var(--space-4); overflow: hidden; }
.dev-op-lab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-subtle); }
.dev-op-lab-head h4 { margin: 0; display: flex; align-items: center; gap: var(--space-2); }
.dev-op-lab-head .field-hint { margin: 2px 0 0; }
.dev-op-lab .table-wrap { border: 0; border-radius: 0; }
.dev-op-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev-op-ok { margin-bottom: var(--space-3); }
.dev-op-student { display: grid; gap: var(--space-4); }
.dev-op-student h4, [data-op-sdiag] h4 { margin: 0 0 var(--space-2); font-size: 0.9rem; }
[data-op-sdiag] h4 { margin-top: var(--space-4); }
.dev-chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev-chip-list li { padding: 4px var(--space-3); border-radius: 999px; background: var(--surface-subtle); border: 1px solid var(--border-subtle); font-size: 0.85rem; }
.dev-lab-list { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3) var(--space-3); margin: 0; display: grid; gap: var(--space-2); max-height: 260px; overflow-y: auto; }
.dev-lab-list legend { font-weight: 600; padding: 0 var(--space-1); }
.dev-history-padded { padding: var(--space-3) var(--space-4); }
/* 2026-11-17 (owner): Settings > Danger Zone (CLEAR ALL) */
.clear-all-card { border: 1px solid var(--danger-border, var(--danger-500, #c0392b)); }
.clear-all-card .card-header { flex-wrap: wrap; gap: var(--space-3); }
.clear-all-card h3 { color: var(--danger-text, inherit); }
.clear-all-preview { padding: var(--space-3); border-radius: var(--radius-md, 10px); background: var(--danger-bg, rgba(192, 57, 43, 0.08)); color: var(--text-primary); }
/* 2026-11-17 (owner): Developer Accounts - reworked account details dialog */
.dev-detail.dev-modal-wide { max-width: 860px; }
.dev-detail-head { align-items: flex-start; }
.dev-detail-id { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.dev-detail-id h3 { margin: 0; overflow-wrap: anywhere; }
.dev-detail-avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-subtle, var(--bg-subtle)); border: 1px solid var(--border-subtle); font-weight: 700; }
.dev-detail-avatar img, .dev-detail-avatar .dev-detail-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dev-detail-name { margin: 2px 0 var(--space-1); color: var(--text-secondary); font-size: 0.92rem; }
.dev-detail-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; }
.dev-detail-section { margin: var(--space-4) 0 var(--space-2); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.dev-detail-section:first-of-type { margin-top: 0; }
.dev-detail-tablewrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-md, 10px); overflow-x: auto; }
.dev-detail-table, .dev-detail-history { margin: 0; width: 100%; }
/* 2026-11-18 fix (owner: "Account Information table badly compressed"): the labels used to be forced onto one line
   (white-space: nowrap) - long ones such as "MUST CHANGE PASSWORD" / "PERMISSIONS GRANTED" then set the width of BOTH label
   columns, and the values, allowed to break anywhere, were squeezed into what was left (an email on four lines). Now the
   proportions are fixed (labels 16 %, values 34 % - the values get two thirds), labels wrap between words, and a value
   breaks only inside a word that is genuinely too long for its cell. */
/* ROOT CAUSE (found by the measurement test): this table also carries the old "dev-facts" class, whose rule was written for
   a definition list - display: grid with auto-fill 200 px columns. On the table it turned the cells into a grid, so the
   label / value columns never followed any table sizing (values squeezed to ~110 px). A table is a table again here. */
table.dev-detail-table.dev-facts { display: table; grid-template-columns: none; gap: 0; margin: 0; }
.dev-detail-table { table-layout: fixed; }
.dev-detail-table th[scope="row"] { width: 16%; white-space: normal; line-height: 1.3; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); background: var(--surface-subtle, transparent); vertical-align: top; }
.dev-detail-table td { width: 34%; overflow-wrap: break-word; word-break: normal; vertical-align: top; }
.dev-detail-table tr:last-child th, .dev-detail-table tr:last-child td { border-bottom: 0; }
/* 2026-11-18 Account History cut off: the <tbody> shares the list class .dev-history (display: grid), which pulled the rows
   out of the table's columns, and the frame grew with every entry (60 entries = ~4,800 px). The body is a real table body
   again, and the history gets its own bounded height that scrolls inside it (the sticky header stays in view). */
.dev-detail-history tbody.dev-history { display: table-row-group; gap: 0; font-size: inherit; }
.dev-detail-historywrap { max-height: min(50vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.dev-detail-history td { vertical-align: top; overflow-wrap: anywhere; }
.dev-detail-history td:first-child { white-space: nowrap; width: 1%; }
.dev-detail-when { white-space: nowrap; color: var(--text-secondary); font-size: 0.85rem; width: 1%; }
@media (max-width: 480px) { /* 2026-11-18 phones: three columns squeezed Details to a word per line - each entry becomes
                               a compact block: the Action badge and When on top, Details full width underneath */
    .table.dev-detail-history thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table.dev-detail-history, .table.dev-detail-history tbody.dev-history { display: block; width: 100%; }
    .table.dev-detail-history tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); row-gap: 4px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); }
    .table.dev-detail-history tbody tr:last-child { border-bottom: 0; }
    .table.dev-detail-history tbody td, :root[data-lp-theme] .table.dev-detail-history tbody td { display: block; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
    .table.dev-detail-history tbody td:first-child { white-space: normal; min-width: 0; }
    .table.dev-detail-history tbody td:first-child .badge { white-space: normal; max-width: 100%; overflow-wrap: normal; text-align: left; }
    .table.dev-detail-history tbody td.dev-detail-when { white-space: normal; text-align: right; font-size: 0.78rem; }
    .table.dev-detail-history tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .table.dev-detail-history tbody td[colspan] { grid-column: 1 / -1; }
}
.dev-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; }
.dev-detail-actions .field-hint { flex-basis: 100%; margin: 0; }
/* narrower windows (the dialog under ~760 px): one label / value pair per line instead of two side by side */
@media (max-width: 760px) {
    .dev-detail-table { table-layout: auto; }
    .dev-detail-table tr { display: grid; grid-template-columns: minmax(8rem, 38%) 1fr; }
    .dev-detail-table th[scope="row"], .dev-detail-table td { width: auto; }
    .dev-detail-table th:empty, .dev-detail-table th:empty + td:empty { display: none; }
}
/* phones: each label sits above its value, which gets the full width; an e-mail longer than the screen may break */
@media (max-width: 480px) {
    .dev-detail-table tr { grid-template-columns: 1fr; }
    .dev-detail-table th[scope="row"] { padding-bottom: 0; border-bottom: 0; background: transparent; }
    .dev-detail-table td, .dev-detail-table td.lp-token, .dev-detail-table td .lp-token, .dev-detail-table td.lp-token-soft { white-space: normal; overflow-wrap: anywhere; }
}
#devActivityApp .table-wrap, #devLabAccessApp .table-wrap, #devOpsApp .table-wrap, #devGlobalOverview .table-wrap { position: relative; }
#devActBody td:nth-child(7) { min-width: 260px; overflow-wrap: anywhere; }
.dev-dev-counts .stat-card-note { white-space: normal; }
/* Phase 7A: Admin Overview at phone width - grid items may shrink so each table scrolls inside its own card instead of widening the page. */
#dashboardOverviewApp .grid > .card { min-width: 0; }
/* Phase 7A: operational-view panels are grid items - let them shrink so wide tables scroll inside their card. */
.dev-op-stack > * { min-width: 0; }
/* Filter menus size to their longest option (long action names) - let them shrink on phones. */
.dev-filters .select { min-width: 0; max-width: 100%; }

/* ---------------------------------------------------------------
 * Administrator Audit Logs table (layout fix). The table used to
 * squeeze every column to fit 100% of the card, while a Details cell
 * with long unbroken values (lists, names) claimed most of the width -
 * so TIME wrapped after every word. Now: the table keeps a sensible
 * minimum width and scrolls inside its own container on narrow screens
 * (never the page), each column has a readable minimum, the timestamp
 * wraps at most once, and Details takes the remaining space and wraps
 * normally (long tokens break only when they must).
 * --------------------------------------------------------------- */
.audit-logs-app .table-wrap { position: relative; }
.audit-table { min-width: 1000px; }
.audit-table th, .audit-table td { padding: var(--space-3); }
.audit-table th:nth-child(1), .audit-table td.audit-col-time { min-width: 120px; }
.audit-table th:nth-child(2), .audit-table td:nth-child(2) { min-width: 130px; }
.audit-table th:nth-child(3), .audit-table td.audit-col-role { min-width: 96px; white-space: nowrap; }
.audit-table th:nth-child(4), .audit-table td:nth-child(4) { min-width: 160px; }
.audit-table th:nth-child(5), .audit-table td.audit-col-target { min-width: 120px; overflow-wrap: anywhere; }
.audit-table th:nth-child(6), .audit-table td.audit-col-details { min-width: 260px; width: 38%; overflow-wrap: anywhere; }
.audit-time { display: inline-flex; flex-wrap: wrap; column-gap: 0.3em; }
.audit-time > span { white-space: nowrap; }
/* Wide screens have room for the whole timestamp on one line ("Oct 15, 2026, 11:42 AM"). */
@media (min-width: 1600px) { .audit-time { flex-wrap: nowrap; white-space: nowrap; } }
.audit-table td:nth-child(2) .cell-avatar-name span { overflow-wrap: anywhere; }

/* Developer Permissions - bulk controls, presets, collapsible categories. */
.dev-perm-head { flex-wrap: wrap; gap: var(--space-3); }
.dev-perm-counts { margin: var(--space-2) 0 0; }
.dev-perm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-subtle); background: var(--surface-subtle); }
.dev-perm-toolbar .dev-perm-all { margin: 0; }
.dev-perm-preset { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dev-perm-preset .select { min-width: 0; max-width: 100%; }
.dev-perm-toolbar #devPermSave { margin-left: auto; }
details.dev-perm-group { padding: 0; }
details.dev-perm-group > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-4); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
details.dev-perm-group > summary::-webkit-details-marker { display: none; }
details.dev-perm-group > summary::before { content: "▸"; display: inline-block; transition: transform var(--motion-fast) var(--motion-ease); }
details.dev-perm-group[open] > summary::before { transform: rotate(90deg); }
details.dev-perm-group > summary .field-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
details.dev-perm-group > summary:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
details.dev-perm-group > .dev-perm-catall, details.dev-perm-group > .dev-perm-row { margin: 0 var(--space-4); }
.dev-perm-catall { padding: var(--space-2) 0; border-bottom: 1px dashed var(--border-subtle); font-weight: 600; }
details.dev-perm-group > .dev-perm-row:last-child { margin-bottom: var(--space-2); }
.dev-perm-lock { font-size: 0.68rem; vertical-align: middle; }
.dev-perm-summary { margin: 0 0 var(--space-3); padding-left: 18px; display: grid; gap: 2px; font-size: 0.88rem; }
.dev-perm-history { border-top: 1px solid var(--border-subtle); }
/* Badges inside grid rows keep their natural width (not stretched). */
.dev-perm-row > span > .dev-perm-lock, .dev-perm-row > span > code, .dev-picker-item > .badge { justify-self: start; }

/* ---------------------------------------------------------------
 * Phase 7C - collapsible sidebar sections + System Management banner.
 * --------------------------------------------------------------- */
.sidebar-heading-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; border-radius: var(--radius-sm, 6px); padding-top: 2px; padding-bottom: 2px; }
.sidebar-heading-toggle:hover { color: var(--sidebar-text, inherit); }
.sidebar-heading-toggle:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.sidebar-heading-chevron { transition: transform var(--motion-fast) var(--motion-ease); flex: none; }
.sidebar-section.is-collapsed .sidebar-heading-chevron { transform: rotate(-90deg); }
.sidebar-section.is-collapsed .sidebar-list { display: none; }
/* Icon-only sidebar: headings are hidden, so every section's icons stay visible. */
.app-shell[data-sidebar-collapsed="true"] .sidebar-section.is-collapsed .sidebar-list { display: block; }
.app-shell[data-sidebar-open="true"] .sidebar-heading-toggle { display: flex; }
.dev-manage-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--accent-200); border-left: 4px solid var(--accent-500); background: var(--accent-50); }
.dev-manage-banner-text { flex: 1 1 320px; min-width: 0; }
.dev-manage-banner-text p { margin: 0 0 var(--space-1); color: var(--text-primary); }
.dev-manage-banner-text .field-hint { color: var(--text-secondary); margin: 0; }
.dev-manage-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* Phase 7C - System Management Overview quick links. */
.dev-quick-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: var(--space-3); }
.dev-quick-link { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); color: inherit; text-decoration: none; font-weight: 600; }
.dev-quick-link:hover, .dev-quick-link:focus-visible { border-color: var(--accent-500); }
.dev-recent-ops > * { min-width: 0; }
[data-global="status"] .stat-card-value { font-size: 1.15rem; overflow-wrap: anywhere; }
.dev-lead-auto { margin: var(--space-4) var(--space-5) 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--accent-200); background: var(--accent-50); }
.dev-lead-auto p { margin: 0 0 var(--space-2); color: var(--text-primary); }
.dev-lead-auto ul { margin: var(--space-2) 0 0; padding-left: 18px; font-size: 0.88rem; }
/* Phase 9A Step 76E: the four permission layers of a Lead (protected core / configurable / stored grants / effective). */
.dev-lead-auto ul.dev-perm-layers { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); list-style: none; padding-left: 0; }
.dev-perm-layers li { display: inline-flex; align-items: center; gap: var(--space-2); }
/* Phase 9A Step 76F: Super Admin capability grant form. */
.dev-sa-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3) var(--space-4); align-items: start; }
.dev-sa-form .field { margin: 0; min-width: 0; }
.dev-sa-actions { display: flex; align-items: flex-end; height: 100%; padding-top: var(--space-5); }
.dev-sa-section, #devSaCapsApp { min-width: 0; }
/* the grants table scrolls inside its own box on a phone; position keeps the visually-hidden "Actions" header (position:absolute) inside it */
#devSaCapsApp .table-wrap { position: relative; }
.dev-sa-protected summary { cursor: pointer; font-weight: 600; }
/* Phase 9B Step 79: skip link (workspace + sign-in pages) - hidden until focused by keyboard. */
.skip-link { position: absolute; left: var(--space-3); top: -60px; z-index: 1000; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
    background: var(--surface-card); color: var(--text-primary); border: 2px solid var(--accent-500); font-weight: 600; text-decoration: none; transition: top 0.15s; }
.skip-link:focus { top: var(--space-3); outline: 3px solid var(--accent-500); outline-offset: 2px; }
#mainContent:focus, #authMain:focus { outline: none; }

/* Phase 9B Step 77: Website Maintenance Mode (Developer page + in-app banner). */
.dev-mm-head { flex-wrap: wrap; gap: var(--space-3); }
.dev-mm-title { font-size: 1.1rem; margin: 0; }
.dev-mm-form { display: grid; gap: var(--space-3); margin-top: var(--space-4); max-width: 640px; }
.dev-mm-form .field { margin: 0; }
.dev-mm-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev-mm-access { margin: 0; padding-left: 18px; display: grid; gap: var(--space-2); font-size: 0.92rem; }
.maintenance-banner { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-2) var(--space-5); background: var(--status-maintenance-bg, #fff4d6); color: var(--status-maintenance-fg, #6b4a00); border-bottom: 1px solid currentColor; font-size: 0.88rem; }
.maintenance-banner a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Phase 9A Step 76G: Generate Developer Accounts. */
.dev-account-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* SOE Feature #11: Report Management - handler panel, Take Report, transfers, ownership history. */
.report-incoming-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.report-incoming-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.report-owner { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-subtle); }
.report-owner .inquiry-section-title { margin-top: 0; }
.report-owner-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2) var(--space-5); margin: 0 0 var(--space-3); }
.report-owner-facts dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.report-owner-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.report-take { padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-card); border: 1px dashed var(--border-subtle); }
.report-take[hidden], .report-transfer-incoming[hidden], .report-owner-actions[hidden], .report-transfer-form[hidden] { display: none; }
.report-take-question { margin: 0 0 var(--space-2); }
.report-take-actions, .report-owner-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.report-transfer-form { margin-top: var(--space-3); }
.report-viewonly { margin: var(--space-2) 0 0; }
.report-history-table td, .report-history-table th { white-space: nowrap; }
.report-history-table td:first-child { white-space: normal; min-width: 150px; }
/* SOE Feature #11: My Reports (the public tracking timeline, in app colours). */
.my-reports-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-5); align-items: start; }
@media (max-width: 1100px) { .my-reports-layout { grid-template-columns: minmax(0, 1fr); } }
.my-report-items { list-style: none; margin: 0; padding: var(--space-2); display: grid; gap: var(--space-2); }
.my-report-open { display: grid; gap: 4px; width: 100%; text-align: left; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    background: var(--surface-card); color: inherit; font: inherit; cursor: pointer; }
.my-report-open:hover { border-color: var(--primary-300); }
.my-report-open:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.my-report-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.my-report-subject { font-weight: 600; overflow-wrap: anywhere; }
.my-reports .track-ref { margin: 0; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary); letter-spacing: 0.04em; }
.my-report-modal { max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; }
.my-report-modal .modal-body { overflow-y: auto; }
.my-reports .track-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: var(--space-3) 0; }
.my-reports .track-meta dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.my-reports .track-meta dd { margin: 2px 0 0; }
.my-reports .track-section-title { margin: var(--space-4) 0 var(--space-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.my-reports .track-message, .my-reports .track-event-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
    background: var(--surface-subtle); border: 1px solid var(--border-subtle); }
.my-reports .track-timeline { list-style: none; margin: 0; padding: 0 0 0 var(--space-4); border-left: 2px solid var(--border-subtle); display: grid; gap: var(--space-3); }
.my-reports .track-event { position: relative; }
.my-reports .track-event::before { content: ""; position: absolute; left: calc(-1 * var(--space-4) - 6px); top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-400); }
.my-reports .track-event-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.my-reports .track-event-head time { font-size: 0.78rem; color: var(--text-secondary); }
.my-reports .track-event-body { margin-top: var(--space-2); font-size: 0.92rem; }
/* SOE Feature #10: live password requirements (assets/js/password-policy.js) - a tick + the words "met / not met yet". */
.pw-policy { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.8rem; line-height: 1.35; color: var(--text-secondary); }
.pw-policy li { display: flex; align-items: center; gap: var(--space-2); }
.pw-policy .pw-policy-title { font-weight: 600; color: var(--text-primary); }
.pw-policy-mark { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; }
.pw-policy li.is-met { color: var(--color-success); }
.pw-policy li.is-met .pw-policy-mark { background: currentColor; }
.pw-policy li.is-met .pw-policy-mark::after { content: ""; position: absolute; left: 3.5px; top: 1px; width: 3px; height: 6px; border: solid var(--surface-card); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pw-policy.is-invalid li[data-rule]:not(.is-met) { color: var(--danger-text); font-weight: 600; }
/* SOE Feature #8: personal fields another account may see but not change. */
.input.is-readonly { background: var(--surface-subtle); color: var(--text-secondary); cursor: default; }
/* SOE Feature #7: Developer Accounts Folder View - one folder per rank, the User Management folder cards inside. */
.dev-view-toggle { display: flex; gap: var(--space-2); }
.dev-folders { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-4) 0; }
.dev-folders[hidden] { display: none; }
.dev-folder-title { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: 0.95rem; }
.dev-folder-title .icon { width: 20px; height: 20px; color: var(--accent-text); }
.dev-folder-count { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); background: var(--surface-hover); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.dev-folder-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.dev-folder-card .student-folder-name { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.dev-gen-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3) var(--space-4); }
.dev-gen-row .field { margin: 0; min-width: 0; }
.dev-gen-preset summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.dev-gen-preset ul { margin: var(--space-2) 0 0; padding-left: 18px; font-size: 0.84rem; max-height: 220px; overflow-y: auto; }
.dev-gen-table { position: relative; max-height: 50vh; overflow-y: auto; }
.dev-gen-table .dev-secret { font-size: 0.95rem; letter-spacing: 0.02em; user-select: all; }
.dev-sa-protected ul { margin: var(--space-2) 0 0; padding-left: 18px; font-size: 0.86rem; columns: 2 220px; }

/* Phase 7C: on a Developer System Management page, Administrator-only controls of the reused page
   (database restore) are not offered - the Developer route refuses them anyway. */
.app-content[data-developer-manage] [data-admin-only],
.app-content[data-developer-manage] [data-action="restore"] { display: none !important; }

/* ===============================================================
 * Phase 7D - Developer Command Center (Developer accounts only:
 * .app-shell[data-workspace="developer"], set in app-start.php).
 * Existing tokens only; light/dark follow variables.css.
 * =============================================================== */
/* Full-width content: the shared 1600px cap is lifted for the Developer workspace only; padding scales with the viewport. */
.app-shell[data-workspace="developer"] .app-content { max-width: none; padding: clamp(14px, 1.5vw, 28px) clamp(14px, 1.8vw, 32px); }
.app-shell[data-workspace="developer"] .section { margin-bottom: var(--space-6); }
.app-shell[data-workspace="developer"] .section-header { margin-bottom: var(--space-3); flex-wrap: wrap; }
.app-shell[data-workspace="developer"] .section-header h2,
.dev-dash-head h2 { font-size: 1.08rem; line-height: 1.3; }
.app-shell[data-workspace="developer"] .section-header p,
.dev-dash-head p { font-size: 0.84rem; color: var(--text-secondary); }
.app-shell[data-workspace="developer"] .card-header h3 { font-size: 0.98rem; }
.app-shell[data-workspace="developer"] .table-wrap { max-width: 100%; }
.app-shell[data-workspace="developer"] .dev-global-section .card { margin-top: var(--space-3); }

/* Dashboard skeleton */
.dev-dash, .dev-dash-body { display: grid; gap: var(--space-5); min-width: 0; }
.dev-dash > *, .dev-dash-body > * { min-width: 0; }
.dev-dash-section, .dev-global-section { container-type: inline-size; min-width: 0; }
.dev-dash-section[hidden], .dev-dash-panel[hidden] { display: none; }
.dev-dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.dev-dash-head h2 { margin: 0; }
.dev-dash-head p { margin: 2px 0 0; }
.dev-dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--space-4); align-items: start; }
.dev-dash-row-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.dev-dash-row > * { min-width: 0; }
.dev-dash-row:not(:has(> :not([hidden]))) { display: none; }
.dev-dash-panel { display: flex; flex-direction: column; min-width: 0; }
.dev-dash-panel .card-header { flex-wrap: wrap; gap: var(--space-2); }
.dev-scroll-panel { max-height: 420px; overflow-y: auto; }
.dev-panel-foot { margin: 0; padding: var(--space-2) var(--space-4) var(--space-3); }
.dev-dash-error { margin: 0; color: var(--status-offline-fg); }

/* Compact header */
.dev-dash .dev-hero { padding: var(--space-4) var(--space-5); gap: var(--space-3) var(--space-5); align-items: center; }
.dev-dash .dev-hero h2 { font-size: 1.3rem; margin: 2px 0 var(--space-1); }
.dev-dash .dev-hero .card-subtitle { margin: 0; }
.dev-dash .dev-hero-note { font-size: 0.82rem; color: var(--text-secondary); }
.dev-dash .dev-view-switch { min-width: min(100%, 320px); }
.dev-dash .dev-view-switch .field-hint { margin: 0; }
.dev-version-chip { font-variant-numeric: tabular-nums; }

/* Balanced statistic grid: --kpi-cols cards per row (set from the card count), fewer columns as the section narrows,
   never a lone card on its own row (the last odd card spans the row at two columns). */
.dev-kpi-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(var(--kpi-cols, 6), minmax(0, 1fr)); }
.dev-kpi-grid[data-count="1"] { --kpi-cols: 1; } .dev-kpi-grid[data-count="2"] { --kpi-cols: 2; --kpi-cols-md: 2; }
.dev-kpi-grid[data-count="3"] { --kpi-cols: 3; --kpi-cols-md: 3; } .dev-kpi-grid[data-count="4"] { --kpi-cols: 4; --kpi-cols-md: 2; }
.dev-kpi-grid[data-count="5"] { --kpi-cols: 5; --kpi-cols-md: 3; } .dev-kpi-grid[data-count="6"] { --kpi-cols: 6; --kpi-cols-md: 3; }
@container (max-width: 1099px) { .dev-kpi-grid { grid-template-columns: repeat(var(--kpi-cols-md, 3), minmax(0, 1fr)); } }
@container (max-width: 679px) {
    .dev-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dev-kpi-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
    .dev-kpi-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@container (max-width: 339px) { .dev-kpi-grid { grid-template-columns: minmax(0, 1fr); } }
/* Grids outside a container section (e.g. inside an operational-view card) keep the older behaviour, but without empty trailing tracks. */
.dev-stats:not(.dev-kpi-grid) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

/* Statistic card: icon, label, prominent value, short note; a link when it opens a page. Tone = left stripe + icon tint + words. */
.stat-card.dev-kpi { flex-direction: row; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); min-width: 0; min-height: 76px;
    border-left: 3px solid var(--kpi-accent, var(--border-subtle)); color: inherit; text-decoration: none; }
div.stat-card.dev-kpi:hover { transform: none; box-shadow: var(--shadow-sm); }
a.stat-card.dev-kpi:hover { border-color: var(--border-subtle); border-left-color: var(--kpi-accent, var(--accent-500)); }
a.stat-card.dev-kpi:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.dev-kpi-icon { flex: none; width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--kpi-icon-bg, var(--surface-subtle)); color: var(--kpi-icon-fg, var(--text-secondary)); }
.dev-kpi-icon .icon { width: 18px; height: 18px; }
.dev-kpi-body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.dev-kpi .stat-card-label { font-size: 0.78rem; line-height: 1.25; overflow-wrap: anywhere; }
.dev-kpi .stat-card-value { font-size: 1.45rem; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dev-kpi .stat-card-note { font-size: 0.72rem; line-height: 1.3; color: var(--text-secondary); overflow-wrap: anywhere; }
.dev-kpi .stat-card-top { margin-bottom: 2px; }
[data-global="status"] .dev-kpi .stat-card-value { font-size: 1.05rem; }
.dev-kpi.tone-good    { --kpi-accent: var(--status-available-fg); --kpi-icon-bg: var(--status-available-bg); --kpi-icon-fg: var(--status-available-fg); }
.dev-kpi.tone-bad     { --kpi-accent: var(--status-offline-fg); --kpi-icon-bg: var(--status-offline-bg); --kpi-icon-fg: var(--status-offline-fg); }
.dev-kpi.tone-warn    { --kpi-accent: var(--status-idle-fg); --kpi-icon-bg: var(--status-idle-bg); --kpi-icon-fg: var(--status-idle-fg); }
.dev-kpi.tone-info    { --kpi-accent: var(--status-inuse-fg); --kpi-icon-bg: var(--status-inuse-bg); --kpi-icon-fg: var(--status-inuse-fg); }
.dev-kpi.tone-accent  { --kpi-accent: var(--accent-500); --kpi-icon-bg: var(--accent-50); --kpi-icon-fg: var(--accent-700); }
.dev-kpi.tone-neutral { --kpi-accent: var(--border-subtle); }
.stat-card.dev-kpi.is-good .stat-card-value { color: var(--status-available-fg); }
.stat-card.dev-kpi.is-warn .stat-card-value { color: var(--status-idle-fg); }

/* Live Laboratory Monitoring: status summary beside the per-laboratory table. */
.dev-lab-monitor { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@container (min-width: 900px) { .dev-lab-monitor { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); } }
.dev-lab-summary-title { margin: 0 0 var(--space-2); font-size: 0.92rem; }
.dev-lab-summary-title strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.dev-meter { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-subtle); border: 1px solid var(--border-subtle); margin-bottom: var(--space-3); }
.dev-meter > span { display: block; min-width: 4px; }
.dev-meter-online { background: var(--status-available-fg); }
.dev-meter-offline { background: var(--status-offline-fg); opacity: 0.55; }
.dev-status-chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--space-3); font-size: 0.84rem; }
.dev-status-chips li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dev-status-chips li span:nth-child(2) { flex: 1 1 auto; color: var(--text-secondary); }
.dev-status-chips strong { font-variant-numeric: tabular-nums; }
.dev-chip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--chip, var(--text-muted)); }
.dev-chip-online { --chip: var(--status-available-fg); } .dev-chip-offline { --chip: var(--status-offline-fg); } .dev-chip-inuse { --chip: var(--status-inuse-fg); }
.dev-chip-available { --chip: var(--status-available-fg); } .dev-chip-maintenance { --chip: var(--status-maintenance-fg); } .dev-chip-disabled { --chip: var(--status-disabled-fg); }
.dev-chip-locked { --chip: var(--status-locked-fg); } .dev-chip-never { --chip: var(--text-muted); }
.dev-lab-table .table-wrap { border: 0; }
.dev-lab-table, .dev-lab-summary { min-width: 0; }

/* Compact tables in dashboard panels */
.dev-compact-table th, .dev-compact-table td { padding: var(--space-2) var(--space-3); font-size: 0.86rem; vertical-align: top; }
.dev-compact-table td { overflow-wrap: break-word; } /* words wrap; a long unbroken token still breaks. "anywhere" let a column shrink to one letter */
.dev-dash-panel .table-wrap, .dev-lab-table .table-wrap { position: relative; border: 0; border-radius: 0; }
.dev-nowrap { white-space: nowrap; }

/* System Health: a dot plus the words for every verified state. */
.dev-health { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.dev-health dd[data-state] { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.dev-health dd[data-state]::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.dev-health dd[data-state="ok"]::before { background: var(--status-available-fg); }
.dev-health dd[data-state="warn"]::before { background: var(--status-idle-fg); }

/* Quick Actions */
.dev-quick-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--space-2); }
.dev-quick-action { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    background: var(--surface-subtle); color: var(--text-primary); font-size: 0.86rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.dev-quick-action .icon { flex: none; width: 16px; height: 16px; color: var(--accent-700); }
.dev-quick-action:hover { border-color: var(--accent-500); text-decoration: none; }
.dev-quick-action:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.app-shell[data-workspace="developer"] .dev-quick-links { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-2); }
.app-shell[data-workspace="developer"] .dev-quick-link { padding: var(--space-2) var(--space-3); min-height: 44px; font-size: 0.88rem; }
.dev-inquiry-badge-row { margin: 0; }

/* Developer sidebar: tighter groups, comfortable 36px targets, clearer group headings, slim scrollbar. */
.app-shell[data-workspace="developer"] .sidebar-section + .sidebar-section { margin-top: var(--space-3); }
.app-shell[data-workspace="developer"] .sidebar-section + .sidebar-section.sidebar-section-plain { margin-top: var(--space-1); }
.app-shell[data-workspace="developer"] .sidebar-list { gap: 1px; }
.app-shell[data-workspace="developer"] .sidebar-link { min-height: 36px; padding: 6px var(--space-3); font-size: 0.86rem; gap: 10px; }
.app-shell[data-workspace="developer"] .sidebar-link .sidebar-icon { width: 18px; height: 18px; }
.app-shell[data-workspace="developer"] .sidebar-heading-toggle { min-height: 30px; margin-bottom: 2px; padding: 4px var(--space-3); }
.app-shell[data-workspace="developer"] .sidebar-heading-toggle:hover { background: var(--sidebar-hover-bg); }
.app-shell[data-workspace="developer"] .sidebar-section.is-collapsed .sidebar-heading-toggle { margin-bottom: 0; }
.app-shell[data-workspace="developer"] .sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--sidebar-divider) transparent; padding-bottom: var(--space-6); }
.app-shell[data-workspace="developer"] .sidebar-nav::-webkit-scrollbar { width: 6px; }
.app-shell[data-workspace="developer"] .sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-divider); border-radius: 999px; }
.app-shell[data-workspace="developer"] .sidebar-link .sidebar-label { white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
.app-shell[data-workspace="developer"][data-sidebar-collapsed="true"] .sidebar-heading-toggle { display: none; }

/* System Management pages: compact banner. */
.app-shell[data-workspace="developer"] .dev-manage-banner { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.app-shell[data-workspace="developer"] .dev-manage-banner-text p { font-size: 0.88rem; }
@media (max-width: 560px) {
    .dev-dash .dev-hero { padding: var(--space-4); }
    .dev-status-chips { grid-template-columns: minmax(0, 1fr); }
}
:root[data-lp-motion="reduced"] .stat-card.dev-kpi:hover, :root[data-lp-motion="reduced"] .dev-quick-action:hover { transform: none; }
/* Phase 7D: Recent System Activity as structured rows (reads well in a half-width panel and on phones). */
.dev-activity-rows { list-style: none; margin: 0; padding: 0; }
.dev-activity-rows li { display: grid; gap: 2px; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border-subtle); min-width: 0; }
.dev-activity-rows li:last-child { border-bottom: 0; }
.dev-activity-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-size: 0.86rem; }
.dev-activity-row-top strong { overflow-wrap: anywhere; }
.dev-activity-row-top .badge:last-child { margin-left: auto; }
.dev-activity-row-what { font-size: 0.86rem; overflow-wrap: anywhere; }
.dev-activity-rows time { font-size: 0.74rem; }
/* Five cards at medium widths: 3 + 2 with the second row stretched (no empty cell). */
@container (min-width: 680px) and (max-width: 1099px) {
    .dev-kpi-grid[data-count="5"]:not(.dev-recent-ops) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .dev-kpi-grid[data-count="5"]:not(.dev-recent-ops) > * { grid-column: span 2; }
    .dev-kpi-grid[data-count="5"]:not(.dev-recent-ops) > :nth-child(n+4) { grid-column: span 3; }
}
/* Phase 7D: paired sections (Attendance | Security) on the Global System Overview; Activity Monitor time column on one line. */
.dev-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: var(--space-5); }
.dev-pair > .section { margin-bottom: 0; }
.dev-pair + .section, .dev-pair + .dev-global-section { margin-top: var(--space-6); }
#devActBody td:first-child { white-space: nowrap; }
/* Phase 7D: on phones the Developer topbar shows the page title only (the breadcrumb wrapped into a cramped 3-line header). */
@media (max-width: 560px) { .app-shell[data-workspace="developer"] .topbar .breadcrumb { display: none; } }
/* Phase 7D: Recent Operations role cards use the balanced grid (no lone role card); they are wider than stat cards, so fewer per row. */
@container (min-width: 1100px) and (max-width: 1499px) { .dev-kpi-grid.dev-recent-ops[data-count="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); } .dev-kpi-grid.dev-recent-ops[data-count="5"] > * { grid-column: span 2; } .dev-kpi-grid.dev-recent-ops[data-count="5"] > :nth-child(n+4) { grid-column: span 3; } }
/* Phase 7D: Recent Operations role cards hold long action names - two per row at medium widths, one on phones. */
@container (max-width: 1099px) { .dev-kpi-grid.dev-recent-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dev-kpi-grid.dev-recent-ops > * { grid-column: auto; } .dev-kpi-grid.dev-recent-ops > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@container (max-width: 679px) { .dev-kpi-grid.dev-recent-ops { grid-template-columns: minmax(0, 1fr); } }
.dev-recent-ops > .card { min-width: 0; }
.dev-recent-ops .badge { white-space: normal; overflow-wrap: anywhere; text-align: left; }

/* Phase 7E: notification destination (Developer accounts) - a link to the matching Developer page, or why it is unavailable. */
.notif-row-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.8rem; font-weight: 600; color: var(--accent-700); text-decoration: none; }
.notif-row-link:hover { text-decoration: underline; }
.notif-row-link:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; border-radius: 4px; }
.notif-row-note { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--text-secondary); }
/* Phase 7E: Administrator-reserved controls on reused pages are not offered to Developers (the Developer route refuses them anyway):
   Agent release upload/approval/removal on the old Announcements markup. Viewing stays available.
   SOE Feature #6: Add Admin is no longer hidden here - pages/admin/users.php prints it only with "developer.admin.admins.create". */
.app-content[data-developer-manage] #releaseForm,
.app-content[data-developer-manage] #releasesTableBody [data-action] { display: none !important; }
/* Phase 7F: Emergency Access is managed by Lead Developers (step-up for issuing / password reset / clearing) - its controls are shown again. */

/* Phase 7F: the one workspace selector (topbar, Developer accounts) and tab bars (Notifications, Cross-Role History). */
.dev-ws-switch { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.dev-ws-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); white-space: nowrap; }
.dev-ws-switch .select { min-width: 150px; padding-top: 6px; padding-bottom: 6px; font-weight: 600; }
@media (max-width: 760px) { .dev-ws-label { display: none; } .dev-ws-switch .select { min-width: 0; max-width: 132px; } }
@media (max-width: 400px) { .dev-ws-switch .select { max-width: 112px; font-size: 0.82rem; } }
.dev-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border-subtle); margin: 0 0 var(--space-4); }
.card > .dev-tabs { margin: 0; padding: 0 var(--space-4); }
.dev-tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: var(--space-2) var(--space-3); min-height: 40px;
    font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.dev-tab:hover { color: var(--text-primary); }
.dev-tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--accent-500); }
.dev-tab:focus-visible { outline: 2px solid var(--accent-500); outline-offset: -2px; border-radius: 4px; }
#devHistoryApp .table-wrap, #devNotifHistoryApp .table-wrap { position: relative; }
#devNhBody td:nth-child(4) { min-width: 260px; }
/* Phase 7F: on narrow screens the page title stays visible next to the workspace selector (truncated, never squeezed away). */
.app-shell[data-workspace="developer"] .topbar-left { flex: 1 1 auto; min-width: 0; }
.app-shell[data-workspace="developer"] .topbar-heading { flex: 1 1 auto; min-width: 48px; }
.app-shell[data-workspace="developer"] .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
    .app-shell[data-workspace="developer"] .topbar { padding: 0 var(--space-3); gap: var(--space-2); }
    .app-shell[data-workspace="developer"] .topbar-right { gap: var(--space-1); }
    .app-shell[data-workspace="developer"] .dev-ws-switch .select { max-width: 104px; padding-left: 8px; padding-right: 24px; font-size: 0.8rem; }
    .app-shell[data-workspace="developer"] .page-title { font-size: 1rem; }
}

/* Phase 8 (Step 68): Website Management overview - status card + KPI grid, module cards, activity tables. */
.dev-web-summary { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: var(--space-4); align-items: start; }
@media (max-width: 1100px) { .dev-web-summary { grid-template-columns: 1fr; } }
.dev-web-status .card-header { gap: var(--space-3); }
.dev-web-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.dev-web-checks li { display: flex; align-items: flex-start; gap: var(--space-2); line-height: 1.4; }
.dev-web-checks li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dev-web-loading { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.dev-web-loading .skeleton { display: block; height: 92px; border-radius: var(--radius-md); }
.dev-web-modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-3); }
.dev-web-module { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: var(--space-3); row-gap: var(--space-2); padding: var(--space-4); margin: 0; }
.dev-web-module-icon { grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md);
    background: var(--surface-hover); color: var(--text-secondary); }
.dev-web-module[data-status="available"] .dev-web-module-icon { background: var(--status-available-bg); color: var(--status-available-fg); }
.dev-web-module-body h3 { margin: 0 0 2px; font-size: 0.98rem; }
.dev-web-module-body p { margin: 0; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.45; }
.dev-web-module > .badge { justify-self: start; }
.dev-web-module[data-status="not_available"] .dev-web-module-body h3 { color: var(--text-secondary); }
.dev-web-module.is-current { outline: 2px solid var(--accent-500); outline-offset: -2px; }
.dev-web-notice { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-4); }
.dev-web-notice p { margin: 0; }
.dev-web-activity { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--space-4); align-items: start; }
.dev-web-activity > .card:first-child { grid-column: 1 / -1; } /* the change descriptions get the whole row */
/* The Website KPI grid is its own container: 4 columns when wide, 2 on phones, 1 when very narrow. */
.dev-web-kpis { container-type: inline-size; min-width: 0; }
.dev-web-kpis .dev-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 599px) { .dev-web-kpis .dev-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dev-web-kpis .dev-kpi-grid > * { grid-column: auto; } }
@container (max-width: 299px) { .dev-web-kpis .dev-kpi-grid { grid-template-columns: minmax(0, 1fr); } }
/* Phase 8: compact "Soon" tags in the Website Management group so every module name stays on one line (36 px rows). */
.app-shell[data-workspace="developer"] [data-sidebar-section="dev-website"] .sidebar-link { gap: 6px; }
.app-shell[data-workspace="developer"] [data-sidebar-section="dev-website"] .sidebar-tag { padding: 1px 4px; font-size: 0.58rem; letter-spacing: 0; }
/* Phase 8 (Steps 69-76): Website Management editors - toolbar, collapsible groups, list/item editors, errors, change lists. */
.cms-module { display: grid; gap: var(--space-4); min-width: 0; }
.cms-back { margin: 0; font-size: 0.86rem; } .cms-back a { display: inline-flex; align-items: center; gap: 4px; }
/* z-index 10: an in-page sticky bar must stack BELOW the shared sticky topbar (z-index 20) - with the old equal 20
   it came later in the page and painted over the open profile / notification menus once the page was scrolled. */
.cms-toolbar { position: sticky; top: calc(var(--topbar-height, 64px) + 8px); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.cms-toolbar-status { display: grid; gap: 2px; min-width: 0; flex: 1 1 340px; font-size: 0.86rem; }
.cms-toolbar-status .skeleton { display: block; height: 36px; }
.cms-status-line { margin: 0; color: var(--text-secondary); } .cms-status-line strong { color: var(--text-primary); }
.cms-status-warn { margin: 4px 0 0; color: var(--status-idle-fg); font-weight: 600; }
.cms-status-dirty { margin: 4px 0 0; color: var(--accent-text, var(--text-primary)); font-weight: 700; }
.cms-toolbar-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.cms-toolbar-actions [aria-disabled="true"] { opacity: 0.6; }
.cms-form { display: grid; gap: var(--space-3); }
.cms-group { padding: 0; overflow: hidden; }
.cms-group-title { cursor: pointer; padding: var(--space-3) var(--space-4); font-weight: 700; font-size: 1rem; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.cms-group-title::-webkit-details-marker { display: none; }
.cms-group-title::after { content: "+"; font-weight: 700; color: var(--text-secondary); }
.cms-group[open] > .cms-group-title::after { content: "\2212"; }
.cms-group-title:focus-visible { outline: 2px solid var(--accent-500); outline-offset: -2px; }
.cms-group-body { display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); }
.cms-group-help { margin: 0; }
.cms-field { margin: 0; min-width: 0; }
.cms-label { font-weight: 600; }
.cms-input-row { display: flex; align-items: center; gap: var(--space-2); } .cms-input-row .input { flex: 1 1 auto; min-width: 0; }
.cms-input-col { display: grid; gap: 2px; }
.cms-counter { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; justify-self: end; }
.cms-textarea { resize: vertical; min-height: 72px; }
.cms-lines, .cms-items { display: grid; gap: var(--space-2); }
.cms-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; }
.cms-line > .cms-error { grid-column: 1 / -1; margin: 0; }
.cms-list-tools { display: flex; gap: 2px; }
.cms-list-btn { min-width: 32px; padding-inline: 8px; }
.cms-add { justify-self: start; }
.cms-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-hover); }
.cms-item-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 6px var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.cms-item-title { font-weight: 700; font-size: 0.86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-item-body { display: grid; gap: var(--space-3); padding: var(--space-3); background: var(--surface-card, transparent); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.cms-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cms-color-row { display: flex; align-items: center; gap: var(--space-2); }
.cms-color { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border-strong, var(--border-subtle)); border-radius: var(--radius-sm); background: var(--surface-card, #fff); }
.cms-color-text { max-width: 120px; font-family: var(--font-mono, monospace); }
.cms-field.is-invalid > .input, .cms-field.is-invalid .input, .cms-line.is-invalid .input { border-color: var(--danger-500); }
.cms-error { margin: 4px 0 0; }
.cms-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); max-height: 320px; overflow: auto; }
.cms-changes li { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-size: 0.84rem; overflow-wrap: anywhere; }
.cms-before { color: var(--danger-700); text-decoration: line-through; }
.cms-after { color: var(--status-available-fg); }
@media (max-width: 640px) {
    .cms-toolbar { position: static; }
    .cms-toolbar-actions { justify-content: stretch; } .cms-toolbar-actions > * { flex: 1 1 auto; }
    .cms-group-body { padding-inline: var(--space-3); }
}
/* Phase 8 (Step 70): theme editor live sample - painted from the form values through --s-* variables (dashboard only). */
.cms-theme-sample { padding: var(--space-4); display: grid; gap: var(--space-3); }
.cms-theme-sample-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cms-ts-hero { border-radius: var(--s-radius); padding: var(--space-4); color: #fff; font-family: inherit;
    background: radial-gradient(500px 220px at 85% -10%, color-mix(in srgb, var(--s-accent) 22%, transparent), transparent 60%), linear-gradient(160deg, color-mix(in srgb, var(--s-secondary) 90%, #fff) 0%, var(--s-secondary) 55%, color-mix(in srgb, var(--s-secondary) 68%, #000) 100%); }
.cms-ts-eyebrow { margin: 0 0 4px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--s-accent); }
.cms-ts-title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; } .cms-ts-title span { color: var(--s-accent); }
.cms-ts-lead { margin: 0 0 12px; color: rgba(255, 255, 255, 0.82); font-size: 0.9rem; }
.cms-ts-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--s-btn); font-weight: 700; font-size: 0.86rem; }
.cms-ts-btn-accent { background: var(--s-accent); color: #0a1630; }
.cms-ts-btn-primary { background: var(--s-primary); color: #fff; }
.cms-ts-light { border-radius: var(--s-radius); padding: var(--space-4); background: var(--s-bg); color: var(--s-text); border: 1px solid var(--border-subtle); display: grid; gap: 8px; }
.cms-theme-sample[data-spacing="compact"] .cms-ts-light, .cms-theme-sample[data-spacing="compact"] .cms-ts-hero { padding: var(--space-3); }
.cms-theme-sample[data-spacing="spacious"] .cms-ts-light, .cms-theme-sample[data-spacing="spacious"] .cms-ts-hero { padding: var(--space-6); }
.cms-ts-h { margin: 0; font-weight: 800; font-size: 1.05rem; padding-bottom: 4px; border-bottom: 3px solid var(--s-accent-light); justify-self: start; }
.cms-ts-p { margin: 0; font-size: 0.9rem; }
.cms-ts-card { background: var(--s-tint); border-radius: calc(var(--s-radius) * 0.7); padding: var(--space-3); display: grid; gap: 8px; justify-items: start; }
.cms-ts-ok { margin: 0; color: var(--status-available-fg); font-weight: 600; font-size: 0.86rem; }
.cms-ts-issues { margin: 0; padding-left: 1.2em; color: var(--danger-700); font-weight: 600; font-size: 0.86rem; display: grid; gap: 4px; }
:root[data-theme="dark"] .cms-ts-issues { color: #ff9aa8; }.cms-theme-sample .cms-ts-hero .cms-ts-title { color: #ffffff; }
.cms-theme-sample .cms-ts-hero .cms-ts-lead { color: rgba(255, 255, 255, 0.82); }
.cms-theme-sample .cms-ts-light .cms-ts-h, .cms-theme-sample .cms-ts-light .cms-ts-p { color: var(--s-text); }
/* Phase 8 (Step 71): Media Library grid, upload form, edit dialog, image picker and media fields. */
.cms-media-upload-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); align-items: start; }
.cms-media-upload-actions { align-self: end; }
.cms-media-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cms-media-filters .field { flex: 1 1 220px; margin: 0; }
.cms-media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-3); }
.cms-media-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-card); min-width: 0; }
.cms-media-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: repeating-conic-gradient(var(--surface-hover) 0% 25%, transparent 0% 50%) 50% / 16px 16px; }
.cms-media-missing { display: grid; place-items: center; color: var(--text-secondary); font-size: 0.82rem; }
.cms-media-card-body { display: grid; gap: 4px; padding: var(--space-2) var(--space-3) var(--space-3); align-content: start; }
.cms-media-card-body .btn { justify-self: start; }
.cms-media-title { font-weight: 700; font-size: 0.88rem; overflow-wrap: anywhere; }
.cms-media-meta { font-size: 0.76rem; color: var(--text-secondary); }
.cms-media-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.cms-media-edit-img { display: block; max-width: 100%; max-height: 220px; margin: 0 auto var(--space-2); border-radius: var(--radius-sm); }
.cms-media-replace { border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); display: grid; gap: 6px; }
.cms-media-replace .btn { justify-self: start; }
.cms-spacer { flex: 1 1 auto; }
.modal-footer:has(.cms-spacer) { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cms-picker { max-width: min(860px, 96vw); width: 100%; }
.cms-picker-grid { max-height: 52vh; overflow: auto; margin-top: var(--space-2); }
.cms-pick-btn { display: grid; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.cms-pick-btn .cms-media-title { padding: 6px var(--space-2); }
.cms-pick-btn:hover, .cms-pick-btn:focus-visible { outline: 2px solid var(--accent-500); outline-offset: -2px; }
.cms-media-field { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.cms-media-field .cms-media-thumb { width: 120px; flex: none; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.cms-media-field-body { display: grid; gap: 6px; min-width: 0; }
.cms-media-name { font-size: 0.86rem; overflow-wrap: anywhere; }
.cms-media-field-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* Phase 8 (Step 74): Drafts & Publishing list. */
.cms-pub-head { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: flex-start; }
.cms-pub-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cms-pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.cms-pub-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.cms-pub-row.has-draft { border-color: color-mix(in srgb, var(--accent-500) 45%, var(--border-subtle)); }
.cms-pub-check input { width: 18px; height: 18px; }
.cms-pub-none { color: var(--text-secondary); }
.cms-pub-main { display: grid; gap: 2px; min-width: 0; }
.cms-pub-label { font-weight: 700; }
.cms-pub-status { font-size: 0.86rem; } .cms-pub-status.is-warn { color: var(--status-idle-fg); font-weight: 600; }
.cms-pub-links { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 560px) { .cms-pub-row { grid-template-columns: 28px minmax(0, 1fr); } .cms-pub-links { grid-column: 2; justify-content: flex-start; } }
/* 2026-11-24: choosing drafts to publish - Select all / Deselect all, a clearly marked selected row, why a draft cannot be chosen */
.cms-pub-select { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); }
.cms-pub-select .cms-check { margin: 0; font-weight: 600; }
.cms-pub-count { margin-left: auto; font-size: 0.86rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cms-pub-row.is-selected { border-color: var(--primary-500); background: color-mix(in srgb, var(--primary-500) 9%, transparent); box-shadow: inset 3px 0 0 var(--primary-500); }
.cms-pub-row.is-locked .cms-pub-check input { cursor: not-allowed; }
.cms-pub-why { font-size: 0.82rem; color: var(--text-secondary); }
.cms-pub-confirm-count { font-weight: 700; }
.cms-pub-problems { margin: var(--space-2) 0 0; padding-left: 1.2em; color: var(--status-danger-fg, var(--danger-600, #b42318)); font-size: 0.9rem; }
.cms-pub-select.is-empty .cms-pub-count { margin-left: 0; flex-basis: 100%; order: -1; color: var(--text-primary); font-weight: 600; }
@media (max-width: 560px) { .cms-pub-count { margin-left: 0; flex-basis: 100%; } }
/* Phase 8 (Step 75): Change History. */
.cms-hist-table td { vertical-align: top; }
.cms-live { margin-left: 6px; }
.cms-hist-actions { min-width: 170px; }
.cms-hist-btns { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cms-hist-table td:nth-child(4) { overflow-wrap: normal; word-break: normal; min-width: 110px; }
.cms-compare:focus { outline: none; }
.cms-compare-list { max-height: none; }
/* Phase 8 (Step 76): Privacy Policy review / approval status in the editor toolbar. */
.cms-policy-status { display: grid; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-subtle); }
.cms-policy-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: 4px; }

/* Phase 9B Step 81: Website Health */
.dev-health-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dev-health-counts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.dev-health-counts li { display: inline-flex; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.dev-health-list { list-style: none; margin: 0; padding: 0; }
.dev-health-item { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); border-left: 3px solid transparent; }
.dev-health-item:first-child { border-top: 0; }
.dev-health-item[data-status="critical"] { border-left-color: var(--status-disabled-fg); }
.dev-health-item[data-status="warning"] { border-left-color: var(--status-idle-fg); }
.dev-health-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dev-health-item p { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
/* Phase 9B Step 82: Security Events */
.dev-sec-incidents { list-style: none; margin: 0; padding: 0; }
.dev-sec-incident { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.dev-sec-incident:first-child { border-top: 0; }
.dev-sec-incidents > .field-hint { padding: var(--space-3) var(--space-5); }
.dev-sec-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: var(--space-3); align-items: end; padding: 0 var(--space-5) var(--space-4); }
.dev-sec-filters .field { margin: 0; }
.dev-sec-filter-actions { display: flex; gap: var(--space-2); }
.dev-sec-action { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace); font-size: 0.8rem; }
.dev-sec-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-5); }
/* Phase 9B Step 83: Backup & Recovery */
.cms-backup-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }

/* Phase 9F: Laboratory Maintenance (PC Control page) - theme tokens only, so light and dark follow automatically */
.lab-maint-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.lab-maint-head > div { flex: 1 1 280px; min-width: 0; }
.lab-maint-body { display: grid; gap: var(--space-4); }
.lab-maint-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.lab-maint-kind { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 12px; border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 0.82rem; color: var(--text-secondary); background: var(--surface-subtle); }
.lab-maint-kind strong { color: var(--text-primary); font-weight: 600; }
.lab-maint-kind-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-subtle); flex: none; }
.lab-maint-kind.is-on { border-color: transparent; color: var(--status-maintenance-fg); background: var(--status-maintenance-bg); }
.lab-maint-kind.is-on strong { color: var(--status-maintenance-fg); }
.lab-maint-kind.is-on .lab-maint-kind-dot { background: var(--status-maintenance-fg); }
.lab-maint-kind-link { font-size: 0.82rem; }
.lab-maint-item { border: 1px solid var(--border-subtle); border-left: 3px solid var(--status-maintenance-fg); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-3); background: var(--surface-card); min-width: 0; }
.lab-maint-item + .lab-maint-item { margin-top: var(--space-3); }
.lab-maint-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.lab-maint-item-title { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.lab-maint-item-where { margin: 0; color: var(--text-secondary); font-size: 0.88rem; overflow-wrap: anywhere; }
.lab-maint-item-msg { margin: 0; overflow-wrap: anywhere; }
.lab-maint-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.lab-maint-meta dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.lab-maint-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.lab-maint-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); gap: var(--space-2); }
.lab-maint-stat { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); display: grid; background: var(--surface-subtle); }
.lab-maint-stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.lab-maint-stat-label { font-size: 0.75rem; color: var(--text-secondary); }
.lab-maint-stat.is-good .lab-maint-stat-value { color: var(--status-available-fg); }
.lab-maint-stat.is-warn .lab-maint-stat-value { color: var(--status-idle-fg); }
.lab-maint-stat.is-info .lab-maint-stat-value { color: var(--status-inuse-fg); }
.lab-maint-stat.is-bad .lab-maint-stat-value { color: var(--danger-text); }
.lab-maint-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.lab-maint-recent summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.lab-maint-recent-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.lab-maint-recent-list li { display: grid; gap: 2px; overflow-wrap: anywhere; }
.lab-maint-modal-body { display: grid; gap: var(--space-4); overflow-y: auto; }
.lab-maint-modal-body .field { margin: 0; }
.lab-maint-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); min-width: 0; }
.lab-maint-fieldset legend { font-weight: 600; font-size: 0.88rem; margin-bottom: var(--space-1); padding: 0; }
.lab-maint-choice { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; }
.lab-maint-choice:has(input:checked) { border-color: var(--status-maintenance-fg); background: var(--status-maintenance-bg); }
.lab-maint-choice:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
.lab-maint-choice input { margin-top: 3px; flex: none; }
.lab-maint-choice > span { display: grid; gap: 2px; min-width: 0; }
.lab-maint-choice small { color: var(--text-secondary); font-size: 0.8rem; }
.lab-maint-labs { display: grid; gap: var(--space-1); max-height: 200px; overflow-y: auto; padding: var(--space-2) var(--space-3); border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); }
.lab-maint-lab { display: flex; align-items: center; gap: var(--space-2); }
.lab-maint-lab small { margin-left: auto; color: var(--text-secondary); }
.lab-maint-confirm-lead { margin: 0; font-weight: 600; }
.lab-maint-summary { margin: 0; display: grid; gap: var(--space-2); }
.lab-maint-summary > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.lab-maint-summary dt { color: var(--text-secondary); font-size: 0.85rem; }
.lab-maint-summary dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 560px) { .lab-maint-summary > div { grid-template-columns: 1fr; gap: 2px; } .lab-maint-actions { justify-content: stretch; } .lab-maint-actions .btn { flex: 1 1 auto; } }
.pc-card-maint { margin-top: var(--space-1); }

/* Emergency Access create dialog (migration 058): credential / duration choices - theme tokens only */
.ea-choice-group { border: 0; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); min-width: 0; }
.ea-choice-group legend { font-weight: 600; font-size: 0.88rem; margin-bottom: var(--space-1); padding: 0; }
.ea-choice { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; }
.ea-choice:has(input:checked) { border-color: var(--status-inuse-fg); background: var(--status-inuse-bg); }
.ea-choice input { margin-top: 3px; flex: none; }
.ea-choice > span { display: grid; gap: 2px; min-width: 0; }
.ea-choice small { color: var(--text-secondary); font-size: 0.8rem; }
/* Workspace parity: the Teacher workspace shows System Management pages read-only (the server refuses changes too) -
   their write controls are not shown there. */
.dev-preview-note { margin-bottom: var(--space-4); }
.app-shell[data-role-preview="teacher"] :is(#createClassBtn, #classEditBtn, #classArchiveBtn, #classRegenerateCodeBtn, #classAttendanceClearBtn,
    #materialUploadForm, [data-material-action="deliver"], [data-material-action="toggle-archive"], #clearActivityLogsBtn, #clearSessionHistoryBtn) { display: none !important; }

/* Emergency Access tables: the Actions cell stays a real table cell (vertically centred like its row); the buttons sit
   side by side in an inner row that never wraps, right-aligned like the other management tables. */
.ea-table th, .ea-table td { padding-left: var(--space-3); padding-right: var(--space-3); } /* 9-10 columns: a little tighter so Actions stays in view on a laptop */
.ea-table td { vertical-align: middle; }
/* History has one column more (Status): on laptop widths both tables keep every column, Edit and Revoke / Remove in view */
@media (max-width: 1440px) { .ea-table th, .ea-table td { padding-left: var(--space-2); padding-right: var(--space-2); } }
.ea-table .ea-username { font-family: var(--font-mono); white-space: nowrap; }
.table th.ea-actions-cell, .table td.ea-actions-cell { width: 1%; white-space: nowrap; text-align: right; vertical-align: middle; }
.ea-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-1); flex-wrap: nowrap; }
.ea-actions .btn { flex: none; padding: 0 var(--space-2); }
.ea-never { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: 0.88rem; color: var(--text-secondary); }
[data-modal="generateGrantModal"] .modal { max-height: 90vh; max-height: 90dvh; overflow-y: auto; }

/* Agent Releases page (Developer System Management) - theme tokens only */
.ar-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.ar-target { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ar-target-version { font-size: 1.05rem; }
.ar-notes-text { margin: var(--space-2) 0 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.ar-stats { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: var(--space-2); }
.ar-stat { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); display: grid; background: var(--surface-subtle); }
.ar-stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ar-stat-label { font-size: 0.75rem; color: var(--text-secondary); }
.ar-upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-3); align-items: end; }
.ar-upload .field { margin: 0; }
.ar-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* The whole fingerprint, always: 16 monospace characters a line (4 lines), one unbroken string, so a manual selection copies it exactly. */
.ar-hash-cell { min-width: 150px; }
.ar-hash { display: block; width: 16ch; max-width: 100%; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace); font-size: 0.8rem; line-height: 1.45; word-break: break-all; overflow-wrap: anywhere; white-space: normal; }
.ar-hash-copy { margin-top: var(--space-2); white-space: nowrap; }
.ar-hash-copy.is-copied { color: var(--color-success); border-color: currentColor; }
/* Delivery Status: when each stage happened */
.ar-timing-row td { padding-top: 0; border-top: 0; }
.ar-timing-row summary { cursor: pointer; font-size: 0.85rem; }
.ar-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0 0; }
.ar-timeline dt { font-size: 0.75rem; color: var(--text-secondary); }
.ar-timeline dd { margin: 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ar-history { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.ar-history li { overflow-wrap: anywhere; }
.ar-history .field-hint { display: block; }
/* Migration 070: upload progress, release selection, histories with Clear, Send to PCs / delivery status */
#agentReleasesApp .table-wrap { position: relative; } /* keeps the rows' screen-reader labels inside the scroll area */
.ar-progress { display: grid; gap: var(--space-1); margin-top: var(--space-3); }
.ar-progress[hidden] { display: none; }
.ar-progress progress { width: 100%; height: 10px; accent-color: var(--accent-500); }
.ar-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0 var(--space-3); }
.ar-bulk [data-ar-count] { color: var(--text-secondary); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ar-bulk [data-ar-remove-selected] { margin-left: auto; }
.table th.ar-select-col, .table td.ar-select-col { width: 30px; padding-right: 0; }
.ar-select { width: 18px; height: 18px; cursor: pointer; }
.ar-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.ar-remove { color: var(--danger-text); }
.ar-histories { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.ar-history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ar-show-cleared { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.ar-cleared { opacity: 0.6; }
.modal.ar-modal-wide { max-width: 640px; min-width: 0; }
.ar-modal-head { min-width: 0; }
.ar-modal-head h3, .ar-modal-head .card-subtitle { overflow-wrap: anywhere; }
.ar-pc-list { max-height: 300px; overflow-y: auto; display: grid; gap: var(--space-1); margin: var(--space-2) 0; }
.ar-check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-height: 32px; cursor: pointer; overflow-wrap: anywhere; }
.ar-check input { width: 18px; height: 18px; flex: 0 0 auto; }
.ar-check.is-muted { opacity: 0.6; }
[data-modal="arResendModal"] .modal-footer { flex-wrap: wrap; }
.ar-resend-count { margin-right: auto; }
@media (max-width: 600px) {
    .ar-bulk [data-ar-remove-selected] { margin-left: 0; flex: 1 1 100%; }
}


/* Additional Improvements #1: Maintenance Access Codes card (Developer Maintenance Mode page). */
.mac-form { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-4); }
.mac-form .field { margin: 0; min-width: 180px; flex: 1 1 200px; }
.mac-form .mac-form-go { flex: 0 0 auto; min-width: 0; }
.mac-secret { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-muted, var(--surface-card)); }
.mac-secret p { margin: 0 0 var(--space-2); }
.mac-secret-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.mac-secret-value { font-size: 1.15rem; letter-spacing: 0.12em; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--text-primary); overflow-wrap: anywhere; }

/* Additional Improvements #2: one student's complete activity history (Activity Logs -> View all activity). */
.activity-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.activity-history-who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.activity-history-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-bottom: var(--space-2); }
.activity-history-filters .input[type="search"] { flex: 1 1 240px; }
.activity-history-date { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.85rem; color: var(--text-secondary); }
.activity-history-url { font-size: 0.8rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.activity-history-pager { display: flex; justify-content: center; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; }

/* Additional Improvements #3: generated batches list one "username   password" per line. */
#devOpSecretValue { white-space: pre-wrap; max-height: 50vh; overflow-y: auto; }

/* Additional Improvements #4 / #5.5: class access rules, roster, bulk archive. */
.class-card-badges { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.class-card-select { display: inline-flex; align-items: center; padding: 2px; cursor: pointer; }
.class-card-select input { width: 18px; height: 18px; }
.class-bulk-bar { margin-bottom: var(--space-3); }
.class-bulk-actions { display: inline-flex; gap: var(--space-2); margin-left: auto; flex-wrap: wrap; }
.class-access { border-top: 1px solid var(--border-subtle); padding: var(--space-4) 0 var(--space-2); display: grid; gap: var(--space-2); justify-items: start; }
.class-access h4 { margin: 0; }
.class-access-state { margin: 0; }
.class-window-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.class-window-row .field { margin: 0; display: grid; gap: var(--space-1); min-width: 120px; flex: 1 1 120px; }
/* PC Controls command groups (Enable / Disable / Lock) - assets/js/modules/teacher-controls.js */
/* Fixed toolbar: a reserved row with fixed tracks. The selection line is one line (long text is cut, never wrapped), so
   the count changing cannot move a button; stays in view while the computer list scrolls on wide screens. */
.pc-toolbar { display: grid; gap: var(--space-3); padding: var(--space-3); margin-bottom: var(--space-4); background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.pc-toolbar-selection { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: 32px; }
.pc-toolbar-all { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.pc-action-groups { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; align-items: center; gap: var(--space-2) var(--space-5); }
.pc-action-group { display: grid; grid-template-columns: 4.2em auto auto; align-items: center; gap: var(--space-2); }
.pc-action-group-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.pc-action-hint { min-width: 0; font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 901px) { .pc-toolbar { position: sticky; top: calc(var(--topbar-height) + var(--space-2)); z-index: 5; } }
@media (max-width: 1180px) {
    .pc-action-groups { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
    .pc-action-group { grid-template-columns: 4.2em minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .pc-toolbar-selection { grid-template-columns: minmax(0, 1fr) auto; }
    .pc-action-hint { grid-column: 1 / -1; }
    .pc-action-group { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .pc-action-group-label { grid-column: 1 / -1; }
    .pc-action-group .btn { padding-inline: var(--space-2); min-width: 0; }
}
/* Removed-students list: select / Remove Selected (migration 068) - assets/js/modules/classes.js */
.roster-no-select .roster-select-col { display: none; }
.table th.roster-select-col, .table td.roster-select-col { width: 30px; padding-left: var(--space-3); padding-right: 0; }
.roster-select, .roster-bulk input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.roster-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: var(--space-2) 0 var(--space-3);
    padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-subtle); }
.roster-bulk[hidden] { display: none; }
.roster-bulk-all { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; cursor: pointer; }
.roster-bulk-count { color: var(--text-secondary); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.roster-bulk .btn { margin-left: auto; }
.roster-row-actions { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.roster-archive-btn { color: var(--danger-text); }
.roster-archive-names { margin: 0 0 var(--space-2); padding-left: 1.1em; display: grid; gap: 2px; }
@media (max-width: 600px) {
    .roster-bulk .btn { margin-left: 0; flex: 1 1 100%; }
}
.class-member-history { margin: 0; padding-left: 1.1em; display: grid; gap: 2px; font-size: 0.88rem; }
/* Live Subject Code window status (server time, opens, closes, days, state) - assets/js/modules/classes.js */
.class-window-live { margin: 0; justify-self: stretch; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-2) var(--space-3);
    padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-subtle); }
.class-window-live:empty { display: none; }
.class-window-live dt { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.class-window-live dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.class-window-days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.class-window-days legend { padding: 0; margin-bottom: var(--space-1); font-weight: 600; font-size: 0.85rem; }
.class-window-days label { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 0.9rem; }
.class-sections-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); justify-self: stretch; }
.class-sections-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-md); background: var(--surface-subtle); }
/* Consolidated adjustments #1: the add-section row uses the section's full width - Course wider, Year and Section
   narrower, and the button clearly apart from the Section field (never attached to it); stacked on small screens. */
.class-sections-add { justify-self: stretch; display: grid; grid-template-columns: minmax(150px, 2fr) minmax(80px, 1fr) minmax(90px, 1fr) auto;
    gap: var(--space-3) var(--space-4); align-items: end; margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px dashed var(--border-subtle); }
.class-sections-add .field { margin: 0; display: grid; gap: var(--space-1); min-width: 0; }
.class-sections-add .field .input { width: 100%; }
.class-sections-add .btn { align-self: end; min-height: 40px; padding-inline: var(--space-4); margin-left: var(--space-2); white-space: nowrap; }
@media (max-width: 640px) {
    .class-sections-add { grid-template-columns: 1fr 1fr; }
    .class-sections-add .field:first-child { grid-column: 1 / -1; }
    .class-sections-add .btn { grid-column: 1 / -1; margin-left: 0; width: 100%; }
}
/* Consolidated adjustments #1: class dialogs never grow past the screen (they used to be centred and cut off at the
   top and bottom - the title, tabs and Close unreachable at 1366x768). Class Details: fixed header and footer, the
   body scrolls (one scroll area), the tab bar stays at the top of it; the other class dialogs scroll as a whole. */
.modal-backdrop[data-modal^="class"] .modal { max-height: calc(100vh - 2 * var(--space-4)); max-height: calc(100dvh - 2 * var(--space-4)); overflow-y: auto; overscroll-behavior: contain; }
/* overflow: clip (not hidden): a hidden box can still be scrolled by focus / scrollIntoView, which pushed the header
   off the top; a clipped one cannot, so the body stays the only scroll area. */
.modal-backdrop[data-modal="classDetailModal"] .modal { display: flex; flex-direction: column; overflow: clip; }
.modal-backdrop[data-modal="classDetailModal"] .modal-header,
.modal-backdrop[data-modal="classDetailModal"] .modal-footer { flex: none; }
.modal-backdrop[data-modal="classDetailModal"] .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: 0; }
.class-detail-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: var(--space-2); flex-wrap: wrap; background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle); padding: var(--space-3) 0; margin-bottom: var(--space-4); }
.class-roster-toggle { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.9rem; margin-bottom: var(--space-2); }
#classStudentsBody tr.is-removed td { color: var(--text-secondary); }

/* Additional Improvements #5.2 / #5.3: Materials page. */
.mp-summary { margin-bottom: var(--space-4); }
.mp-stat { text-align: left; cursor: pointer; border: 1px solid var(--border-subtle); font: inherit; color: inherit; }
.mp-stat:hover, .mp-stat:focus-visible { border-color: var(--accent-500, var(--border-strong)); }
.mp-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-2) 0 var(--space-3); }
.mp-filters .input[type="search"] { flex: 1 1 240px; }
.mp-filters .select { min-width: 160px; }
.mp-path { overflow-wrap: anywhere; }
/* Centralized Materials management (migration 069) - assets/js/modules/materials-page.js */
#materialsPageApp .table-wrap { position: relative; } /* keeps the rows' screen-reader labels inside the scroll area (same as the other pages) */
.mm-upload, .mm-list-card { margin-bottom: var(--space-4); }
.mm-upload-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.mm-upload-form .field { margin: 0; display: grid; gap: var(--space-1); flex: 1 1 200px; min-width: 0; }
.mm-upload-form .mm-upload-desc { flex: 2 1 260px; }
.mm-upload-form .btn { flex: 0 0 auto; }
.mm-file, .mm-desc { overflow-wrap: anywhere; }
.mm-desc { font-size: 0.85rem; color: var(--text-secondary); }
.mm-delivery { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.mm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); }
.mm-remove { color: var(--danger-text); }
.mm-pc-list { max-height: 300px; overflow-y: auto; display: grid; gap: var(--space-2); margin: var(--space-2) 0; }
.mm-lab { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: 0; display: grid; gap: var(--space-1); }
.mm-lab legend { font-weight: 600; font-size: 0.85rem; padding: 0 var(--space-1); }
.mm-check { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; cursor: pointer; overflow-wrap: anywhere; }
.mm-check input { width: 18px; height: 18px; flex: 0 0 auto; }
.mm-send-count { margin-right: auto; }
.mm-send-footer { flex-wrap: wrap; } /* never wider than a phone screen */
[data-modal^="mm"] .modal { min-width: 0; }
.mm-modal-head { min-width: 0; }
/* Delivery status: wide enough for all four columns on a desktop, never past the screen. The dialog itself never scrolls sideways:
   on a phone the table scrolls inside its own frame, and a long list scrolls between the header and the footer. */
.modal.mm-status-modal { max-width: 960px; display: flex; flex-direction: column; max-height: calc(100vh - 2 * var(--space-4)); max-height: calc(100dvh - 2 * var(--space-4)); }
.mm-status-modal .modal-header { gap: var(--space-3); flex: 0 0 auto; }
.mm-status-modal .modal-header .icon-btn { flex: 0 0 auto; }
.mm-status-modal .modal-footer { flex: 0 0 auto; }
.mm-status-checked { margin-right: auto; }
.mm-status-modal #mmStatusError { margin-bottom: var(--space-3); }
.mm-status-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mm-status-table { table-layout: fixed; min-width: 620px; }
.mm-status-table th:nth-child(1) { width: 30%; }
.mm-status-table th:nth-child(3) { width: 96px; }
.mm-status-table th:nth-child(4) { width: 196px; }
.mm-status-table td { overflow-wrap: break-word; vertical-align: top; }
.mm-status-table th:nth-child(3), .mm-status-table td:nth-child(3) { text-align: center; font-variant-numeric: tabular-nums; }
.mm-status-table td:nth-child(4) { white-space: nowrap; }
.mm-status-table .badge { white-space: nowrap; }
/* Too narrow for four columns: each computer becomes a small stack, so nothing sits behind a sideways scroll. */
@media (max-width: 720px) {
    .mm-status-table { display: block; min-width: 0; }
    .mm-status-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .mm-status-table tbody, .mm-status-table tr { display: block; }
    .mm-status-table tr + tr { border-top: 1px solid var(--border-subtle); }
    .mm-status-table td { display: block; border: 0; padding: var(--space-2) var(--space-3); }
    .mm-status-table td[data-label] { display: flex; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-1); padding-bottom: var(--space-1); text-align: left; }
    .mm-status-table td[data-label]::before { content: attr(data-label); color: var(--text-secondary); font-size: 0.8rem; }
}
.mm-modal-head h3, .mm-modal-head .card-subtitle, #mmRemoveText { overflow-wrap: anywhere; }
.mm-upload-form .field-hint { display: inline; }
@media (max-width: 600px) {
    .mm-upload-form .btn { flex: 1 1 100%; }
    .mm-actions { justify-content: flex-start; }
}

/* Additional Improvements #7: My Reports - Current / Archived and selection. */
.my-report-tools { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-3) 0; }
.my-report-tools .mode-toggle { display: inline-flex; gap: var(--space-2); }
.my-report-bulk { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.my-report-hint { padding: var(--space-2) var(--space-3) 0; margin: 0; }
.my-report-item { display: flex; align-items: stretch; gap: var(--space-2); }
.my-report-item .my-report-open { flex: 1; min-width: 0; }
.my-report-select { display: inline-flex; align-items: center; padding: 0 var(--space-1) 0 var(--space-3); min-width: 28px; }
.my-report-select input { width: 18px; height: 18px; }

/* Additional Improvements #8: Announcement History. */
.ah-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ah-open { width: 100%; text-align: left; display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-primary); font: inherit; cursor: pointer; }
.ah-open:hover, .ah-open:focus-visible { border-color: var(--accent-500, var(--border-strong)); }
.ah-item.is-unread .ah-open { border-left: 3px solid var(--accent-500, var(--border-strong)); }
.ah-head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ah-title { font-size: 0.98rem; }
.ah-preview { color: var(--text-secondary); overflow-wrap: anywhere; }
.ah-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* Additional Improvements #9: Developer Overview -> Active Sessions - filters, internal scroll, height of Recent System Activity. */
.dev-dash-row-sessions { align-items: stretch; }
.dev-dash-panel[data-dash-slot="sessions"] [data-dash-body="sessions"] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dev-dash-panel[data-dash-slot="sessions"].is-paired { contain: size; min-height: 380px; }
.dev-sess-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-2); }
.dev-sess-filters .input { flex: 1 1 180px; min-width: 0; }
.dev-sess-filters .select { flex: 0 1 170px; min-width: 0; }
.dev-sess-list { overflow-y: auto; max-height: 460px; min-height: 0; }
.is-paired .dev-sess-list { flex: 1 1 0; max-height: none; }
.dev-sess-list thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-card); }
.dev-sess-list:focus-visible { outline: 2px solid var(--accent-500, currentColor); outline-offset: -2px; }

/* Migration 066: Maintenance Access Code table - readable codes, copy beside each, never truncated. */
.mac-table td { vertical-align: middle; }
.mac-code-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.mac-code { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.14em;
    padding: 2px var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--surface-subtle, var(--surface-card)); color: var(--text-primary);
    white-space: nowrap; overflow: visible; text-overflow: clip; }
.mac-code-hint { font-weight: 500; color: var(--text-secondary); letter-spacing: 0.06em; }
.mac-never { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.mac-actions { text-align: right; white-space: nowrap; }
.mac-permanent-note { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
@media (max-width: 640px) {
    .mac-table thead { display: none; }
    .mac-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
    .mac-table td { border: 0; padding: 0; }
    .mac-table td:first-child { grid-column: 1 / -1; }
    .mac-table .mac-actions { grid-column: 1 / -1; text-align: left; }
}

/* Peripheral & Hardware Monitoring (migration 071) - assets/js/modules/hardware-monitor.js */
/* The summary cards: same size as before, an even gap between them. */
.hw-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
/* Clear Connection History sits at the end of the heading row, and under the heading when there is no room. */
.hw-history-head { flex-wrap: wrap; gap: var(--space-3); }
.hw-history-head > div { flex: 1 1 280px; min-width: 0; }
.hw-clear-modal .modal-body { display: grid; gap: var(--space-3); }
.hw-clear-modal .modal-body > * { margin: 0; }
.hw-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); align-items: end; }
.hw-filters .field { margin: 0; }
.hw-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.hw-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-3); }
/* Tables stay inside their card: fixed columns, long names wrap. Below 900 px a table keeps a readable width and scrolls inside
   its own frame, never the page. */
.hw-table { table-layout: fixed; }
.hw-table th, .hw-table td { padding: var(--space-3); white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
/* Status badges keep their whole word on one line; the columns below are wide enough for them. The hardware summary badges and
   the longer event names may break between words, never inside one. */
.hw-table td .badge { white-space: nowrap; overflow-wrap: normal; }
.hw-table td .hw-badges .badge, .hw-events-table td .badge { white-space: normal; }
.hw-computers-table th:nth-child(1) { width: 19%; }
.hw-computers-table th:nth-child(2) { width: 17%; }
.hw-computers-table th:nth-child(3) { width: 120px; }
.hw-computers-table th:nth-child(5) { width: 16%; }
.hw-computers-table th:nth-child(6) { width: 104px; }
.hw-events-table th:nth-child(1) { width: 15%; }
.hw-events-table th:nth-child(2) { width: 150px; }
.hw-events-table th:nth-child(4) { width: 14%; }
.hw-events-table th:nth-child(5) { width: 17%; }
.hw-events-table th:nth-child(6) { width: 15%; }
.hw-device-table th:nth-child(2) { width: 15%; }
.hw-device-table th:nth-child(3) { width: 148px; }
.hw-device-table th:nth-child(4) { width: 120px; }
.hw-device-table th:nth-child(5), .hw-device-table th:nth-child(6) { width: 15%; }
@media (max-width: 900px) {
    .hw-computers-table, .hw-events-table { min-width: 720px; }
    .hw-device-table { min-width: 760px; }
}
/* The Details dialog: never taller than the screen; title and buttons stay, the device list scrolls by itself. */
.modal.ar-modal-wide.hw-modal { max-width: 940px; display: flex; flex-direction: column; max-height: calc(100vh - 2 * var(--space-4)); max-height: calc(100dvh - 2 * var(--space-4)); }
.hw-modal .modal-header, .hw-modal .modal-footer { flex: none; }
/* 2026-11-18: the Connection filter inside Hardware Details - one compact row above the device table */
.hw-device-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.hw-device-filter .field { flex: 0 1 220px; min-width: 0; margin: 0; }
.hw-device-filter .field-hint { margin: 0 0 6px; }
.hw-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html.hw-scroll-lock { overflow: hidden; scrollbar-gutter: stable; }
#hardwareMonitorApp .table-wrap { position: relative; }

/* Agent Releases: PC picker and delivery status (migration 071) */
.ar-pc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.ar-pc-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-subtle); cursor: pointer; }
.ar-pc-row:first-child { border-top: 0; }
.ar-pc-row.is-blocked { cursor: not-allowed; background: var(--surface-subtle); }
.ar-pc-row input { width: 18px; height: 18px; margin-top: 2px; cursor: inherit; }
.ar-pc-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 600; }
.ar-pc-detail { grid-column: 2; font-size: 0.8rem; color: var(--text-secondary); }
.ar-pc-why { grid-column: 2; font-size: 0.8rem; color: var(--danger-text); }
.ar-confirm { padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-subtle); }
.ar-confirm ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); list-style: disc; max-height: 180px; overflow-y: auto; }
/* SOE Phase 2.2: Website Management - Theme Customization, one theme at a time */
.cms-theme-picker { padding: var(--space-4); margin-bottom: var(--space-4); }
.cms-theme-picker-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.cms-theme-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cms-theme-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--text-primary); background: var(--surface-subtle); border: 1px solid var(--border-subtle); border-radius: 999px; cursor: pointer; }
.cms-theme-tab[aria-selected="true"] { border-color: var(--accent-text); box-shadow: var(--lp-focus); }
.cms-theme-tab:focus-visible { outline: none; box-shadow: var(--lp-focus); }
.cms-theme-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.cms-theme-dot[data-dot="dyci-classic"] { background: linear-gradient(135deg, #1e3a70 50%, #e2ae45 50%); }
.cms-theme-dot[data-dot="midnight"] { background: linear-gradient(135deg, #0a101c 50%, #38bdf8 50%); }
.cms-theme-dot[data-dot="aurora"] { background: linear-gradient(135deg, #120f2b 50%, #c084fc 50%); }
/* .cms-theme-dot[data-dot="copper"]: theme-copper.css */
.cms-theme-dot[data-dot="emerald"] { background: linear-gradient(135deg, #0b100e 50%, #34d399 50%); }
.cms-theme-dot[data-dot="obsidian"] { background: linear-gradient(135deg, #0a0a0b 50%, #c9b38a 50%); }
.cms-theme-dot[data-dot="black-red"] { background: linear-gradient(135deg, #08080a 50%, #f0424f 50%); }
.cms-theme-live { padding: 1px 7px; font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--status-available-fg); background: var(--status-available-bg); border-radius: 999px; }
.cms-theme-live[hidden] { display: none; }
.cms-theme-actions { margin-top: var(--space-3); }
.cms-theme-mini { overflow: hidden; margin-bottom: var(--space-4); background: var(--m-background, #f5f7fb); border: 1px solid var(--m-border, #dbe1eb); color: var(--m-text, #151a29); }
.cms-mini-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--m-header, #ffffff); border-bottom: 1px solid var(--m-border, #dbe1eb); }
.cms-mini-brand { font-weight: 700; font-size: 0.86rem; color: var(--m-text); }
.cms-mini-nav { display: flex; gap: 6px; } .cms-mini-nav i { width: 26px; height: 5px; border-radius: 3px; background: var(--m-muted); opacity: 0.6; } .cms-mini-nav i:first-child { background: var(--m-accent); opacity: 1; }
.cms-mini-body { display: grid; grid-template-columns: 70px 1fr; min-height: 150px; }
.cms-mini-side { display: grid; align-content: start; gap: 8px; padding: 12px 10px; background: var(--m-sidebar, #0f2147); } .cms-mini-side i { height: 6px; border-radius: 3px; background: var(--m-muted); opacity: 0.55; } .cms-mini-side i:first-child { background: var(--m-accent); opacity: 1; }
.cms-mini-main { display: grid; gap: 10px; padding: 12px; }
.cms-mini-hero { padding: 12px; border-radius: 8px; background: var(--m-secondary); }
.cms-mini-title { margin: 0; font-weight: 700; color: var(--m-text); }
.cms-theme-mini[data-theme-kind="dyci-classic"] .cms-mini-hero .cms-mini-title, .cms-theme-mini[data-theme-kind="dyci-classic"] .cms-mini-hero .cms-mini-muted { color: #ffffff; }
.cms-mini-text { margin: 0; color: var(--m-text); } .cms-mini-muted { margin: 2px 0 0; font-size: 0.8rem; color: var(--m-muted); }
.cms-mini-card { position: relative; display: grid; gap: 6px; padding: 12px; border-radius: 8px; background: var(--m-surface); border: 1px solid var(--m-border); }
.cms-mini-btn { justify-self: start; padding: 5px 12px; font-size: 0.8rem; font-weight: 600; color: #ffffff; background: var(--m-primary); border-radius: 8px; }
.cms-mini-graph { width: 100%; height: 34px; }