/* =============================================================================
   ONExus — Application Styles
   Theme: Indigo Neural — AI & Automation
   Supports: Light / Dark mode via [data-theme="dark"] on <html>
   ============================================================================= */

/* ===== CSS VARIABLES (Light Mode) ===== */
:root {
    /* Brand */
    --brand-1: #4338ca;
    --brand-2: #6366f1;
    --brand-3: #818cf8;
    --brand-light: #eef2ff;
    --brand-focus: rgba(99,102,241,0.15);

    /* Surfaces */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-table-row-alt: #fafbfc;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --text-on-brand: #ffffff;

    /* Stat cards (always dark slate) */
    --stat-bg-1: #1e293b;
    --stat-bg-2: #334155;
    --stat-border: #475569;
    --stat-label: #94a3b8;
    --stat-value: #f1f5f9;

    /* Misc */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 12px;
    --transition: 0.15s ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #253348;
    --bg-input: #1e293b;
    --bg-table-row-alt: #1a2332;

    --border: #334155;
    --border-light: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;

    --stat-bg-1: #0f172a;
    --stat-bg-2: #1e293b;
    --stat-border: #334155;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ===== BASE ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-secondary);
    font-size: clamp(14px, 0.45vw + 12px, 18px);
    transition: background var(--transition), color var(--transition);
}

* { box-sizing: border-box; }

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    text-decoration: none;
}

.navbar .brand-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.navbar .brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Theme toggle */
.theme-toggle {
    color: rgba(255,255,255,0.75);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    transition: color var(--transition);
}
.theme-toggle:hover { color: #fff; }

/* Alert bell */
.alert-bell {
    position: relative;
    color: rgba(255,255,255,0.75);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
}
.alert-bell:hover { color: #fff; }

.alert-badge {
    position: absolute;
    top: 0; right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* User avatar */
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
/* Extra right padding so the floating Feedback tag never overlaps the table */
.main-content {
    padding: 20px 48px 20px 24px;
}

/* ===== TABS ===== */
.tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: var(--border);
    border-radius: 10px;
    padding: 3px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    transition: all var(--transition);
    font-family: inherit;
}

.tab-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.5); }

[data-theme="dark"] .tab-btn:hover { background: rgba(255,255,255,0.05); }

.tab-btn.active {
    background: var(--bg-card);
    color: var(--brand-1);
    box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== STAT CARDS ===== */
.stat-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, var(--stat-bg-1) 0%, var(--stat-bg-2) 100%);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid var(--stat-border);
    flex: 1;
    min-width: 130px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.stat-card.active {
    border: 2px solid var(--brand-3);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.stat-card-label {
    font-size: 11px;
    color: var(--stat-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--stat-value);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.filter-btn:hover { background: var(--bg-card-hover); color: var(--text-secondary); }

.filter-btn.active {
    background: var(--brand-light);
    color: var(--brand-1);
    border: 2px solid var(--brand-1);
    font-weight: 700;
}

[data-theme="dark"] .filter-btn.active {
    background: rgba(99,102,241,0.15);
    color: var(--brand-3);
    border-color: var(--brand-3);
}

.filter-bar .search-box {
    position: relative;
}

.filter-bar .search-box input {
    padding: 7px 12px 7px 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
    width: 240px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.filter-bar .search-box input:focus {
    outline: none;
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px var(--brand-focus);
}

.filter-bar .search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 13px;
}

/* ===== TABLE CARD ===== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ===== TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table thead th:hover {
    background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
}

.data-table thead th[data-sort] {
    position: relative;
    padding-right: 24px;
}

.data-table thead th .sort-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0;
}

.data-table thead th .sort-arrow.active { opacity: 1; }

.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-secondary);
}

.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover td { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Expanded detail row */
.data-table tbody tr.detail-row td {
    padding: 0;
    background: var(--bg-body);
    cursor: default;
}

.detail-panel {
    padding: 20px 24px;
    border-top: 2px solid var(--brand-2);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.detail-field .value {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.detail-field .value.empty {
    color: var(--text-faint);
    font-style: italic;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ===== ID BADGE ===== */
.id-badge {
    background: var(--brand-1);
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: background var(--transition);
}
.id-badge:hover { background: #3730a3; }

/* ===== STATUS BADGES ===== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-initiating { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.badge-initiating .dot { background: #0ea5e9; }

.badge-planning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge-planning .dot { background: #eab308; }

.badge-executing { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-executing .dot { background: #22c55e; }

.badge-monitoring { background: #fff7ed; color: #7c2d12; border: 1px solid #fdba74; }
.badge-monitoring .dot { background: #f97316; }

.badge-closing { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.badge-closing .dot { background: #3b82f6; }

.badge-on-hold { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.badge-on-hold .dot { background: #a855f7; }

.badge-completed { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-completed .dot { background: #10b981; }

.badge-cancelled { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-cancelled .dot { background: #ef4444; }

/* Phase badges */
.badge-phase {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.phase-discovery { background: #fce7f3; color: #9d174d; }
.phase-design { background: #ede9fe; color: #5b21b6; }
.phase-development { background: #dbeafe; color: #1e40af; }
.phase-testing { background: #fff7ed; color: #9a3412; }
.phase-technical-review { background: #fef9c3; color: #854d0e; }
.phase-deployed { background: #ecfdf5; color: #065f46; }
.phase-default { background: #f3f4f6; color: #374151; }

/* Priority badges */
.badge-priority {
    font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
}

.priority-high { background: #fee2e2; color: #991b1b; }
.priority-medium { background: #fef9c3; color: #854d0e; }
.priority-low { background: #f3f4f6; color: #374151; }
.priority-live { background: #dcfce7; color: #166534; }
.priority-not-set { background: #f3f4f6; color: #9ca3af; }

/* ===== REVIEW BADGE ===== */
.review-badge {
    color: #f59e0b;
    font-size: 12px;
    margin-left: 6px;
    cursor: help;
}

.row-needs-review td:first-child {
    border-left: 3px solid #f59e0b;
}

/* ===== COLUMN FILTER ICON ===== */
.filter-icon {
    font-size: 9px;
    opacity: 0.5;
    margin-left: 4px;
    cursor: pointer;
    transition: opacity var(--transition);
}
.filter-icon:hover { opacity: 1; }

/* ===== COLUMN FILTER DROPDOWN ===== */
.col-filter-dropdown {
    position: fixed;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 260px;
    z-index: 300;
    font-size: 13px;
}

.col-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--brand-1);
    font-size: 12px;
}

[data-theme="dark"] .col-filter-header { color: var(--brand-3); }

.col-filter-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
}

.col-filter-search {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
}

.col-filter-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.col-filter-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 0;
}

.col-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.col-filter-option:hover { background: var(--bg-card-hover); }

.col-filter-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--brand-2);
}

.col-filter-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
}

/* ===== INLINE FORMS (comments, attachments) ===== */
.comment-form textarea:focus,
.attachment-form input:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px var(--brand-focus);
}

[data-theme="dark"] .comment-form .btn-primary,
[data-theme="dark"] .attachment-form .btn-primary {
    background: var(--brand-2);
}

.attachment-tab-btn.active {
    background: var(--brand-1) !important;
    color: #fff !important;
    border-color: var(--brand-1) !important;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--brand-1);
    color: #fff;
}
.btn-primary:hover { background: #3730a3; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.btn-danger:hover { background: #fecaca; }

[data-theme="dark"] .btn-danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== MODAL (standard) ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

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

/* ===== FEEDBACK WIDGET (floating tag + modal) ===== */
.feedback-tag {
    position: fixed; right: 0; top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: #fff; border: none;
    padding: 14px 8px; font-family: inherit; cursor: pointer;
    z-index: 500;
    border-radius: 8px 0 0 8px;
    box-shadow: -3px 0 18px rgba(67, 56, 202, 0.45), 0 4px 12px rgba(13, 148, 136, 0.35);
    transition: filter 0.2s, box-shadow 0.2s, padding-right 0.2s;
}
.feedback-tag::before {
    content: ''; position: absolute;
    left: 3px; top: 4px; bottom: 4px; right: 3px;
    border: 1px dashed rgba(255,255,255,0.4); pointer-events: none;
    border-radius: 6px 0 0 6px;
}
.feedback-tag__label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.feedback-tag:hover {
    filter: brightness(1.08);
    padding-right: 12px;
    box-shadow: -4px 0 22px rgba(67, 56, 202, 0.6), 0 6px 16px rgba(13, 148, 136, 0.45);
}

/* Global hidden utility used by feedback preview / lightbox */
.feedback-modal__screenshot-preview.hidden,
.screenshot-lightbox.hidden { display: none !important; }

.feedback-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; }
.feedback-modal.hidden { display: none; }
.feedback-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.feedback-modal__dialog {
    position: relative; background: var(--bg-card); border-radius: 16px;
    width: 420px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: feedbackIn 0.2s ease;
    color: var(--text-primary);
}
@keyframes feedbackIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } }
.feedback-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; }
.feedback-modal__header h3 { margin: 0; font-size: 1.1rem; color: var(--brand-1); display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .feedback-modal__header h3 { color: var(--brand-3); }
.feedback-modal__close { background: none; border: none; font-size: 1.2rem; color: var(--text-faint); cursor: pointer; padding: 4px; }
.feedback-modal__close:hover { color: var(--text-primary); }
.feedback-modal__body { padding: 10px 18px; }
.feedback-modal__label {
    display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin: 8px 0 6px;
}
.feedback-modal__types { display: flex; gap: 6px; margin-bottom: 8px; }
.feedback-modal__type {
    flex: 1; padding: 8px 4px; border: 2px solid var(--border); border-radius: 8px;
    background: var(--bg-card); cursor: pointer; font-size: 0.78rem; font-family: inherit;
    color: var(--text-secondary); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all 0.15s;
}
.feedback-modal__type i { font-size: 1rem; }
.feedback-modal__type:hover { border-color: var(--brand-2); color: var(--brand-1); }
[data-theme="dark"] .feedback-modal__type:hover { color: var(--brand-3); }
.feedback-modal__type.active { border-color: var(--brand-2); background: var(--brand-light); color: var(--brand-1); font-weight: 600; }
[data-theme="dark"] .feedback-modal__type.active { background: rgba(99,102,241,0.15); color: var(--brand-3); }
.feedback-modal__input, .feedback-modal__textarea {
    width: 100%; padding: 8px 10px; border: 2px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 0.85rem; outline: none; transition: border-color 0.2s; box-sizing: border-box;
    margin-bottom: 4px; background: var(--bg-input); color: var(--text-primary);
}
.feedback-modal__textarea { resize: vertical; min-height: 72px; }
.feedback-modal__input:focus, .feedback-modal__textarea:focus { border-color: var(--brand-2); }
.feedback-modal__textarea--error, .feedback-modal__input--error { border-color: #dc2626; }
.feedback-modal__screenshot-btn {
    background: none; border: 2px dashed var(--border); border-radius: 8px;
    padding: 8px 12px; font-size: 0.78rem; font-family: inherit; color: var(--text-muted);
    cursor: pointer; width: 100%; margin-top: 8px; transition: all 0.2s;
}
.feedback-modal__screenshot-btn:hover { border-color: var(--brand-2); color: var(--brand-1); }
[data-theme="dark"] .feedback-modal__screenshot-btn:hover { color: var(--brand-3); }
.feedback-modal__screenshot-preview {
    margin: 4px 18px; border: 1px solid var(--border); border-radius: 8px;
    overflow: hidden; max-height: 140px; cursor: pointer; position: relative;
}
.feedback-modal__screenshot-preview img { width: 100%; display: block; object-fit: cover; object-position: top; }
.feedback-modal__screenshot-remove {
    position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.6); color: #fff;
    border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer;
    font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
}
.feedback-modal__footer { padding: 8px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.feedback-modal__submit {
    width: 100%; padding: 10px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%); color: #fff;
    font-weight: 600; font-family: inherit; font-size: 0.9rem; cursor: pointer;
    transition: filter 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.feedback-modal__submit:hover { filter: brightness(1.08); }
.feedback-modal__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.screenshot-lightbox { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.screenshot-lightbox.hidden { display: none; }
.screenshot-lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); cursor: pointer; }
.screenshot-lightbox__img { position: relative; max-width: 92vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }

/* ===== FEEDBACK BADGES (in admin table) ===== */
.fb-type-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.fb-type-bug { background: #fee2e2; color: #991b1b; }
.fb-type-idea { background: #fef3c7; color: #92400e; }
.fb-type-question { background: #dbeafe; color: #1e40af; }
.fb-type-other { background: #f3f4f6; color: #374151; }
[data-theme="dark"] .fb-type-bug { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-theme="dark"] .fb-type-idea { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .fb-type-question { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .fb-type-other { background: rgba(148,163,184,0.2); color: #cbd5e1; }

.fb-status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.fb-status-new { background: #dbeafe; color: #1e40af; }
.fb-status-in-progress { background: #fef3c7; color: #92400e; }
.fb-status-resolved { background: #d1fae5; color: #065f46; }
.fb-status-dismissed { background: #e5e7eb; color: #4b5563; }
[data-theme="dark"] .fb-status-new { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .fb-status-in-progress { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .fb-status-resolved { background: rgba(34,197,94,0.2); color: #86efac; }
[data-theme="dark"] .fb-status-dismissed { background: rgba(148,163,184,0.2); color: #cbd5e1; }

/* ===== ALERTS MODAL ===== */
.alerts-section { margin-bottom: 20px; }
.alerts-section:last-child { margin-bottom: 0; }

.alerts-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.alerts-section-header .alerts-section-count {
    background: var(--bg-table-row-alt);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.alerts-section-header .alerts-mark-all {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--brand-1);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
}
[data-theme="dark"] .alerts-section-header .alerts-mark-all { color: var(--brand-3); }
.alerts-section-header .alerts-mark-all:hover { text-decoration: underline; }

.alerts-empty {
    color: var(--text-faint);
    font-style: italic;
    font-size: 13px;
    padding: 16px 10px;
    text-align: center;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 6px;
    background: var(--bg-card);
}
.alert-item.dynamic { background: var(--bg-table-row-alt); }
.alert-item.acknowledged { opacity: 0.6; }
.alert-item.acknowledged .alert-link { text-decoration: line-through; }

.alert-ack {
    display: flex;
    align-items: center;
    padding-top: 2px;
}
.alert-icon {
    font-size: 14px;
    padding-top: 3px;
    color: var(--brand-2);
}
.alert-main { flex: 1; min-width: 0; }
.alert-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-1);
    text-decoration: none;
    cursor: pointer;
}
[data-theme="dark"] .alert-link { color: var(--brand-3); }
.alert-link:hover { text-decoration: underline; }
.alert-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.alert-sub strong { color: var(--text-primary); }
.alert-meta {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}
.alert-reasons { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.alert-reason-chip {
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
[data-theme="dark"] .alert-reason-chip { background: rgba(245,158,11,0.2); color: #fcd34d; }
.alerts-due { font-size: 11px; color: var(--text-faint); }

/* ===== TASK EXPAND TOGGLE ===== */
.col-tasks-toggle { width: 30px; text-align: center; padding: 0 !important; }

.task-expand-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: color var(--transition), transform var(--transition);
}
.task-expand-btn:hover { color: var(--brand-1); }
[data-theme="dark"] .task-expand-btn:hover { color: var(--brand-3); }

tr.tasks-row { background: var(--bg-table-row-alt); }
/* Direct child only — descendant selector was cascading into the nested
   tasks-expand-table and stripping padding from its th/td cells */
tr.tasks-row > td { padding: 0 !important; border-bottom: 2px solid var(--border) !important; }

.tasks-expand {
    padding: 14px 32px 18px;
    background: var(--bg-table-row-alt);
}

.tasks-expand-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
[data-theme="dark"] .tasks-expand-header { color: var(--brand-3); }

.tasks-expand-empty {
    padding: 14px 32px;
    color: var(--text-faint);
    font-style: italic;
    font-size: 13px;
}

.tasks-expand-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 12px;
}

/* Use the wrapper class to out-specific the outer .data-table rules */
.tasks-expand .tasks-expand-table thead th {
    background: var(--border-light);
    background-image: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: static;
    cursor: default;
}

.tasks-expand .tasks-expand-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    color: var(--text-secondary);
}

.tasks-expand .tasks-expand-table tbody tr:last-child td { border-bottom: none; }

/* Clickable task title */
.task-title-link {
    color: var(--brand-1);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
[data-theme="dark"] .task-title-link { color: var(--brand-3); }
.task-title-link:hover { text-decoration: underline; }

/* ===== TASK STATUS BADGES ===== */
.task-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.task-status-not-started   { background: #e5e7eb; color: #4b5563; }
.task-status-in-progress   { background: #fef3c7; color: #92400e; }
.task-status-completed     { background: #d1fae5; color: #065f46; }
.task-status-cancelled     { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .task-status-not-started { background: rgba(148,163,184,0.2); color: #cbd5e1; }
[data-theme="dark"] .task-status-in-progress { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .task-status-completed   { background: rgba(34,197,94,0.2); color: #86efac; }
[data-theme="dark"] .task-status-cancelled   { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ===== ATTACHMENT & LINK ITEMS (edit modal panel) ===== */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

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

.attachment-icon {
    color: var(--brand-2);
    font-size: 13px;
    width: 16px;
    flex-shrink: 0;
}

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

.attachment-link {
    color: var(--brand-1);
    font-weight: 600;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .attachment-link { color: var(--brand-3); }

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

.attachment-sub {
    color: var(--text-faint);
    font-size: 11px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-icon-danger:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

/* ===== GENERIC DIALOG (alert/confirm/prompt replacements) ===== */
/* Lifts the generic dialog above edit-overlay (200) and submit confirm */
#dialogModal {
    z-index: 1000;
    background: rgba(0,0,0,0.65);
}

.modal.dialog-modal {
    width: 440px;
    padding: 28px 28px 22px;
    text-align: center;
}

.dialog-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
}

.dialog-icon.info { background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%); }
.dialog-icon.warning { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.dialog-icon.danger { background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%); }
.dialog-icon.success { background: linear-gradient(135deg, #15803d 0%, #22c55e 100%); }

.dialog-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.dialog-body {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.dialog-fields {
    text-align: left;
    margin-bottom: 18px;
}

.dialog-fields:empty { display: none; }

.dialog-fields .form-group { margin-bottom: 12px; }

.dialog-fields label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dialog-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ===== CONFIRMATION MODAL ===== */
.modal.confirm-modal {
    width: 440px;
    padding: 32px 28px 24px;
    text-align: center;
}

.confirm-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    box-shadow: 0 6px 18px rgba(99,102,241,0.35);
}

.confirm-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.confirm-body {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-body strong {
    color: var(--brand-1);
    font-weight: 600;
}

[data-theme="dark"] .confirm-body strong { color: var(--brand-3); }

.confirm-meta {
    margin: 0 0 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 640px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

.modal-close {
    background: none; border: none; color: rgba(255,255,255,0.7);
    font-size: 20px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: #fff; }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== FULL-SCREEN EDIT MODAL ===== */
.edit-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.edit-overlay.open { display: flex; }

.edit-modal {
    background: var(--bg-body);
    border-radius: var(--radius);
    width: calc(100vw - 40px);
    max-width: 1800px;
    height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.edit-modal-header {
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.edit-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

.edit-modal-header .id-badge {
    background: rgba(255,255,255,0.15);
    margin-right: 12px;
}

.edit-modal-header .follow-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.edit-modal-header .follow-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.edit-modal-header .follow-toggle .fas.fa-flag {
    color: #fbbf24;
}

.edit-modal-body {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.edit-left {
    padding: 24px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    font-size: 13px;
}

.edit-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.edit-left .form-group label {
    font-size: 13px;
}

.edit-left .form-control {
    font-size: 14px;
}

/* Right-side panels */
.edit-panel {
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.edit-panel-header {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-on-brand);
    background: var(--brand-1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.edit-panel-header .panel-action {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.edit-panel-body {
    padding: 16px 20px;
    background: var(--bg-card);
    overflow-y: auto;
    flex: 1;
}

.edit-panel-body.empty,
.edit-panel-body .empty {
    text-align: center;
    color: var(--text-faint);
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
}

.edit-panel-body { font-size: 13px; }

/* Comment item */
.comment-item {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.comment-author {
    font-weight: 600;
    font-size: 12px;
    color: var(--brand-1);
}

[data-theme="dark"] .comment-author { color: var(--brand-3); }

.comment-date {
    font-size: 11px;
    color: var(--text-faint);
    margin-left: 8px;
}

.comment-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.comment-admin-tag {
    font-size: 9px;
    background: #fee2e2;
    color: #991b1b;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 6px;
}

/* History item */
.history-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

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

.history-date { color: var(--text-faint); white-space: nowrap; min-width: 70px; }
.history-user { color: var(--brand-1); font-weight: 600; min-width: 100px; }
[data-theme="dark"] .history-user { color: var(--brand-3); }
.history-detail { color: var(--text-secondary); }
.history-old { text-decoration: line-through; color: var(--text-faint); }
.history-new { font-weight: 600; }

/* Edit modal footer */
.edit-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius) var(--radius);
}

.edit-modal-footer .footer-left { display: flex; gap: 8px; }
.edit-modal-footer .footer-right { display: flex; gap: 8px; }

/* Tasks section (bottom of edit left) */
.tasks-section {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tasks-table thead th {
    background: var(--brand-1);
    color: #fff;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-align: left;
}

.tasks-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
}

.task-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.task-not-started { background: #f3f4f6; color: #374151; }
.task-in-progress { background: #dbeafe; color: #1e40af; }
.task-completed { background: #dcfce7; color: #166534; }

/* ===== FORM FIELDS ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label .required { color: #ef4444; margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-secondary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px var(--brand-focus);
}

textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}

/* FTE preview */
.fte-preview {
    background: var(--brand-light);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    text-align: center;
    margin: 16px 0;
}

/* ===== METRICS TABLE (Submit Idea) ===== */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
}

.metrics-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.metrics-table tr:last-child td { border-bottom: none; }

.metrics-table .metrics-label {
    background: var(--bg-table-row-alt);
    color: var(--brand-1);
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
}

[data-theme="dark"] .metrics-table .metrics-label { color: var(--brand-3); }

.metrics-table .metrics-input {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    width: 100px;
}

.metrics-table .metrics-input .form-control.metrics-num {
    flex: 0 0 90px;
    width: 90px;
    text-align: right;
    padding: 7px 8px;
}

.metrics-table .metrics-input .form-control {
    flex: 0 1 100px;
    text-align: right;
}

.metrics-table .metrics-unit {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.metrics-table tr.metrics-total td {
    background: var(--brand-light);
    font-weight: 700;
}

.metrics-table tr.metrics-total .metrics-label { color: var(--brand-1); background: var(--brand-light); }
.metrics-table tr.metrics-total #ideaFteValue { font-size: 18px; color: var(--brand-1); font-weight: 700; }

[data-theme="dark"] .metrics-table tr.metrics-total td { background: rgba(99,102,241,0.12); }
[data-theme="dark"] .metrics-table tr.metrics-total .metrics-label,
[data-theme="dark"] .metrics-table tr.metrics-total #ideaFteValue { color: var(--brand-3); }

/* Autosize textarea */
textarea.autosize {
    min-height: 64px;
    max-height: 400px;
    resize: vertical;
    overflow-y: auto;
}

[data-theme="dark"] .fte-preview {
    background: rgba(99,102,241,0.1);
}

/* Execution assessment section */
.execution-assessment-section {
    background: var(--brand-light);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    border: 1px solid rgba(99,102,241,0.15);
}

.execution-assessment-section .ea-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-1);
}

.execution-assessment-section .ea-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .execution-assessment-section {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.25);
}

[data-theme="dark"] .execution-assessment-section .ea-title {
    color: var(--brand-3);
}

[data-theme="dark"] .execution-assessment-section .ea-label {
    color: var(--text-secondary) !important;
}

/* Citizen developer badge dark mode fix */
[data-theme="dark"] .dev-badge {
    background: rgba(99,102,241,0.2);
    color: var(--brand-3);
    border: 1px solid rgba(99,102,241,0.3);
}

.fte-preview .fte-label {
    font-size: 11px;
    color: var(--brand-1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .fte-preview .fte-label { color: var(--brand-3); }

.fte-preview .fte-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-1);
}

[data-theme="dark"] .fte-preview .fte-value { color: var(--brand-3); }

.fte-preview .fte-unit {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state .empty-desc { font-size: 13px; color: var(--text-faint); margin-bottom: 20px; }

/* ===== EXPORT BUTTON ===== */
.btn-export { margin-left: auto; }

/* ===== WALLBOARD (Display tab) ===== */
.wallboard {
    background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
    color: #e5e7eb;
    height: calc(100vh - 160px);
    min-height: 600px;
    padding: 24px 32px;
    border-radius: var(--radius);
    position: relative;
    box-shadow: 0 8px 40px rgba(15,23,42,0.25);
    display: flex;
    flex-direction: column;
}

.wallboard.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    border-radius: 0;
    height: 100vh;
    padding: 28px 44px;
    overflow: hidden;
}

.wallboard-fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    z-index: 10;
}
.wallboard-fullscreen-btn:hover { background: rgba(255,255,255,0.16); }

.wallboard-esc-hint {
    position: absolute;
    top: 60px;
    right: 24px;
    background: rgba(15,23,42,0.92);
    color: #e5e7eb;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}

.wallboard-header {
    text-align: center;
    margin-bottom: clamp(22px, 3.5vh, 44px);
    padding-top: clamp(4px, 1vh, 12px);
}

/* Title at the top — big, cyan, matches legacy wallboard feel */
.wallboard-title {
    font-size: clamp(38px, 6vh, 78px);
    font-weight: 700;
    color: #38bdf8;
    margin: 0 0 clamp(4px, 0.6vh, 10px);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* Logo now lives in the footer — about half the previous size */
.wallboard-logo {
    height: clamp(40px, 5vh, 72px);
    width: auto;
    max-width: 280px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.wallboard-subtitle {
    color: #9ca3af;
    font-size: clamp(14px, 1.6vh, 20px);
    margin-top: 2px;
}

.wallboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

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

.wallboard-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

/* 2026 Goal tile takes ~40% of the left column, two tile rows share ~60% */
.wallboard-left .wallboard-goal {
    flex: 4 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wallboard-left .wallboard-tile-row { flex: 3 1 0; }

.wallboard-goal {
    background: linear-gradient(135deg, rgba(20,184,166,0.08) 0%, rgba(56,189,248,0.06) 100%);
    border: 1px solid rgba(56,189,248,0.2);
    border-radius: 16px;
    padding: clamp(22px, 3vh, 44px) clamp(24px, 2.2vw, 40px);
}
.wallboard-goal-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: clamp(16px, 2.2vh, 30px);
}
.wallboard-goal-title {
    font-size: clamp(28px, 4.2vh, 56px);
    font-weight: 700;
    color: #f3f4f6;
}
.wallboard-goal-target { font-size: clamp(15px, 1.7vh, 24px); color: #9ca3af; }

.wallboard-goal-bar {
    background: rgba(255,255,255,0.06);
    height: clamp(36px, 5vh, 72px);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.wallboard-goal-fill {
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 50%, #38bdf8 100%);
    height: 100%;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: clamp(12px, 1.2vw, 22px);
    color: #fff;
    font-weight: 700;
    font-size: clamp(18px, 2.4vh, 32px);
    transition: width 0.6s ease;
}
.wallboard-goal-footer {
    display: flex;
    justify-content: space-between;
    margin-top: clamp(14px, 1.8vh, 24px);
    font-size: clamp(16px, 2vh, 28px);
    color: #cbd5e1;
}
.wallboard-goal-footer span:first-child { color: #38bdf8; font-weight: 600; }

/* Subtle goal slider — lets users adjust target directly on the wallboard */
.wallboard-goal-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: clamp(12px, 1.6vh, 22px);
    opacity: 0.55;
    transition: opacity 0.2s;
}
.wallboard-goal-slider-row:hover { opacity: 1; }
.wallboard-goal-slider-row .label {
    font-size: clamp(10px, 1.1vh, 14px);
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
}
.wallboard-goal-slider {
    flex: 1;
    accent-color: #14b8a6;
    height: 4px;
    cursor: pointer;
}

.wallboard-tile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}
.wallboard-tile {
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}
.wallboard-tile.teal { background: linear-gradient(135deg, rgba(13,148,136,0.22) 0%, rgba(15,118,110,0.1) 100%); border-color: rgba(20,184,166,0.35); }
.wallboard-tile.blue { background: linear-gradient(135deg, rgba(56,189,248,0.18) 0%, rgba(59,130,246,0.1) 100%); border-color: rgba(59,130,246,0.35); }
.wallboard-tile.pink { background: linear-gradient(135deg, rgba(236,72,153,0.18) 0%, rgba(190,24,93,0.08) 100%); border-color: rgba(236,72,153,0.32); }
.wallboard-tile.navy { background: linear-gradient(135deg, rgba(37,99,235,0.14) 0%, rgba(30,64,175,0.08) 100%); border-color: rgba(59,130,246,0.3); }

.wallboard-tile-label { font-size: clamp(13px, 1.6vh, 20px); color: #94a3b8; font-weight: 700; letter-spacing: 1.5px; }
.wallboard-tile.teal .wallboard-tile-label { color: #5eead4; }
.wallboard-tile.blue .wallboard-tile-label { color: #7dd3fc; }
.wallboard-tile.pink .wallboard-tile-label { color: #f9a8d4; }
.wallboard-tile.navy .wallboard-tile-label { color: #93c5fd; }

.wallboard-tile-value {
    font-size: clamp(36px, 6.5vh, 78px);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.05;
    margin: clamp(4px, 0.8vh, 10px) 0 clamp(4px, 0.6vh, 8px);
}
.wallboard-tile-value .unit {
    font-size: clamp(14px, 1.7vh, 24px);
    font-weight: 600;
    color: #94a3b8;
    margin-left: 8px;
}

.wallboard-tile.teal .wallboard-tile-value { color: #5eead4; }
.wallboard-tile.blue .wallboard-tile-value { color: #7dd3fc; }
.wallboard-tile.pink .wallboard-tile-value { color: #f9a8d4; }
.wallboard-tile.navy .wallboard-tile-value { color: #93c5fd; }

.wallboard-tile-sub { font-size: clamp(14px, 1.5vh, 20px); color: #94a3b8; }

/* Right panel — top submitters */
.wallboard-right {
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(76,29,149,0.05) 100%);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 16px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.wallboard-submitters {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.wallboard-submitters h2 { flex: 0 0 auto; }
.wallboard-submitters #wbSubmittersList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.wallboard-submitters h2 {
    text-align: center;
    color: #f8fafc;
    margin: 0 0 clamp(10px, 1.4vh, 20px);
    font-size: clamp(18px, 2.2vh, 30px);
    font-weight: 700;
}

.wallboard-submitter {
    display: grid;
    grid-template-columns: clamp(56px, 5.5vh, 80px) clamp(48px, 4.5vh, 76px) 1fr auto;
    gap: clamp(10px, 1.2vh, 18px);
    padding: clamp(10px, 1.3vh, 18px) clamp(14px, 1.5vh, 22px);
    background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-bottom: clamp(6px, 0.8vh, 12px);
    align-items: center;
    flex: 1 0 auto;
    min-height: clamp(56px, 8.5vh, 110px);
}
.wallboard-submitter.medal {
    background: rgba(15,23,42,0.7);
    border-color: rgba(255,255,255,0.12);
}

.wallboard-rank-plain {
    font-size: clamp(20px, 2.2vh, 32px);
    font-weight: 800;
    color: #64748b;
    text-align: center;
}

/* Medal badge: round disc with ribbon tails poking out of the top */
.wallboard-rank-medal {
    width: clamp(44px, 4.5vh, 70px);
    height: clamp(44px, 4.5vh, 70px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    margin: 0 auto;
    color: #1f2937;
    font-weight: 900;
    font-size: clamp(16px, 1.8vh, 26px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 -3px 6px rgba(0,0,0,0.2), inset 0 3px 6px rgba(255,255,255,0.4);
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.wallboard-rank-medal.gold {
    background: radial-gradient(circle at 30% 30%, #fde68a 0%, #fbbf24 50%, #d97706 100%);
}
.wallboard-rank-medal.silver {
    background: radial-gradient(circle at 30% 30%, #f3f4f6 0%, #d1d5db 50%, #6b7280 100%);
}
.wallboard-rank-medal.bronze {
    background: radial-gradient(circle at 30% 30%, #fed7aa 0%, #f97316 50%, #9a3412 100%);
    color: #fff;
}
.wallboard-rank-medal span { position: relative; z-index: 2; }
.medal-ribbon {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 16px;
    z-index: 1;
}
.medal-ribbon.left  { left: 8px;  background: linear-gradient(180deg, #dc2626 0%, #7f1d1d 100%); transform: skewX(-8deg); border-radius: 2px 2px 0 0; }
.medal-ribbon.right { right: 8px; background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%); transform: skewX(8deg);  border-radius: 2px 2px 0 0; }

/* Avatar circle — scales with viewport; inner shadow softens the edge crop */
.wallboard-avatar {
    width: clamp(44px, 4.5vh, 72px);
    height: clamp(44px, 4.5vh, 72px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.4) 0%, rgba(20,184,166,0.3) 100%);
    background-size: cover;
    background-position: center 28%;  /* favor face over chin */
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #95999D;
    box-shadow: inset 0 0 0 2px #95999D;
    color: #f8fafc;
    font-weight: 700;
    font-size: clamp(13px, 1.4vh, 18px);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.wallboard-avatar.has-photo .wallboard-avatar-initials { display: none; }

.wallboard-submitter-info { min-width: 0; }
.wallboard-submitter-info .name {
    font-size: clamp(15px, 1.8vh, 24px);
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wallboard-submitter-info .dept {
    font-size: clamp(11px, 1.3vh, 16px);
    color: #94a3b8;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wallboard-submitter-stats { text-align: right; }
.wallboard-submitter-stats .hrs {
    font-size: clamp(16px, 1.9vh, 26px);
    font-weight: 700;
    color: #38bdf8;
    line-height: 1.2;
}
.wallboard-submitter-stats .count {
    font-size: clamp(10px, 1.2vh, 15px);
    color: #94a3b8;
    margin-top: 2px;
}

/* Make the submitter list fill available vertical space evenly */
.wallboard-submitters #wbSubmittersList {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wallboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #64748b;
    font-size: 13px;
    margin-top: clamp(20px, 3vh, 40px);
    padding: clamp(10px, 1.5vh, 20px) 8px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex: 0 0 auto;
}

.wallboard-last-updated {
    color: #64748b;
    font-size: clamp(12px, 1.1vh, 15px);
}

/* Hide navbar and everything else when wallboard is fullscreen */
body.wallboard-fullscreen-active .navbar,
body.wallboard-fullscreen-active .tab-bar,
body.wallboard-fullscreen-active .feedback-tag { display: none !important; }
body.wallboard-fullscreen-active .main-content { padding: 0 !important; }

/* ===== METRIC TILES (above tab bar) ===== */
.metric-tiles {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 1400px) {
    .metric-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .metric-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.metric-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 130px;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.metric-tile-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.metric-tile-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.metric-tile-value.brand-indigo { color: var(--brand-1); }
.metric-tile-value.brand-teal   { color: #0d9488; }
.metric-tile-value.brand-blue   { color: #38bdf8; }
.metric-tile-value.brand-pink   { color: #ec4899; }
.metric-tile-value.brand-violet { color: #a78bfa; }

[data-theme="dark"] .metric-tile-value.brand-indigo { color: var(--brand-3); }
[data-theme="dark"] .metric-tile-value.brand-teal   { color: #2dd4bf; }

.metric-tile-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-tile-footnote {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: auto;
}

.metric-tile-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-table-row-alt);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.metric-tile-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-1) 0%, var(--brand-2) 100%);
    transition: width 0.4s ease;
}

.metric-tile-progress-bar.metric-teal {
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 100%);
}

.metric-tile-split {
    display: flex;
    gap: 10px;
}

.metric-tile-split-col {
    flex: 1;
    min-width: 0;
}

.metric-tile-split-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
}

.metric-tile-split-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-tile-split-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-height: 16px;
}

.metric-tile-split-pct.up { color: #16a34a; }
.metric-tile-split-pct.down { color: #dc2626; }
[data-theme="dark"] .metric-tile-split-pct.up { color: #4ade80; }
[data-theme="dark"] .metric-tile-split-pct.down { color: #f87171; }

.metric-tile-slider {
    width: 100%;
    margin-top: 6px;
    accent-color: #14b8a6;
}

/* ===== FTE GOAL TILE ===== */
.fte-goal-tile {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.fte-goal-tile .progress-ring { width: 64px; height: 64px; flex-shrink: 0; }

.fte-goal-tile .goal-text .goal-label {
    font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase;
}

.fte-goal-tile .goal-text .goal-value {
    font-size: 22px; font-weight: 700; color: var(--brand-1);
}

[data-theme="dark"] .fte-goal-tile .goal-text .goal-value { color: var(--brand-3); }

.fte-goal-tile .goal-text .goal-detail {
    font-size: 12px; color: var(--text-faint);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .edit-modal-body { grid-template-columns: 1fr; }
    .edit-left { border-right: none; border-bottom: 1px solid var(--border); }
    .edit-modal { height: calc(100vh - 32px); }
}

@media (max-width: 768px) {
    .stat-cards { gap: 10px; }
    .stat-card { padding: 14px 16px; min-width: 100px; }
    .stat-card-value { font-size: 22px; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar .search-box input { width: 180px; }
}

/* ===== LARGE SCREENS / 4K ===== */
@media (min-width: 1920px) {
    .main-content { padding: clamp(20px, 1.5vw, 40px) clamp(48px, 3vw, 80px) clamp(20px, 1.5vw, 40px) clamp(24px, 2vw, 56px); }
    .navbar { padding: clamp(16px, 1vw, 24px) clamp(24px, 2vw, 48px); }
    .navbar .brand-subtitle { font-size: clamp(11px, 0.55vw, 15px); }
    .navbar .brand-title { font-size: clamp(18px, 0.9vw, 26px); }
    .navbar .nav-link { font-size: clamp(14px, 0.65vw, 18px); }
    .tab-btn { font-size: clamp(13px, 0.6vw, 17px); padding: clamp(8px, 0.5vw, 14px) clamp(24px, 1.2vw, 36px); }
    .stat-card-label { font-size: clamp(11px, 0.55vw, 15px); }
    .stat-card-value { font-size: clamp(28px, 1.4vw, 40px); }
    .stat-card { padding: clamp(18px, 1vw, 28px) clamp(22px, 1.2vw, 34px); }
    .filter-btn { font-size: clamp(12px, 0.55vw, 16px); padding: clamp(6px, 0.35vw, 10px) clamp(16px, 0.8vw, 24px); }
    .filter-bar .search-box input { font-size: clamp(13px, 0.6vw, 17px); width: clamp(240px, 14vw, 360px); }
    .data-table { font-size: clamp(13px, 0.6vw, 17px); }
    .data-table thead th { font-size: clamp(11px, 0.55vw, 14px); padding: clamp(12px, 0.6vw, 18px) clamp(14px, 0.7vw, 20px); }
    .data-table tbody td { padding: clamp(11px, 0.6vw, 16px) clamp(14px, 0.7vw, 20px); }
    .fte-goal-tile { padding: clamp(16px, 0.8vw, 24px); }
    .goal-label { font-size: clamp(11px, 0.55vw, 15px); }
    .goal-value { font-size: clamp(22px, 1.1vw, 32px); }
    .goal-detail { font-size: clamp(12px, 0.55vw, 16px); }
    .btn { font-size: clamp(13px, 0.6vw, 17px); }
    .btn-sm { font-size: clamp(12px, 0.55vw, 16px); }
    .form-control { font-size: clamp(13px, 0.6vw, 17px); }
    .modal-header h3, .edit-modal-header h3 { font-size: clamp(16px, 0.8vw, 22px); }
}
