/* ============================================
   Admin Pages - Shared CSS
   Consolidated styles for all admin pages
   ============================================ */

/* === Utility Classes === */
.hidden { display: none !important; }

/* Bootstrap utility shims — admin pages don't load Bootstrap, but the
   markup uses .text-center / .text-muted / .mx-2 / .py-3 / .small for the
   page footer (Privacy / Cookie / Terms links). Without these, the footer
   renders flush-left instead of centered with proper spacing. */
.text-center { text-align: center; }
.text-muted { color: var(--lr-ink-muted); }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.small { font-size: 0.875rem; }
.text-muted:hover { color: var(--lr-ink); }

/* === Reset === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Admin pages share the lr-* design system from landing-refresh.css.
   Previously this :root block aliased --primary / --secondary to lr-accent
   as a transitional shim. Stage 5 (2026-05-07) deleted the aliases and
   migrated all consumers to use lr-* tokens directly. */

body {
    font-family: var(--lr-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif);
    background: var(--lr-surface);
    color: var(--lr-ink-2);
}

/* === Navigation (shared across most admin pages) ===
   Was a full purple gradient that broke visual continuity with the rest of
   the platform (and never flipped in dark mode). Now matches the .lr-nav
   pattern used by landing/account/login: white card surface in light mode,
   navy in dark mode (via lr-* token flip). Active/hover state uses surface-2
   for a subtle tint that matches the dashboard sidebar. */
.admin-nav {
    background: var(--lr-card);
    color: var(--lr-ink);
    padding: 14px 32px;
    border-bottom: 1px solid var(--lr-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lr-ink);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-nav-links a {
    color: var(--lr-ink-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--lr-r-md, 6px);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.admin-nav-links a:hover,
.admin-nav-links a.active {
    color: var(--lr-ink);
    background: var(--lr-surface-2);
}

/* === Container === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Compact page header (admin, account, surveys) lives in landing-refresh.css
   under .lr-page-header — see the rule there. Removed local copy. */

/* admin.html uses 1200px container */
.container-sm {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* === Header (admin.html old-style) === */
.header {
    background: var(--lr-card);
    padding: 1.5rem 2rem;
    border-radius: var(--lr-r-lg, 8px);
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: var(--lr-accent, #6d4dff);
    font-size: 1.75rem;
}

.header-subtitle {
    color: var(--lr-ink-muted);
    margin-top: 0.5rem;
}

/* === Nav Buttons (admin.html) === */
.nav-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-btn-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === Stats Grid === */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-row-narrow {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-row-wide {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* === Stat Card === */
.stat-card {
    background: var(--lr-card);
    padding: 1.5rem;
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-compact {
    padding: 1.25rem;
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--lr-accent, #6d4dff);
    margin-bottom: 0.25rem;
}

.stat-card-sm h3 {
    font-size: 1.75rem;
}

.stat-card p {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
}

.stat-card-sm p {
    font-size: 0.85rem;
}

/* Stat card color variants */
.stat-card.green h3 { color: #047857; }
.stat-card.success h3 { color: #047857; }
.stat-card.orange h3 { color: #b45309; }
.stat-card.warning h3 { color: #b45309; }
.stat-card.purple h3 { color: #8b5cf6; }
.stat-card.red h3 { color: #ef4444; }
.stat-card.danger h3 { color: #ef4444; }
.stat-card.info h3 { color: var(--lr-accent, #6d4dff); }

/* Sub-stats inside stat card */
.stat-card .sub-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--lr-surface, #f1f5f9);
    font-size: 0.8rem;
}

.stat-card .sub-stats span {
    color: var(--lr-ink-muted);
}

/* === Tables === */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

th {
    background: var(--lr-surface);
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

tr:hover {
    background: var(--lr-surface);
}

/* Table wrapper for responsive */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Waitlist table card */
.waitlist-table {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.table-header h2 {
    color: var(--lr-ink);
}

/* Logs table */
.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--lr-surface);
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.logs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    font-size: 0.85rem;
}

.logs-table tr:hover {
    background: var(--lr-surface);
}

.logs-table-td-desc {
    max-width: 300px;
}

/* Sessions table */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--lr-surface);
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.sessions-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    font-size: 0.85rem;
}

.sessions-table tr:hover {
    background: var(--lr-surface);
}

/* Response table (modal) */
.response-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.response-table th,
.response-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.response-table th {
    background: var(--lr-surface);
    font-weight: 600;
    color: #475569;
}

.response-table tr:hover {
    background: var(--lr-surface);
}

/* === Buttons === */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--lr-r-md, 6px);
    border: 1px solid var(--lr-line, #e2e8f0);
    background: var(--lr-card);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn:hover {
    background: var(--lr-surface);
    border-color: #cbd5e1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--lr-accent, #6d4dff);
    color: white;
    border-color: var(--lr-accent, #6d4dff);
}

.btn-primary:hover {
    background: var(--lr-grad-to, #8b5cf6);
}

.btn-secondary {
    background: var(--lr-line, rgba(11,18,32,0.08));
    color: var(--lr-ink-2, #1f2937);
    border-color: var(--lr-line, rgba(11,18,32,0.08));
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-refresh {
    background: var(--lr-accent, #6d4dff);
    color: white;
    border: none;
}

.btn-refresh:hover {
    background: #2563eb;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.text-bg-success {
    background: #d1fae5;
    color: #065f46;
}

.text-bg-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-beta {
    background: #d1fae5;
    color: #065f46;
}

.badge-disabled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-converted {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

/* User badge (smaller) */
.user-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Event type badges */
.event-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-badge.admin { background: #fef3c7; color: #92400e; }
.event-badge.login { background: #dbeafe; color: #1e40af; }
.event-badge.security { background: #fee2e2; color: #991b1b; }
.event-badge.data { background: #d1fae5; color: #065f46; }
.event-badge.survey { background: #e0e7ff; color: #3730a3; }
.event-badge.default { background: var(--lr-surface, #f1f5f9); color: #475569; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--lr-r-xl, 12px);
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.expired { background: #fee2e2; color: #991b1b; }
.status-badge.admin { background: #e0e7ff; color: #3730a3; }

/* Survey status */
.survey-status {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: #d1fae5; color: #065f46; }
.status-draft { background: #fef3c7; color: #92400e; }
.status-paused { background: #fee2e2; color: #991b1b; }
.status-closed { background: var(--lr-line, #e2e8f0); color: #475569; }

/* Issue badges (flagged page) */
.issue-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.issue-badge.speeding { background: #fee2e2; color: #991b1b; }
.issue-badge.straightlining { background: #fef3c7; color: #92400e; }
.issue-badge.duplicate { background: #e0e7ff; color: #3730a3; }
.issue-badge.manual { background: #fce7f3; color: #9d174d; }
.issue-badge.severity-high { background: #fee2e2; color: #991b1b; }
.issue-badge.severity-medium { background: #fef3c7; color: #92400e; }
.issue-badge.reviewed { background: #d1fae5; color: #065f46; }

/* === Panels === */
.panel {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: var(--lr-ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-body {
    padding: 0;
}

/* Logs Panel */
.logs-panel {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Sessions Panel */
.sessions-panel {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* === Filters === */
.filters-panel {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filters-panel-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group-narrow {
    min-width: 140px;
}

.filter-group-no-flex {
    flex: 0;
}

.filter-group-flex2 {
    flex: 2;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lr-ink-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-md, 6px);
    font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus:not(:focus-visible) {
    outline: none;
    border-color: var(--lr-accent, #6d4dff);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group-inline label {
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
    display: inline;
    margin-bottom: 0;
    text-transform: none;
}

.filter-group-inline input,
.filter-group-inline select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-md, 6px);
    font-size: 0.9rem;
    width: auto;
}

.filter-user-input {
    width: 100px;
}

.filters-inner-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === Quick Filters === */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-filter-btn {
    padding: 0.4rem 0.8rem;
    border-radius: var(--lr-r-xl, 12px);
    border: 1px solid var(--lr-line, #e2e8f0);
    background: var(--lr-card);
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.quick-filter-btn:hover,
.quick-filter-btn.active {
    background: var(--lr-accent, #6d4dff);
    color: white;
    border-color: var(--lr-accent, #6d4dff);
}

/* === Search === */
.search-box {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-md, 6px);
    font-size: 0.9rem;
}

.search-input:focus:not(:focus-visible) {
    outline: none;
    border-color: var(--lr-accent, #6d4dff);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--lr-line, #e2e8f0);
}

.pagination-mt {
    margin-top: 1.5rem;
    border-top: none;
}

.pagination-info {
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--lr-ink-muted);
}

.loading-compact {
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--lr-line, #e2e8f0);
    border-top-color: var(--lr-accent, #6d4dff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 32px;
    height: 32px;
}

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

.loading-text {
    margin-top: 0.5rem;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--lr-ink-muted);
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.empty-state-sm i {
    font-size: 2.5rem;
}

/* === Error === */
.error {
    background: #fee;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--lr-r-md, 6px);
    margin-bottom: 1rem;
}

.error-message {
    background: #fee;
    border: 1px solid var(--lr-neg);
    color: var(--lr-neg);
    padding: 1rem;
    border-radius: var(--lr-r-md, 6px);
    margin-bottom: 1rem;
}

.success-message {
    background: #d1fae5;
    border: 1px solid var(--lr-ok);
    color: #065f46;
    padding: 1rem;
    border-radius: var(--lr-r-md, 6px);
    margin-bottom: 1rem;
}

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

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--lr-ink-muted);
}

.modal-close:hover {
    color: var(--lr-ink, #1e293b);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body-info {
    margin-bottom: 1rem;
    color: var(--lr-ink-muted);
}

.modal-body-actions {
    margin-top: 1rem;
}

/* === Content Grid (admin-users) === */
.content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

/* === User List === */
.user-list {
    max-height: 600px;
    overflow-y: auto;
}

.user-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    cursor: pointer;
    transition: background 0.2s;
}

.user-item:hover {
    background: var(--lr-surface);
}

.user-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--lr-accent, #6d4dff);
}

.user-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-item-info {
    flex: 1;
}

.user-email {
    font-weight: 600;
    color: var(--lr-ink);
    margin-bottom: 0.25rem;
}

.user-meta {
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
    display: flex;
    gap: 1rem;
}

.user-count-label {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
}

/* === Survey Panel === */
.survey-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.selected-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selected-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lr-grad-from, var(--lr-accent, #6d4dff)), var(--lr-grad-to, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.selected-user-name {
    margin: 0;
    font-size: 1.1rem;
}

.selected-user-count {
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
}

/* Survey List */
.survey-list {
    padding: 1rem;
}

.survey-card {
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-md, 6px);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

.survey-card:hover {
    border-color: var(--lr-accent, #6d4dff);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.survey-title {
    font-weight: 600;
    color: var(--lr-ink);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.survey-meta {
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
    margin-bottom: 0.75rem;
}

.survey-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
}

.survey-stats span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.survey-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--lr-surface, #f1f5f9);
}

/* Admin View Badge */
.admin-view-badge {
    background: linear-gradient(135deg, #dc2626, #ea580c); /* destructive — out of brand-gradient scope */
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Action Dropdown */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-btn {
    padding: 0.35rem 0.6rem;
    border-radius: var(--lr-r-md, 6px);
    border: 1px solid var(--lr-line, #e2e8f0);
    background: var(--lr-card);
    cursor: pointer;
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-dropdown-btn:hover {
    background: var(--lr-surface);
    border-color: #cbd5e1;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--lr-card);
    border-radius: var(--lr-r-md, 6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
    margin-top: 4px;
}

.action-dropdown-menu.show {
    display: block;
}

.action-dropdown-menu button {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.action-dropdown-menu button:hover {
    background: var(--lr-surface);
}

.action-dropdown-menu button.danger {
    color: #dc2626;
}

.action-dropdown-menu button.danger:hover {
    background: #fef2f2;
}

.action-dropdown-menu .divider {
    height: 1px;
    background: var(--lr-line, #e2e8f0);
    margin: 0.25rem 0;
}

/* Impersonation Banner */
.impersonation-banner {
    background: linear-gradient(135deg, #dc2626, #ea580c); /* destructive — out of brand-gradient scope */
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.impersonation-banner.hidden {
    display: none;
}

.impersonation-btn {
    background: var(--lr-card);
    color: #dc2626;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.impersonation-btn:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.impersonation-btn:active {
    background: #fee2e2;
    color: #991b1b;
}

/* Transfer Modal */
.transfer-modal-content {
    padding: 1rem;
}

.transfer-modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.transfer-modal-content input,
.transfer-modal-content select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-md, 6px);
    margin-bottom: 1rem;
}

/* === Metadata (logs page) === */
.metadata-toggle {
    background: none;
    border: none;
    color: var(--lr-accent, #6d4dff);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.metadata-toggle:hover {
    text-decoration: underline;
}

.metadata-content {
    display: none;
    background: var(--lr-surface);
    padding: 0.75rem;
    border-radius: var(--lr-r-md, 6px);
    font-family: monospace;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 0.5rem;
}

.metadata-content.show {
    display: block;
}

/* === IP & Device Info === */
.ip-badge {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--lr-ink-muted);
}

.device-info {
    font-size: 0.75rem;
    color: var(--lr-muted-2);
}

/* === Timestamp === */
.timestamp {
    font-size: 0.75rem;
    color: var(--lr-ink-muted);
}

.timestamp-relative {
    display: block;
    font-size: 0.7rem;
    color: var(--lr-muted-2);
}

/* === Online Indicator === */
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.online-dot.online { background: #10b981; }
.online-dot.away { background: #f59e0b; }
.online-dot.offline { background: #94a3b8; }

/* === Session Checkbox === */
.session-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* === Session user cell === */
.session-user-cell {
    display: flex;
    align-items: center;
}

/* === Quality Score (flagged page) === */
.quality-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.quality-score.high { background: #d1fae5; color: #065f46; }
.quality-score.medium { background: #fef3c7; color: #92400e; }
.quality-score.low { background: #fee2e2; color: #991b1b; }

/* === Flagged Responses === */
.responses-grid {
    display: grid;
    gap: 1rem;
}

.response-card {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    transition: box-shadow 0.2s;
}

.response-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.response-card.reviewed {
    border-left: 3px solid #10b981;
}

.response-card.excluded {
    opacity: 0.6;
    border-left: 3px solid #94a3b8;
}

.response-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.response-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--lr-ink-muted);
    margin-bottom: 0.75rem;
}

.response-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.issues-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.response-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

/* === Analytics Page === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--lr-ink);
}

.period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--lr-line, #e2e8f0);
    background: var(--lr-card);
    border-radius: var(--lr-r-md, 6px);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, background 0.2s ease;
}

.period-btn:hover {
    background: var(--lr-surface);
}

.period-btn.active {
    background: linear-gradient(135deg, var(--lr-grad-from, var(--lr-accent, #6d4dff)), var(--lr-grad-to, #8b5cf6));
    color: white;
    border: none;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.chart-header h2 {
    font-size: 1rem;
    color: var(--lr-ink);
}

.chart-body {
    padding: 1.5rem;
}

.chart-container {
    height: 250px;
    position: relative;
}

/* Leaderboards */
.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.leaderboard-card {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.leaderboard-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-header h2 {
    font-size: 1rem;
    color: var(--lr-ink);
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lr-surface, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
}

.leaderboard-rank.gold { background: #fef3c7; color: #92400e; }
.leaderboard-rank.silver { background: var(--lr-line, #e2e8f0); color: #475569; }
.leaderboard-rank.bronze { background: #fed7aa; color: #9a3412; }

.leaderboard-info { flex: 1; }

.leaderboard-title {
    font-weight: 600;
    color: var(--lr-ink);
    margin-bottom: 0.15rem;
}

.leaderboard-meta {
    font-size: 0.8rem;
    color: var(--lr-ink-muted);
}

.leaderboard-stat { text-align: right; }

.leaderboard-stat-value {
    font-weight: 600;
    color: var(--lr-accent, #6d4dff);
    font-size: 1.1rem;
}

.leaderboard-stat-label {
    font-size: 0.75rem;
    color: var(--lr-ink-muted);
}

/* Leaderboard empty state */
.leaderboard-empty {
    padding: 2rem;
    text-align: center;
    color: var(--lr-ink-muted);
}

/* Activity Feed */
.activity-card {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.activity-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.activity-header h2 {
    font-size: 1rem;
    color: var(--lr-ink);
}

.activity-list {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--lr-r-md, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.activity-icon.user { background: #dbeafe; color: #2563eb; }
.activity-icon.survey { background: #d1fae5; color: #059669; }

.activity-content { flex: 1; }

.activity-text {
    font-size: 0.9rem;
    color: var(--lr-ink);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--lr-muted-2);
}

/* Activity empty state */
.activity-empty {
    padding: 2rem;
    text-align: center;
    color: var(--lr-ink-muted);
}

/* Distribution Charts */
.distribution-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.distribution-bar-container {
    flex: 1;
    height: 8px;
    background: var(--lr-surface, #f1f5f9);
    border-radius: var(--lr-r-sm, 4px);
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    border-radius: var(--lr-r-sm, 4px);
}

.distribution-label {
    font-size: 0.8rem;
    color: var(--lr-ink-muted);
    min-width: 80px;
}

.distribution-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lr-ink);
    min-width: 40px;
    text-align: right;
}

/* === Health Page === */
.status-banner {
    padding: 1.5rem;
    border-radius: var(--lr-r-lg, 8px);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-banner.healthy { background: #d1fae5; color: #065f46; }
.status-banner.degraded { background: #fef3c7; color: #92400e; }
.status-banner.unhealthy { background: #fee2e2; color: #991b1b; }
.status-banner i { font-size: 2rem; }
.status-banner h2 { font-size: 1.25rem; }
.status-banner p { font-size: 0.9rem; opacity: 0.8; }

.status-banner-actions {
    margin-left: auto;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

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

/* Stat rows (health page) */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
}

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

.stat-label {
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
}

.stat-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Service Status */
.service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
}

.service-item:last-child { border-bottom: none; }

.service-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.service-status.healthy { background: #10b981; }
.service-status.degraded { background: #f59e0b; }
.service-status.unhealthy { background: #ef4444; }

.service-name {
    flex: 1;
    font-size: 0.9rem;
}

.service-latency {
    font-size: 0.8rem;
    color: var(--lr-ink-muted);
}

/* Mini Charts (health page) */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    margin-top: 1rem;
}

.mini-bar {
    flex: 1;
    background: var(--lr-accent, #6d4dff);
    border-radius: var(--lr-r-sm, 4px);
    min-height: 4px;
}

.mini-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--lr-muted-2);
    margin-top: 0.5rem;
}

/* Progress Bars */
.progress-container {
    margin-top: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.progress-bar {
    height: 8px;
    background: var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-sm, 4px);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--lr-r-sm, 4px);
    transition: width 0.3s;
}

.progress-fill.green { background: #10b981; }
.progress-fill.yellow { background: #f59e0b; }
.progress-fill.red { background: #ef4444; }
.progress-fill.blue { background: var(--lr-accent, #6d4dff); }

/* Error Log Items */
.error-item {
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: var(--lr-r-md, 6px);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.error-item:last-child { margin-bottom: 0; }

.error-time {
    color: #991b1b;
    font-weight: 600;
}

.error-msg {
    color: #7f1d1d;
    margin-top: 0.25rem;
}

/* Last Updated */
.last-updated {
    text-align: center;
    color: var(--lr-muted-2);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* Health page empty text */
.health-empty-text {
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Health page no-data text */
.health-no-data {
    color: var(--lr-muted-2);
    text-align: center;
    width: 100%;
}

/* === Waitlist Page (admin.html) ===
   Was a full-page purple gradient that bled around the now-white .admin-nav,
   making it look like a stray border ring. Replaced with the standard page
   surface so the layout matches the other admin pages. */
.waitlist-body {
    background: var(--lr-surface);
    min-height: 100vh;
    padding: 0;
}

.waitlist-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--lr-card);
    border-radius: var(--lr-r-xl, 12px);
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.waitlist-container h1 {
    color: var(--lr-ink);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--lr-ink-muted);
    margin-bottom: 2rem;
}

.waitlist-stat-card {
    background: var(--lr-line);
    padding: 1.5rem;
    border-radius: var(--lr-r-lg, 8px);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--lr-accent);
}

.stat-number-label {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--lr-accent);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.notes {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--lr-ink-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.email-text {
    color: var(--lr-accent);
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-grant {
    background: var(--lr-ok);
    color: white;
    border: none;
}

.btn-grant:hover {
    background: #059669;
}

.btn-grant:disabled {
    background: var(--lr-ink-muted);
    cursor: not-allowed;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Announcement preview button — was inline style="background:#6366f1; color:white" */
.btn-preview-announcement {
    background: var(--lr-accent);
    color: #fff;
}

.btn-preview-announcement:hover {
    background: var(--lr-accent-2);
}

/* Institution form modal — lr-form-input styling for un-classed inputs.
   admin-sso.html#institution-form is a deeply-nested SAML/OIDC form;
   rather than touch every <input>/<select>/<textarea>, scope styling
   here to match the lr-form-input pattern in landing-refresh.css. */
#institution-form input[type="text"],
#institution-form input[type="password"],
#institution-form input[type="email"],
#institution-form select,
#institution-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lr-line);
    border-radius: var(--lr-r-md, 6px);
    background: var(--lr-card);
    font-size: 14px;
    font-family: inherit;
    color: var(--lr-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#institution-form input[type="text"]:focus,
#institution-form input[type="password"]:focus,
#institution-form input[type="email"]:focus,
#institution-form select:focus,
#institution-form textarea:focus {
    outline: none;
    border-color: var(--lr-accent);
    box-shadow: 0 0 0 3px rgba(109, 77, 255, 0.15);
}

#institution-form textarea { resize: vertical; min-height: 80px; }

#institution-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--lr-ink);
}

#institution-form .mb-3 { margin-bottom: 1rem; }
#institution-form h3 { font-size: 1.1rem; font-weight: 700; color: var(--lr-ink); margin-top: 1rem; }

#institution-form .modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--lr-line);
    margin-top: 1.5rem;
}

#institution-form .modal-actions .btn-secondary {
    background: var(--lr-surface);
    color: var(--lr-ink);
    border: 1px solid var(--lr-line);
}

#institution-form .modal-actions .btn-primary {
    background: var(--lr-accent);
    color: #fff;
    border: 1px solid var(--lr-accent);
}

#institution-form .modal-actions .btn-primary:hover {
    background: var(--lr-accent-2);
}

/* Announcement preview container — was inline style="margin-top:1rem; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden" */
.announcement-preview-box {
    margin-top: 1rem;
    border: 1px solid var(--lr-line);
    border-radius: var(--lr-r-lg, 8px);
    overflow: hidden;
    background: var(--lr-card);
}

/* Inline pill label (e.g. "MAIN TABLE" pill in card headers) — was inline
   style="font-size:10px;vertical-align:middle;margin-left:8px;" */
.lbl-pill-inline {
    font-size: 10px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Overdue badge (admin-breach.html) — was inline style="background:var(--lr-neg);
   color:#fff;padding:2px 8px;border-radius:4px;font-size:12px;margin-left:8px" */
.lbl-overdue {
    background: var(--lr-neg);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 12px;
    margin-left: 8px;
}

/* Narrower container variants — replace inline style="max-width: 900px"
   and "max-width: 960px" on admin-breach / admin-announcements containers. */
.container.container-narrow { max-width: 900px; }
.container.container-medium { max-width: 960px; }

/* Compact announcement input — inline style="min-height:auto; padding:0.6rem 0.75rem;" */
.ann-input-compact {
    min-height: auto;
    padding: 0.6rem 0.75rem;
}

/* Standalone class form of .ann-field label (useful when label sits outside
   the .ann-field wrapper or for explicit semantics). */
.ann-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--lr-ink, #334155);
    margin-bottom: 0.35rem;
}

.access-granted-text {
    color: var(--lr-ok);
    font-size: 0.9rem;
}

.waitlist-empty-text {
    text-align: center;
    color: var(--lr-ink-muted);
    padding: 2rem;
}

/* === Waitlist Page Card System === */
.wl-card {
    background: var(--lr-card);
    border: 1px solid var(--lr-line, #e2e8f0);
    border-radius: var(--lr-r-lg, 8px);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.wl-card-header {
    padding: 1rem 1.5rem;
    background: var(--lr-surface, #f1f5f9);
    border-bottom: 1px solid var(--lr-line, #e2e8f0);
}

.wl-card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--lr-ink);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wl-card-header h2 i {
    color: var(--lr-accent);
    font-size: 0.95rem;
}

.wl-card-body {
    padding: 1.5rem;
}

.wl-card-desc {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.waitlist-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* When tables live inside wl-card, let them stretch edge-to-edge */
.wl-card-body .table-wrapper {
    margin: 0 -1.5rem -1.5rem;
}

.wl-card-body .table-wrapper table {
    border-radius: 0;
}

.wl-card-body .table-wrapper table th:first-child,
.wl-card-body .table-wrapper table td:first-child {
    padding-left: 1.5rem;
}

.wl-card-body .table-wrapper table th:last-child,
.wl-card-body .table-wrapper table td:last-child {
    padding-right: 1.5rem;
}

/* Stats inside a card don't need bottom margin */
.wl-card-body .stats {
    margin-bottom: 1rem;
}

/* === Beta Invite Section (waitlist page) === */
/* Keep old classes for backwards compat but no longer used in HTML */
.beta-invite-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--lr-r-lg, 8px);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.beta-invite-section h2 {
    color: var(--lr-ink);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.beta-invite-section h2 i {
    color: var(--lr-accent);
    margin-right: 0.5rem;
}

.beta-invite-desc {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.beta-email-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--lr-r-md, 6px);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

.beta-email-input:focus:not(:focus-visible) {
    outline: none;
    border-color: var(--lr-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.beta-invite-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.beta-email-count {
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
}

.beta-send-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    border-radius: var(--lr-r-md, 6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.beta-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.beta-invite-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--lr-r-md, 6px);
    font-size: 0.9rem;
}

.beta-result-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.beta-result-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.beta-result-message {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.beta-result-message i {
    margin-right: 0.25rem;
}

.beta-result-detail {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.beta-result-sent { color: #065f46; }
.beta-result-failed { color: #991b1b; }
.beta-result-invalid { color: #92400e; }

/* === Beta Code Tracking Section === */
/* Old standalone styles — kept for compatibility but .wl-card is preferred */
.beta-tracking-section {
    background: var(--lr-card);
    border-radius: var(--lr-r-lg, 8px);
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.beta-tracking-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--lr-ink);
}

.beta-tracking-section h2 i {
    color: var(--lr-accent);
    margin-right: 0.5rem;
}

.beta-tracking-desc {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.beta-tracking-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.beta-tracking-stat {
    background: var(--lr-surface);
    border-radius: var(--lr-r-md, 6px);
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.beta-tracking-stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lr-ink);
}

.beta-tracking-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--lr-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

.beta-tracking-stat.stat-pending .beta-tracking-stat-num { color: #d97706; }
.beta-tracking-stat.stat-used .beta-tracking-stat-num { color: #059669; }
.beta-tracking-stat.stat-expired .beta-tracking-stat-num { color: var(--lr-muted-2); }

.beta-codes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.beta-codes-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.beta-codes-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.beta-codes-table tbody tr:hover {
    background: var(--lr-surface);
}

.beta-code-display {
    background: var(--lr-surface);
    padding: 0.2rem 0.5rem;
    border-radius: var(--lr-r-sm, 4px);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--lr-ink);
}

.badge-expired {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--lr-surface);
    color: var(--lr-ink-muted);
}

.btn-revoke {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.75rem;
    border-radius: var(--lr-r-md, 6px);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-revoke:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.badge-revoked {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #fef2f2;
    color: #dc2626;
}

.text-muted {
    color: var(--lr-muted-2);
}

/* admin.html use-case column */
.use-case-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* admin.html granted text */
.granted-text {
    color: #10b981;
}

/* code display in modals */
.response-id-code {
    font-size: 0.8rem;
}

/* flag icon in responses */
.flag-icon-red {
    color: #dc2626;
}

/* === Breach Notification Page === */
.breach-page-header {
    margin-bottom: 1.5rem;
}

.breach-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lr-ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breach-page-header h1 i {
    color: var(--lr-accent);
}

.breach-page-subtitle {
    color: var(--lr-ink-muted);
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.breach-field {
    margin-bottom: 1rem;
}

.breach-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    color: var(--lr-ink);
}

.breach-optional {
    font-weight: 400;
    color: var(--lr-ink-muted);
    font-size: 0.85rem;
}

.breach-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--lr-r-md, 6px);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s;
    background: var(--lr-card);
    color: var(--lr-ink);
}

.breach-input:focus:not(:focus-visible) {
    outline: none;
    border-color: var(--lr-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.breach-input::placeholder {
    color: var(--lr-muted-2);
}

textarea.breach-input {
    resize: vertical;
    min-height: 120px;
}

select.breach-input {
    cursor: pointer;
    appearance: auto;
}

.breach-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

.breach-user-count {
    font-size: 0.85rem;
    color: var(--lr-ink-muted);
    padding: 0.5rem 0;
}

.breach-form-actions {
    margin-top: 0.5rem;
}

.breach-send-btn {
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    border-radius: var(--lr-r-md, 6px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.breach-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Confirmation banner */
.breach-confirm {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: var(--lr-r-lg, 8px);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.breach-confirm-icon {
    color: #d97706;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.breach-confirm-body p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: #92400e;
    line-height: 1.5;
}

.breach-confirm-actions {
    display: flex;
    gap: 0.5rem;
}

/* Result banner */
.breach-result-banner {
    padding: 0.75rem 1rem;
    border-radius: var(--lr-r-lg, 8px);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.breach-result-banner.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.breach-result-banner.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* History table */
.breach-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.breach-history-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.breach-history-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.breach-history-table tbody tr:hover {
    background: var(--lr-surface);
}

.severity-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.severity-critical {
    background: #fef2f2;
    color: #dc2626;
}

.severity-high {
    background: #fff7ed;
    color: #ea580c;
}

.severity-medium {
    background: #fffbeb;
    color: #d97706;
}

.breach-sent-count {
    color: #059669;
    font-weight: 500;
}

.breach-failed-count {
    color: #dc2626;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* LAYOUT-SPECIFIC — not in source */
@media (max-width: 600px) {
    .breach-field-row {
        grid-template-columns: 1fr;
    }

    .breach-confirm {
        flex-direction: column;
    }

    .breach-confirm-actions {
        flex-direction: column;
    }
}

/* === Responsive Styles === */

/* admin.html responsive */
@media (max-width: 1024px) {
    .container-sm {
        padding: 1rem;
    }

    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-buttons .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    th, td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .container-sm {
        padding: 1.5rem;
    }

    .admin-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-buttons .btn {
        flex: 0 0 auto;
    }

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

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .stat-card p {
        font-size: 0.75rem;
    }

    table {
        min-width: 800px;
    }

    th, td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .logs-table {
        display: block;
        overflow-x: auto;
    }

    .sessions-table {
        display: block;
        overflow-x: auto;
    }

    .filters-panel-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .response-card {
        grid-template-columns: 1fr;
    }

    .response-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* LAYOUT-SPECIFIC — not in source */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .header p {
        font-size: 0.8rem;
    }

    .nav-buttons .btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }

    .nav-buttons .btn i {
        display: none;
    }

    .stats {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    .table-header {
        padding: 1rem;
    }

    .table-header h2 {
        font-size: 1rem;
    }

    .quick-filters {
        flex-wrap: wrap;
    }
}

/* Waitlist page specific responsive */
@media (max-width: 1024px) {
    .waitlist-body {
        padding: 1rem;
    }

    .waitlist-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .waitlist-body {
        padding: 0.5rem;
    }

    .waitlist-container {
        padding: 1rem;
        border-radius: var(--lr-r-lg, 8px);
    }

    .waitlist-container h1 {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-number-label {
        font-size: 0.75rem;
    }

    .btn-small {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* LAYOUT-SPECIFIC — not in source */
@media (max-width: 480px) {
    .waitlist-container h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* ============================================================
   Announcements Admin Page
   ============================================================ */

.ann-page-header {
    margin-bottom: 1.5rem;
}

.ann-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--lr-ink);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ann-page-header h1 i {
    color: var(--lr-accent, #6d4dff);
    font-size: 1.5rem;
}

.ann-page-subtitle {
    color: var(--lr-ink-muted);
    margin-top: 0.25rem;
}

/* Form fields */
.ann-field {
    margin-bottom: 1rem;
}

.ann-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lr-ink, #334155);
    margin-bottom: 0.35rem;
}

.ann-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.93rem;
    line-height: 1.5;
    border: 1px solid #d1d5db;
    border-radius: var(--lr-r-md, 6px);
    background: #fff;
    color: var(--lr-ink);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ann-input:focus:not(:focus-visible) {
    outline: none;
    border-color: var(--lr-accent, #6d4dff);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

textarea.ann-input {
    resize: vertical;
    min-height: 80px;
}

select.ann-input {
    cursor: pointer;
}

/* Side-by-side fields */
.ann-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .ann-field-row {
        grid-template-columns: 1fr;
    }
}

/* Internal visibility hint */
.ann-internal-hint {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--lr-r-md, 6px);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.ann-internal-hint i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Form actions */
.ann-form-actions {
    margin-top: 0.5rem;
}

/* Result banner */
.ann-result-banner {
    padding: 0.75rem 1rem;
    border-radius: var(--lr-r-md, 6px);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: opacity 0.3s;
}

.ann-result-banner.success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.ann-result-banner.error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* Announcements table */
.ann-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ann-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--lr-ink-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--lr-line, #e2e8f0);
}

.ann-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--lr-surface, #f1f5f9);
    vertical-align: top;
}

.ann-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.04);
}

.ann-internal-row {
    background: rgba(245, 158, 11, 0.04);
}

.ann-title-cell {
    font-weight: 600;
    color: var(--lr-ink);
    margin-bottom: 0.2rem;
}

.ann-desc-cell {
    color: var(--lr-ink-muted);
    font-size: 0.83rem;
    line-height: 1.4;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Type badges */
.ann-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.ann-type-feature { background: #dbeafe; color: #1e40af; }
.ann-type-fix { background: #fce7f3; color: #9d174d; }
.ann-type-improvement { background: #d1fae5; color: #065f46; }

/* Visibility badges */
.ann-vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.ann-vis-public { background: #d1fae5; color: #065f46; }
.ann-vis-internal { background: #fef3c7; color: #92400e; }

/* Action buttons in table */
.ann-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.4rem;
}

/* Inline edit form */
.ann-editing-row td {
    background: var(--lr-surface);
    padding: 1rem;
}

.ann-edit-form {
    max-width: 700px;
}

.ann-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Delete modal */
.ann-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ann-modal {
    background: #fff;
    border-radius: var(--lr-r-lg, 8px);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.ann-modal-icon {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.ann-modal-detail {
    color: var(--lr-ink-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.ann-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ann-table th:nth-child(4),
    .ann-table td:nth-child(4) {
        display: none;
    }

    .ann-desc-cell {
        max-width: 200px;
    }
}

/* ============================================================
   Dark Mode Overrides
   Activated when body.dark-mode or html.dark-mode is present.
   ============================================================ */

body.dark-mode {
    background: #1a1a2e !important;
    color: var(--lr-line, #e2e8f0) !important;
}

/* === Header (admin.html) === */
body.dark-mode .header {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .header h1 {
    color: #63b3ed;
}

body.dark-mode .header-subtitle {
    color: #a0aec0;
}

/* === Stat Cards === */
body.dark-mode .stat-card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stat-card h3 {
    color: #63b3ed;
}

body.dark-mode .stat-card p {
    color: #a0aec0;
}

body.dark-mode .stat-card .sub-stats {
    border-top-color: #2d3748;
}

body.dark-mode .stat-card .sub-stats span {
    color: #a0aec0;
}

/* Stat card color variants in dark mode */
body.dark-mode .stat-card.green h3,
body.dark-mode .stat-card.success h3 { color: #34d399; }
body.dark-mode .stat-card.orange h3,
body.dark-mode .stat-card.warning h3 { color: #fbbf24; }
body.dark-mode .stat-card.purple h3 { color: #a78bfa; }
body.dark-mode .stat-card.red h3,
body.dark-mode .stat-card.danger h3 { color: #f87171; }
body.dark-mode .stat-card.info h3 { color: #63b3ed; }

/* === Tables === */
body.dark-mode th,
body.dark-mode td {
    border-bottom-color: #2d3748;
}

body.dark-mode th {
    background: #1a1a2e;
    color: #a0aec0;
}

body.dark-mode tr:hover {
    background: #1e2a4a;
}

body.dark-mode .waitlist-table {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .table-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .table-header h2 {
    color: var(--lr-line, #e2e8f0);
}

/* Logs table */
body.dark-mode .logs-table th {
    background: #1a1a2e;
    color: #a0aec0;
    border-bottom-color: #2d3748;
}

body.dark-mode .logs-table td {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .logs-table tr:hover {
    background: #1e2a4a;
}

/* Sessions table */
body.dark-mode .sessions-table th {
    background: #1a1a2e;
    color: #a0aec0;
    border-bottom-color: #2d3748;
}

body.dark-mode .sessions-table td {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .sessions-table tr:hover {
    background: #1e2a4a;
}

/* Response table */
body.dark-mode .response-table th,
body.dark-mode .response-table td {
    border-bottom-color: #2d3748;
}

body.dark-mode .response-table th {
    background: #1a1a2e;
    color: #a0aec0;
}

body.dark-mode .response-table tr:hover {
    background: #1e2a4a;
}

/* === Buttons ===
   Bug fix: `color: var(--lr-line, ...)` was using a BORDER token as text
   color. In dark mode --lr-line = #2d3748 (dark slate) on a #16213e button
   bg = dark-on-dark, near unreadable. Use --lr-ink (proper text token,
   resolves to light #e2e8f0 in dark mode) instead. The fallback already
   was correct; the var() reference was wrong. */
body.dark-mode .btn {
    border-color: #2d3748;
    background: #16213e;
    color: var(--lr-ink, #e2e8f0);
}

body.dark-mode .btn:hover {
    background: #1e2a4a;
    border-color: #4a5568;
    color: var(--lr-ink, #e2e8f0);
}

body.dark-mode .btn-primary {
    background: var(--lr-accent, #6d4dff);
    color: white;
    border-color: var(--lr-accent, #6d4dff);
}

body.dark-mode .btn-primary:hover {
    background: var(--lr-grad-to, #8b5cf6);
}

body.dark-mode .btn-secondary {
    background: #2d3748;
    color: var(--lr-line, #e2e8f0);
    border-color: #2d3748;
}

body.dark-mode .btn-secondary:hover {
    background: #4a5568;
}

body.dark-mode .btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

body.dark-mode .btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

body.dark-mode .btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

body.dark-mode .btn-refresh {
    background: var(--lr-accent, #6d4dff);
    color: white;
}

/* === Badges === */
body.dark-mode .text-bg-success {
    background: #1a3a2a;
    color: #6ee7b7;
}

body.dark-mode .text-bg-info {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark-mode .badge-admin {
    background: #3b2e00;
    color: #fcd34d;
}

body.dark-mode .badge-beta {
    background: #1a3a2a;
    color: #6ee7b7;
}

body.dark-mode .badge-disabled {
    background: #3b1a1a;
    color: #fca5a5;
}

body.dark-mode .badge-converted {
    background: #1a3a2a;
    color: #6ee7b7;
}

body.dark-mode .badge-pending {
    background: #3b2e00;
    color: #fcd34d;
}

/* Event badges */
body.dark-mode .event-badge.admin { background: #3b2e00; color: #fcd34d; }
body.dark-mode .event-badge.login { background: #1e3a5f; color: #93c5fd; }
body.dark-mode .event-badge.security { background: #3b1a1a; color: #fca5a5; }
body.dark-mode .event-badge.data { background: #1a3a2a; color: #6ee7b7; }
body.dark-mode .event-badge.survey { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .event-badge.default { background: #1e2a4a; color: #a0aec0; }

/* Status badges */
body.dark-mode .status-badge.active { background: #1a3a2a; color: #6ee7b7; }
body.dark-mode .status-badge.expired { background: #3b1a1a; color: #fca5a5; }
body.dark-mode .status-badge.admin { background: #1e1b4b; color: #a5b4fc; }

/* Survey status */
body.dark-mode .status-active { background: #1a3a2a; color: #6ee7b7; }
body.dark-mode .status-draft { background: #3b2e00; color: #fcd34d; }
body.dark-mode .status-paused { background: #3b1a1a; color: #fca5a5; }
body.dark-mode .status-closed { background: #1e2a4a; color: #a0aec0; }

/* Issue badges */
body.dark-mode .issue-badge.speeding { background: #3b1a1a; color: #fca5a5; }
body.dark-mode .issue-badge.straightlining { background: #3b2e00; color: #fcd34d; }
body.dark-mode .issue-badge.duplicate { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .issue-badge.manual { background: #3b1533; color: #f9a8d4; }
body.dark-mode .issue-badge.severity-high { background: #3b1a1a; color: #fca5a5; }
body.dark-mode .issue-badge.severity-medium { background: #3b2e00; color: #fcd34d; }
body.dark-mode .issue-badge.reviewed { background: #1a3a2a; color: #6ee7b7; }

/* === Panels === */
body.dark-mode .panel {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .panel-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .panel-header h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .logs-panel {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sessions-panel {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === Filters === */
body.dark-mode .filters-panel {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .filter-group label {
    color: #a0aec0;
}

body.dark-mode .filter-group input,
body.dark-mode .filter-group select {
    background: #1a1a2e !important;
    border-color: #2d3748 !important;
    color: var(--lr-line, #e2e8f0) !important;
}

body.dark-mode .filter-group input:focus,
body.dark-mode .filter-group select:focus {
    border-color: var(--lr-accent, #6d4dff);
}

body.dark-mode .filter-group input::placeholder {
    color: #718096;
}

body.dark-mode .filter-group-inline label {
    color: #a0aec0;
}

body.dark-mode .filter-group-inline input,
body.dark-mode .filter-group-inline select {
    background: #1a1a2e !important;
    border-color: #2d3748 !important;
    color: var(--lr-line, #e2e8f0) !important;
}

/* Quick filters */
body.dark-mode .quick-filter-btn {
    border-color: #2d3748;
    background: #16213e;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .quick-filter-btn:hover,
body.dark-mode .quick-filter-btn.active {
    background: var(--lr-accent, #6d4dff);
    color: white;
    border-color: var(--lr-accent, #6d4dff);
}

/* === Search === */
body.dark-mode .search-box {
    border-bottom-color: #2d3748;
}

body.dark-mode .search-input {
    background: #1a1a2e !important;
    border-color: #2d3748 !important;
    color: var(--lr-line, #e2e8f0) !important;
}

body.dark-mode .search-input::placeholder {
    color: #718096;
}

body.dark-mode .search-input:focus {
    border-color: var(--lr-accent, #6d4dff);
}

/* === Pagination === */
body.dark-mode .pagination {
    border-top-color: #2d3748;
}

body.dark-mode .pagination-info {
    color: #a0aec0;
}

/* === Loading === */
body.dark-mode .loading {
    color: #a0aec0;
}

body.dark-mode .spinner {
    border-color: #2d3748;
    border-top-color: var(--lr-accent, #6d4dff);
}

/* === Empty State === */
body.dark-mode .empty-state {
    color: #a0aec0;
}

body.dark-mode .empty-state i {
    color: #4a5568;
}

/* === Error / Success Messages === */
body.dark-mode .error {
    background: #3b1a1a;
    color: #fca5a5;
}

body.dark-mode .error-message {
    background: #3b1a1a;
    border-color: #ef4444;
    color: #fca5a5;
}

body.dark-mode .success-message {
    background: #1a3a2a;
    border-color: #10b981;
    color: #6ee7b7;
}

/* === Modal === */
body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .modal-content {
    background: #16213e !important;
}

body.dark-mode .modal-header {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .modal-title {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .modal-close {
    color: #a0aec0;
}

body.dark-mode .modal-close:hover {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .modal-body {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .modal-body-info {
    color: #a0aec0;
}

/* === User List === */
body.dark-mode .user-item {
    background: transparent;
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .user-item:hover {
    background: #1e2a4a;
}

body.dark-mode .user-item.active {
    background: #0f3460;
    border-left-color: var(--lr-accent, #6d4dff);
}

body.dark-mode .user-email {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .user-meta {
    color: #a0aec0;
}

body.dark-mode .user-count-label {
    color: #a0aec0;
}

/* === Survey Cards === */
body.dark-mode .survey-card {
    border-color: #2d3748;
}

body.dark-mode .survey-card:hover {
    border-color: var(--lr-accent, #6d4dff);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

body.dark-mode .survey-title {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .survey-meta {
    color: #a0aec0;
}

body.dark-mode .survey-stats {
    color: #a0aec0;
}

body.dark-mode .survey-actions {
    border-top-color: #2d3748;
}

/* === Action Dropdown === */
body.dark-mode .action-dropdown-btn {
    border-color: #2d3748;
    background: #16213e;
    color: #a0aec0;
}

body.dark-mode .action-dropdown-btn:hover {
    background: #1e2a4a;
    border-color: #4a5568;
}

body.dark-mode .action-dropdown-menu {
    background: #16213e !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .action-dropdown-menu button {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .action-dropdown-menu button:hover {
    background: #1e2a4a;
}

body.dark-mode .action-dropdown-menu button.danger {
    color: #f87171;
}

body.dark-mode .action-dropdown-menu button.danger:hover {
    background: #3b1a1a;
}

body.dark-mode .action-dropdown-menu .divider {
    background: #2d3748;
}

/* Dark mode overrides use rgba tints — base hex values
   (#fef2f2/#fee2e2) clash with dark backgrounds */
body.dark-mode .impersonation-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

body.dark-mode .impersonation-btn:active {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

/* === Transfer Modal === */
body.dark-mode .transfer-modal-content label {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .transfer-modal-content input,
body.dark-mode .transfer-modal-content select {
    background: #1a1a2e !important;
    border-color: #2d3748 !important;
    color: var(--lr-line, #e2e8f0) !important;
}

/* === Metadata === */
body.dark-mode .metadata-toggle {
    color: #63b3ed;
}

body.dark-mode .metadata-content {
    background: #1a1a2e !important;
    color: var(--lr-line, #e2e8f0);
}

/* === IP & Device Info === */
body.dark-mode .ip-badge {
    color: #a0aec0;
}

body.dark-mode .device-info {
    color: #718096;
}

/* === Timestamp === */
body.dark-mode .timestamp {
    color: #a0aec0;
}

body.dark-mode .timestamp-relative {
    color: #718096;
}

/* === Quality Score === */
body.dark-mode .quality-score.high { background: #1a3a2a; color: #6ee7b7; }
body.dark-mode .quality-score.medium { background: #3b2e00; color: #fcd34d; }
body.dark-mode .quality-score.low { background: #3b1a1a; color: #fca5a5; }

/* === Response Cards (flagged) === */
body.dark-mode .response-card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .response-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .response-meta {
    color: #a0aec0;
}

body.dark-mode .response-info h4 {
    color: var(--lr-line, #e2e8f0);
}

/* === Analytics Page === */
body.dark-mode .page-header h1 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .period-btn {
    border-color: #2d3748;
    background: #16213e;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .period-btn:hover {
    background: #1e2a4a;
}

body.dark-mode .period-btn.active {
    background: linear-gradient(135deg, var(--lr-grad-from, var(--lr-accent, #6d4dff)), var(--lr-grad-to, #8b5cf6)) !important;
    color: white;
    border-color: transparent;
}

/* Charts */
body.dark-mode .chart-card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .chart-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .chart-header h2 {
    color: var(--lr-line, #e2e8f0);
}

/* Leaderboards */
body.dark-mode .leaderboard-card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .leaderboard-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .leaderboard-header h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .leaderboard-item {
    border-bottom-color: #2d3748;
}

body.dark-mode .leaderboard-rank {
    background: #1e2a4a;
    color: #a0aec0;
}

body.dark-mode .leaderboard-rank.gold { background: #3b2e00; color: #fcd34d; }
body.dark-mode .leaderboard-rank.silver { background: #2d3748; color: var(--lr-line, #e2e8f0); }
body.dark-mode .leaderboard-rank.bronze { background: #3b2500; color: #fdba74; }

body.dark-mode .leaderboard-title {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .leaderboard-meta {
    color: #a0aec0;
}

body.dark-mode .leaderboard-stat-value {
    color: #63b3ed;
}

body.dark-mode .leaderboard-stat-label {
    color: #a0aec0;
}

body.dark-mode .leaderboard-empty {
    color: #a0aec0;
}

/* Activity Feed */
body.dark-mode .activity-card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .activity-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .activity-header h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .activity-item {
    border-bottom-color: #2d3748;
}

body.dark-mode .activity-icon.user { background: #1e3a5f; color: #63b3ed; }
body.dark-mode .activity-icon.survey { background: #1a3a2a; color: #34d399; }

body.dark-mode .activity-text {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .activity-time {
    color: #718096;
}

body.dark-mode .activity-empty {
    color: #a0aec0;
}

/* Distribution */
body.dark-mode .distribution-bar-container {
    background: #1e2a4a;
}

body.dark-mode .distribution-label {
    color: #a0aec0;
}

body.dark-mode .distribution-value {
    color: var(--lr-line, #e2e8f0);
}

/* === Health Page === */
body.dark-mode .status-banner.healthy { background: #1a3a2a; color: #6ee7b7; }
body.dark-mode .status-banner.degraded { background: #3b2e00; color: #fcd34d; }
body.dark-mode .status-banner.unhealthy { background: #3b1a1a; color: #fca5a5; }

body.dark-mode .card {
    background: #16213e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card-header {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .card-header h3 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .card-body {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .stat-row {
    border-bottom-color: #2d3748;
}

body.dark-mode .stat-label {
    color: #a0aec0;
}

body.dark-mode .stat-value {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .service-item {
    border-bottom-color: #2d3748;
}

body.dark-mode .service-name {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .service-latency {
    color: #a0aec0;
}

/* Progress bars */
body.dark-mode .progress-bar {
    background: #2d3748;
}

body.dark-mode .progress-label {
    color: #a0aec0;
}

/* Error items */
body.dark-mode .error-item {
    background: #3b1a1a;
}

body.dark-mode .error-time {
    color: #fca5a5;
}

body.dark-mode .error-msg {
    color: #fecaca;
}

/* Last updated */
body.dark-mode .last-updated {
    color: #718096;
}

body.dark-mode .health-empty-text {
    color: #a0aec0;
}

body.dark-mode .health-no-data {
    color: #718096;
}

/* === Waitlist Page dark mode ===
   No longer needs an explicit override — the .waitlist-body rule above
   uses var(--lr-surface) which flips automatically in dark mode. */

body.dark-mode .waitlist-container {
    background: #16213e !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .waitlist-container h1 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .subtitle {
    color: #a0aec0;
}

body.dark-mode .waitlist-stat-card {
    background: #1a1a2e !important;
}

body.dark-mode .stat-number {
    color: #63b3ed;
}

body.dark-mode .stat-number-label {
    color: #a0aec0;
}

body.dark-mode .back-link {
    color: #63b3ed;
}

body.dark-mode .notes {
    color: #a0aec0;
}

body.dark-mode .email-text {
    color: #63b3ed;
}

body.dark-mode .granted-text {
    color: #34d399;
}

body.dark-mode .waitlist-empty-text {
    color: #a0aec0;
}

/* Waitlist Card System - Dark Mode */
body.dark-mode .wl-card {
    background: #1e293b;
    border-color: #2d3748;
}

body.dark-mode .wl-card-header {
    background: #1a2332;
    border-bottom-color: #2d3748;
}

body.dark-mode .wl-card-header h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .wl-card-header h2 i {
    color: #63b3ed;
}

body.dark-mode .wl-card-desc {
    color: #a0aec0;
}

/* Beta Invite Section - Dark Mode */
body.dark-mode .beta-invite-section {
    background: #1a1a2e;
    border-color: #2d3748;
}

body.dark-mode .beta-invite-section h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .beta-invite-section h2 i {
    color: #63b3ed;
}

body.dark-mode .beta-invite-desc {
    color: #a0aec0;
}

body.dark-mode .beta-email-input {
    background: #0f0f23;
    border-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .beta-email-input:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

body.dark-mode .beta-email-count {
    color: #a0aec0;
}

body.dark-mode .beta-result-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

body.dark-mode .beta-result-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

body.dark-mode .beta-result-sent { color: #34d399; }
body.dark-mode .beta-result-failed { color: #fca5a5; }
body.dark-mode .beta-result-invalid { color: #fbbf24; }

body.dark-mode .beta-result-detail {
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* Beta Tracking Section dark mode */
body.dark-mode .beta-tracking-section {
    background: #16213e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .beta-tracking-section h2 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .beta-tracking-section h2 i {
    color: #818cf8;
}

body.dark-mode .beta-tracking-desc {
    color: var(--lr-muted-2);
}

body.dark-mode .beta-tracking-stat {
    background: #1a1a2e;
}

body.dark-mode .beta-tracking-stat-num {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .beta-tracking-stat-label {
    color: var(--lr-muted-2);
}

body.dark-mode .beta-tracking-stat.stat-pending .beta-tracking-stat-num { color: #fbbf24; }
body.dark-mode .beta-tracking-stat.stat-used .beta-tracking-stat-num { color: #34d399; }
body.dark-mode .beta-tracking-stat.stat-expired .beta-tracking-stat-num { color: var(--lr-ink-muted); }

body.dark-mode .beta-codes-table th {
    border-bottom-color: #2d3748;
    color: var(--lr-muted-2);
}

body.dark-mode .beta-codes-table td {
    border-bottom-color: #1a1a2e;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .beta-codes-table tbody tr:hover {
    background: #1a1a2e;
}

body.dark-mode .beta-code-display {
    background: #1a1a2e;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .badge-expired {
    background: rgba(107, 114, 128, 0.2);
    color: var(--lr-muted-2);
}

body.dark-mode .badge-revoked {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

body.dark-mode .text-muted {
    color: var(--lr-ink-muted);
}

body.dark-mode .btn-revoke {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}

body.dark-mode .btn-revoke:hover {
    background: rgba(220, 38, 38, 0.25);
    border-color: rgba(248, 113, 113, 0.5);
}

/* === Form inputs (general) === */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode input[type="password"],
body.dark-mode input[type="date"],
body.dark-mode textarea,
body.dark-mode select {
    background: #1a1a2e !important;
    border-color: #2d3748 !important;
    color: var(--lr-line, #e2e8f0) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #718096;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: var(--lr-accent, #6d4dff);
    outline: none;
}

/* === Breach page specific === */
body.dark-mode .breach-page-header h1 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .breach-page-header h1 i {
    color: #63b3ed;
}

body.dark-mode .breach-page-subtitle {
    color: #a0aec0;
}

body.dark-mode .breach-field label {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .breach-optional {
    color: #718096;
}

body.dark-mode .breach-input {
    background: #0f0f23;
    border-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .breach-input:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

body.dark-mode .breach-input::placeholder {
    color: #718096;
}

body.dark-mode .breach-user-count {
    color: #a0aec0;
}

body.dark-mode .breach-confirm {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
}

body.dark-mode .breach-confirm-icon {
    color: #fbbf24;
}

body.dark-mode .breach-confirm-body p {
    color: #fcd34d;
}

body.dark-mode .breach-result-banner.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

body.dark-mode .breach-result-banner.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

body.dark-mode .breach-history-table th {
    border-bottom-color: #2d3748;
    color: #a0aec0;
}

body.dark-mode .breach-history-table td {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .breach-history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .severity-critical {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

body.dark-mode .severity-high {
    background: rgba(234, 88, 12, 0.15);
    color: #fb923c;
}

body.dark-mode .severity-medium {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
}

body.dark-mode .breach-sent-count {
    color: #34d399;
}

body.dark-mode .breach-failed-count {
    color: #f87171;
}

/* === Horizontal rules === */
body.dark-mode hr {
    border-color: #2d3748;
}

/* === Scrollbar === */
body.dark-mode * {
    scrollbar-color: #4a5568 #1a1a2e;
}

/* ============================================================
   Announcements — Dark Mode
   ============================================================ */

body.dark-mode .ann-page-header h1 {
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .ann-page-header h1 i {
    color: #818cf8;
}

body.dark-mode .ann-page-subtitle {
    color: var(--lr-muted-2);
}

body.dark-mode .ann-field label {
    color: #cbd5e1;
}

body.dark-mode .ann-input {
    background: #1e293b;
    border-color: var(--lr-ink, #334155);
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .ann-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

body.dark-mode .ann-internal-hint {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

body.dark-mode .ann-result-banner.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

body.dark-mode .ann-result-banner.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

body.dark-mode .ann-table th {
    border-bottom-color: #2d3748;
    color: #a0aec0;
}

body.dark-mode .ann-table td {
    border-bottom-color: #2d3748;
    color: var(--lr-line, #e2e8f0);
}

body.dark-mode .ann-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .ann-internal-row {
    background: rgba(245, 158, 11, 0.06);
}

body.dark-mode .ann-title-cell {
    color: var(--lr-surface, #f1f5f9);
}

body.dark-mode .ann-desc-cell {
    color: var(--lr-muted-2);
}

body.dark-mode .ann-type-feature {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

body.dark-mode .ann-type-fix {
    background: rgba(236, 72, 153, 0.15);
    color: #f9a8d4;
}

body.dark-mode .ann-type-improvement {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

body.dark-mode .ann-vis-public {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

body.dark-mode .ann-vis-internal {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

body.dark-mode .ann-editing-row td {
    background: #16213e;
}

body.dark-mode .ann-modal {
    background: #1e293b;
    color: var(--lr-line, #e2e8f0);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body.dark-mode .ann-modal-detail {
    color: var(--lr-muted-2);
}

/* ============================================================
   Phone Responsive — Global Admin (360px)
   ============================================================ */
/* LAYOUT-SPECIFIC — not in source */
@media (max-width: 480px) {
    /* All admin tables: horizontal scroll */
    .table-responsive,
    .table-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure tap-friendly buttons */
    .btn, .btn-small {
        min-height: 40px;
    }

    /* Form inputs: prevent iOS zoom */
    .form-control,
    .ann-input,
    input[type="text"],
    input[type="email"],
    input[type="search"],
    select {
        font-size: 16px;
    }

    /* Announcements table: hide less-important columns */
    .ann-table th:nth-child(5),
    .ann-table td:nth-child(5) {
        display: none;
    }

    .ann-desc-cell {
        max-width: 200px;
    }

    /* Action dropdown: constrain to viewport */
    .action-dropdown-menu {
        min-width: 0;
        width: max-content;
        max-width: calc(100vw - 2rem);
    }

    .action-dropdown-menu button {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    /* Modal: reduce padding for phones */
    .modal-header {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-close {
        font-size: 1.75rem;
        min-width: 44px;
        min-height: 44px;
    }

    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 360px) {
    .container, .container-sm {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card h3 {
        font-size: 1rem;
    }

    .stat-card .label {
        font-size: 0.7rem;
    }

    .ann-page-header h1 {
        font-size: 1.25rem;
    }
}

/* Dark-mode contrast audit (2026-06-15) ======================================
   .ann-modal (admin delete-confirmation modal) hard-codes background:#fff.
   In dark mode the global `body.dark-mode` rule above forces near-white body
   text, which then renders invisible on the white modal box. Remap the modal
   surface to the dark card token (literal fallback for any page that loads
   admin-pages.css without landing-refresh.css supplying the token). HIGH
   priority — additive, does not modify the base .ann-modal rule.
   ============================================================================ */
body.dark-mode .ann-modal,
html.dark-mode .ann-modal {
    background: var(--lr-card, #16213e);
    color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
