/* ==========================================================================
   MetaPixel Plan — Clean, Refined SaaS & Spreadsheet Interface
   Geist Typography, Linear/Notion-inspired precision, high-density data grid
   ========================================================================== */

:root {
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', Menlo, Consolas, monospace;

    /* Neutrals */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-hover: #f8fafc;

    --border-subtle: #edf2f7;
    --border-base: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-tertiary: #94a3b8;

    /* Brand / Accent */
    --brand-primary: #0f172a;
    --brand-primary-hover: #1e293b;
    --brand-accent: #16a34a;
    --brand-accent-hover: #15803d;
    --brand-accent-subtle: #f0fdf4;
    --brand-accent-text: #166534;

    /* Status Colors (Subtle & High-legibility) */
    --status-new-bg: #f1f5f9;
    --status-new-text: #475569;
    --status-new-dot: #94a3b8;

    --status-prog-bg: #eff6ff;
    --status-prog-text: #1d4ed8;
    --status-prog-dot: #3b82f6;

    --status-done-bg: #f0fdf4;
    --status-done-text: #15803d;
    --status-done-dot: #22c55e;

    --status-pause-bg: #fffbeb;
    --status-pause-text: #b45309;
    --status-pause-dot: #f59e0b;

    --status-danger-bg: #fef2f2;
    --status-danger-text: #b91c1c;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    background-color: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

.num {
    font-family: var(--font-mono);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   Header & App Navigation
   ========================================================================== */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-base);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-xs);
}

.header-container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background-color: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-title {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-base);
}

/* Nav Tabs */
.tabs-nav {
    display: flex;
    align-items: center;
    background-color: var(--bg-subtle);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-base);
    gap: 2px;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.tab-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 9999px;
    background-color: #e2e8f0;
    color: #475569;
    font-weight: 600;
}

.tab-link.active .tab-count {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

/* Header Right: Stats Summary & User Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stats-summary-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 3px 6px;
    gap: 12px;
    font-size: 12.5px;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 2px 6px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.stat-val {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-val.blue {
    color: #2563eb;
}

.stat-val.green {
    color: #16a34a;
}

.stat-val.red {
    color: #dc2626;
}

.stat-divider {
    width: 1px;
    height: 14px;
    background-color: var(--border-base);
}

/* User Profile */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 12px;
    border-left: 1px solid var(--border-base);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.user-profile-btn:hover {
    background-color: var(--bg-subtle);
}

.user-profile-btn:hover .user-name {
    color: #2563eb;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #0f172a;
    color: #ffffff;
    font-weight: 600;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar.admin { background-color: #4f46e5; }
.user-avatar.head { background-color: #059669; }
.user-avatar.specialist { background-color: #2563eb; }

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-primary);
    white-space: nowrap;
}

.user-role-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ==========================================================================
   Flash Notifications
   ========================================================================== */
.flash-bar {
    background-color: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.flash-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    margin-left: 12px;
}

.flash-close-btn:hover {
    color: #ffffff;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
    flex: 1;
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   Filter & Search Toolbar (Refined 1-row or 2-row clean alignment)
   ========================================================================== */
.toolbar-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Unified Filter Selects */
.filter-select-group {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 0 6px;
    height: 32px;
    gap: 4px;
    transition: all 0.15s ease;
}

.filter-select-group:focus-within {
    border-color: #94a3b8;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

.filter-select-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-select-input {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    padding-right: 2px;
}

/* Status Segmented Control */
.status-tabs {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 1px;
    height: 32px;
}

.status-tab-btn {
    padding: 0 8px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.status-tab-btn:hover {
    color: var(--text-primary);
}

.status-tab-btn.active {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

/* Search Bar */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 180px;
}

.search-box input {
    width: 100%;
    height: 32px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 0 24px 0 10px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.search-box input:focus {
    background-color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.search-clear-btn {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-base);
}

.filter-select-group.is-active {
    background-color: #ffffff;
    border-color: #64748b;
    box-shadow: 0 0 0 1px #64748b;
}

.btn-reset-filters:hover {
    background-color: #fef2f2;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #16a34a;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #15803d;
}

.btn-secondary {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-strong);
}

.btn-dark {
    background-color: #0f172a;
    color: #ffffff;
}

.btn-dark:hover {
    background-color: #1e293b;
}

.btn-danger-text {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.btn-danger-text:hover {
    background-color: #fef2f2;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    transition: all 0.12s ease;
}

.btn-action-icon:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background-color: var(--bg-subtle);
}

.btn-action-icon.blue:hover {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background-color: #eff6ff;
}

/* ==========================================================================
   Data Table
   ========================================================================== */
.table-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-scrollable {
    overflow-x: auto;
    max-height: 72vh;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    padding: 9px 12px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-base);
    border-right: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
    border-right: none;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

.data-table tfoot td {
    background-color: #f8fafc;
    border-top: 1px solid var(--border-base);
    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
    font-weight: 700;
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 9px 12px;
}

.data-table tfoot td:last-child {
    border-right: none;
}

.actions-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Specific Columns Alignment */
.td-id {
    text-align: center;
    width: 44px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.td-right { text-align: right; }
.td-center { text-align: center; }
.td-nowrap { white-space: nowrap; }

/* Status Badges with Subtle Dot */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

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

.badge-status.in_progress {
    background-color: var(--status-prog-bg);
    color: var(--status-prog-text);
}
.badge-status.in_progress .status-dot { background-color: var(--status-prog-dot); }

.badge-status.new {
    background-color: var(--status-new-bg);
    color: var(--status-new-text);
}
.badge-status.new .status-dot { background-color: var(--status-new-dot); }

.badge-status.done {
    background-color: var(--status-done-bg);
    color: var(--status-done-text);
}
.badge-status.done .status-dot { background-color: var(--status-done-dot); }

.badge-status.paused {
    background-color: var(--status-pause-bg);
    color: var(--status-pause-text);
}
.badge-status.paused .status-dot { background-color: var(--status-pause-dot); }

/* Interactive Status Select in Table */
.status-select-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    border-radius: 9999px;
    padding: 2px 7px 2px 7px;
    gap: 5px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.status-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    outline: none;
    padding-right: 12px;
}

.status-select-wrap select option {
    background-color: #ffffff;
    color: #0f172a;
    font-weight: 500;
    padding: 4px;
}

.status-select-wrap .status-chevron {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.55;
    display: flex;
    align-items: center;
}

.status-select-wrap:hover {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.status-select-wrap.saved-flash {
    animation: statusSaved 0.5s ease;
}

@keyframes statusSaved {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 2px #22c55e; }
    100% { transform: scale(1); }
}

/* Hours & Progress Bars */
.hours-cell {
    font-weight: 600;
    font-size: 13px;
}

.fact-progress-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xs);
    font-weight: 600;
}

.fact-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(59, 130, 246, 0.12);
    pointer-events: none;
}

.fact-progress-bar.overdue {
    background-color: rgba(239, 68, 68, 0.14);
}

.delta-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 12.5px;
}

.delta-badge.positive { color: #16a34a; }
.delta-badge.negative { color: #dc2626; }
.delta-badge.neutral { color: var(--text-muted); }

/* Role Badges */
.badge-role {
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-role.admin { background-color: #eef2ff; color: #4338ca; }
.badge-role.head { background-color: #ecfdf5; color: #065f46; }
.badge-role.specialist { background-color: #f1f5f9; color: #475569; }

/* Heads Multi-select Checklist */
.heads-select-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.heads-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.heads-select-item:hover {
    background-color: #ffffff;
    border-color: #94a3b8;
}

.heads-select-item.is-selected {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.heads-select-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heads-select-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #16a34a;
    cursor: pointer;
}

/* Grid for Cards */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1rem;
}

.team-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-member-list {
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 13px;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-base);
    max-width: 560px;
    width: 100%;
    overflow: hidden;
    animation: modalPop 0.15s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background-color: var(--bg-subtle);
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-link {
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-link:hover {
    color: var(--text-primary);
    background-color: var(--border-base);
}

.modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
}

.modal-footer {
    background-color: var(--bg-subtle);
    padding: 12px 20px;
    border-top: 1px solid var(--border-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* ==========================================================================
   Login / Auth Screen
   ========================================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    padding: 1.5rem;
}

.auth-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
}

.auth-header {
    padding: 2rem 1.75rem 1.25rem 1.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.auth-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-error {
    background-color: var(--status-danger-bg);
    border: 1px solid #fecaca;
    color: var(--status-danger-text);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 500;
}

.auth-demo-box {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 4px;
}

.auth-demo-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.auth-demo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 5px;
    text-align: left;
    transition: all 0.12s ease;
}

.auth-demo-btn:hover {
    border-color: #0f172a;
    background-color: #f8fafc;
}

/* Helpers */
.text-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-muted { color: var(--text-muted); }
.text-tertiary { color: var(--text-tertiary); }
.text-danger { color: #dc2626; }
.text-success { color: #16a34a; }
.text-blue { color: #2563eb; }

/* ==========================================================================
   AI Audit Banner & Modal
   ========================================================================== */
.ai-audit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;    
    font-size: 12.5px;
    gap: 12px;
    transition: all 0.2s ease;
}

.ai-audit-banner.needs_audit {
    background-color: #eff6ff;    
    color: #1e40af;
}

.ai-audit-banner.outdated {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ai-audit-banner.up_to_date_passed {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.ai-audit-banner.up_to_date_warning {
    background-color: #fefce8;
    border: 1px solid #fef08a;
    color: #854d0e;
}

.ai-banner-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ai-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.ai-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid currentColor;
    background-color: #ffffff;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ai-banner-btn:hover {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ai-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 12px;
}

.ai-score-badge.green {
    background-color: #dcfce7;
    color: #166534;
}

.ai-score-badge.yellow {
    background-color: #fef9c3;
    color: #854d0e;
}

.ai-rec-card {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
