/* =============================================================================
   Procurement Intelligence Agent — Design System
   Premium dark-mode dashboard with glassmorphism and micro-animations
   ============================================================================= */

/* --- CSS Custom Properties --- */
:root {
    /* Colors — Slate/Blue palette */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1e293b;
    --bg-card-hover: #253347;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --bg-input: #0f172a;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;

    --priority-high: #22c55e;
    --priority-high-bg: rgba(34, 197, 94, 0.1);
    --priority-medium: #eab308;
    --priority-medium-bg: rgba(234, 179, 8, 0.1);
    --priority-low: #f97316;
    --priority-low-bg: rgba(249, 115, 22, 0.1);
    --priority-disqualified: #ef4444;
    --priority-disqualified-bg: rgba(239, 68, 68, 0.1);

    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-active: rgba(59, 130, 246, 0.4);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3%, -3%) rotate(2deg); }
}

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; }
a { color: var(--accent-blue); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--accent-cyan); }

/* --- Layout --- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; flex-shrink: 0; background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle); padding: 28px 20px;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sidebar-logo { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 28px; letter-spacing: -0.5px; }
.sidebar-logo span { color: var(--accent-blue); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; min-height: 0; padding-right: 2px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-dim);
    text-decoration: none; transition: all 0.15s;
}
.sidebar-nav .nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-nav .nav-link.active { background: var(--accent-blue-glow); color: var(--accent-blue); }
.sidebar-section { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); padding: 16px 12px 6px; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 4px; }
.sidebar-footer .nav-link { font-size: 12px; color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; transition: all 0.15s; }
.sidebar-footer .nav-link:hover { color: var(--accent-blue); background: var(--bg-card); }

/* --- Lucide nav icons --- */
.nav-link svg, .nav-link i[data-lucide],
.support-nav-btn svg, .support-nav-btn i[data-lucide] {
    width: 16px; height: 16px; flex-shrink: 0;
    stroke-width: 1.75; stroke: currentColor; fill: none;
    stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-footer .nav-link svg,
.sidebar-footer .nav-link i[data-lucide] {
    width: 15px; height: 15px;
}

/* --- Pipeline Sidebar --- */
.pipeline-nav { margin-top: 4px; }
.pipeline-nav .nav-link { position: relative; }
.pipeline-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 6px rgba(255,255,255,0.1);
}
.pipeline-count {
    margin-left: auto; font-size: 11px; font-weight: 700; min-width: 22px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); border-radius: 100px; color: var(--text-muted);
    padding: 0 6px; transition: all 0.2s;
}
.pipeline-stage.active .pipeline-count { background: var(--accent-blue-glow); color: var(--accent-blue); }
.pipeline-stage[data-stage="watching"]:hover,
.pipeline-stage[data-stage="watching"].active { color: #9CA3AF; }
.pipeline-stage[data-stage="qualifying"]:hover,
.pipeline-stage[data-stage="qualifying"].active { color: #60A5FA; }
.pipeline-stage[data-stage="pursuing"]:hover,
.pipeline-stage[data-stage="pursuing"].active { color: #A78BFA; }
.pipeline-stage[data-stage="submitted"]:hover,
.pipeline-stage[data-stage="submitted"].active { color: #FBBF24; }
.pipeline-stage[data-stage="won"]:hover,
.pipeline-stage[data-stage="won"].active { color: #34D399; }
.pipeline-stage[data-stage="lost"]:hover,
.pipeline-stage[data-stage="lost"].active { color: #F87171; }

.quick-actions-nav { margin-top: 4px; }

/* --- Pipeline Stage Dropdown (on opportunity cards) --- */
.pipeline-stage-select {
    background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-subtle);
    border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s; outline: none; text-transform: capitalize;
}
.pipeline-stage-select:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.pipeline-stage-select:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 2px var(--accent-blue-glow); }

/* --- Kanban Board --- */
.kanban-view { padding: var(--space-lg) 0; width: 100%; }
.kanban-board {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
    width: 100%; min-height: calc(100vh - 200px); align-items: start;
}
.kanban-column {
    background: var(--bg-secondary); border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle); min-height: 300px; display: flex; flex-direction: column;
}
.kanban-column.drag-over {
    border-color: var(--accent-blue); background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}
.kanban-column__header {
    padding: 14px 14px 10px; display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid var(--stage-color, var(--border-subtle));
    flex-shrink: 0;
}
.kanban-column__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kanban-column__title { font-size: 13px; font-weight: 700; flex: 1; white-space: nowrap; }
.kanban-column__count {
    font-size: 11px; font-weight: 700; min-width: 22px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); border-radius: 100px; color: var(--text-muted); padding: 0 6px;
}
.kanban-column__cards { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

/* Kanban Card */
.kanban-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 12px; cursor: grab;
    transition: all 0.15s var(--ease-out); position: relative;
}
.kanban-card:hover { border-color: var(--border-active); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); cursor: grabbing; }
.kanban-card__title { font-size: 12px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; color: var(--text-primary); }
.kanban-card__meta { font-size: 11px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kanban-card__score {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; font-size: 10px; font-weight: 800;
    background: var(--bg-secondary);
}
.kanban-card__priority {
    display: inline-flex; padding: 1px 6px; border-radius: 100px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.kanban-card__deadline { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.kanban-card__deadline.urgent { color: #F87171; font-weight: 600; }
.kanban-card__deadline.soon { color: #FBBF24; }

/* Task List Styles */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); transition: all 0.15s;
}
.task-item:hover { border-color: var(--border-active); }
.task-item--completed { opacity: 0.5; }
.task-item--completed .task-item__title { text-decoration: line-through; }
.task-checkbox {
    width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--text-muted);
    background: transparent; cursor: pointer; flex-shrink: 0; margin-top: 2px;
    transition: all 0.15s; display: flex; align-items: center; justify-content: center;
    color: transparent; font-size: 12px;
}
.task-checkbox:hover { border-color: var(--accent-blue); }
.task-checkbox.checked { background: var(--accent-blue); border-color: var(--accent-blue); color: white; }
.task-item__body { flex: 1; min-width: 0; }
.task-item__title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.task-item__meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 10px; align-items: center; }
.task-priority-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    padding: 1px 6px; border-radius: 100px;
}
.task-priority-badge--critical { background: rgba(239,68,68,0.15); color: #F87171; }
.task-priority-badge--high { background: rgba(249,115,22,0.15); color: #FB923C; }
.task-priority-badge--medium { background: rgba(234,179,8,0.15); color: #FBBF24; }
.task-priority-badge--low { background: rgba(34,197,94,0.15); color: #34D399; }

/* Modal Tasks Section */
.modal-tasks__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.modal-task-item:hover {
    border-color: var(--border-active);
}
.modal-task-item--completed {
    opacity: 0.45;
}
.modal-task-item--completed .modal-task-item__title {
    text-decoration: line-through;
}
.modal-task-item__body {
    flex: 1;
    min-width: 0;
}
.modal-task-item__title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}
.modal-task-item__meta {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.modal-task-item__delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 0;
}
.modal-task-item:hover .modal-task-item__delete {
    opacity: 1;
}
.modal-task-item__delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modal-add-task {
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

/* Solicitation search dropdown */
.sol-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 260px;
    overflow-y: auto;
    margin-top: 4px;
}
.sol-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}
.sol-search-item:last-child {
    border-bottom: none;
}
.sol-search-item:hover {
    background: var(--bg-tertiary);
}
.sol-search-item--empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: default;
    text-align: center;
}
.sol-search-item--empty:hover {
    background: transparent;
}
.sol-search-item__title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.sol-search-item__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Deadline View */
.deadline-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); transition: all 0.15s; cursor: pointer;
}
.deadline-card:hover { border-color: var(--border-active); transform: translateY(-1px); }
.deadline-countdown {
    min-width: 70px; text-align: center; font-weight: 800; font-size: 14px;
    padding: 8px; border-radius: var(--radius-md);
}
.deadline-countdown.red { background: rgba(239,68,68,0.12); color: #F87171; }
.deadline-countdown.amber { background: rgba(245,158,11,0.12); color: #FBBF24; }
.deadline-countdown.green { background: rgba(34,197,94,0.12); color: #34D399; }
.deadline-info { flex: 1; min-width: 0; }
.deadline-info__title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.deadline-info__meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* View header (used in Tasks/Deadlines/Kanban views) */
.view-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 0 20px; margin-bottom: 4px;
}
.view-header__title { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.view-header__subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.view-header__actions { display: flex; gap: 8px; }

.main { flex: 1; overflow-x: hidden; }

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* --- Header --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-xl);
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.app-header__icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--accent-blue-glow));
}

.app-header__title {
    color: var(--text-primary);
}

.app-header__subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 2px;
}

.app-header__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.btn svg, .btn i[data-lucide] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn--primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn--primary:hover {
    background: #2563eb;
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border-subtle);
}

.btn--save {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
    color: #eab308;
}

.btn--save:hover {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
}

.btn--dismiss {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn--dismiss:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn--loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* --- Tenant Switcher (dropdown) --- */
.tenant-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
}

.tenant-switcher__left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.tenant-switcher__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tenant-switcher__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
}

.tenant-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tenant-dropdown {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 8px 36px 8px 14px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    min-width: 200px;
}

.tenant-dropdown:hover,
.tenant-dropdown:focus {
    border-color: var(--border-active);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.tenant-dropdown-arrow {
    position: absolute;
    right: 12px;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tenant-focus-badge {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-full);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.btn--sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* --- New Tenant Panel --- */
.new-tenant-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(59, 130, 246, 0.1);
    animation: panelSlideIn 0.2s var(--ease-out);
}

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

.new-tenant-panel__header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(59, 130, 246, 0.04);
}

.new-tenant-panel__header h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.new-tenant-panel__header p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.new-tenant-panel__body {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.new-tenant-panel__footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-section__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: 9px 12px;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.form-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 100px;
}

.form-status {
    font-size: 0.82rem;
    font-weight: 500;
    margin-left: auto;
}

.form-status--ok   { color: #22c55e; }
.form-status--err  { color: #ef4444; }

/* --- Tenant Status Badge --- */
.tenant-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tenant-status-badge--suspended {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: #f97316;
}
.tenant-status-badge--inactive {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

/* --- Manage Tenants Panel --- */
.manage-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    animation: panelSlideIn 0.2s var(--ease-out);
}

.manage-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.manage-panel__header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.manage-panel__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.manage-panel__close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.manage-panel__list {
    padding: var(--space-sm);
}

.tenant-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}
.tenant-row:hover { background: rgba(255,255,255,0.03); }

.tenant-row__info {
    flex: 1;
    min-width: 0;
}

.tenant-row__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.tenant-row__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tenant-row__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: var(--radius-full);
}
.tenant-row__status--active {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.tenant-row__status--suspended {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}
.tenant-row__status--inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.tenant-row__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* --- Tenant User Management --- */
.tenant-user-list {
    margin-top: 10px;
}

.user-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
    border-bottom: 1px solid var(--border-subtle);
}
.user-row:last-child {
    border-bottom: none;
}
.user-row:hover {
    background: rgba(255,255,255,0.03);
}

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

.user-row__name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.user-row__meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-row__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.user-row__status--active {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.user-row__status--inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.user-row__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-add-form {
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 10px;
    margin-bottom: 10px;
}

.user-edit-inline {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    width: 100%;
}

.btn--warn {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: #f97316;
}
.btn--warn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

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

.btn--success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}
.btn--success:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-content--wide { max-width: 720px; }

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

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.modal__header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.modal__close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.modal__footer {
    flex-shrink: 0;
}

.edit-section {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-subtle);
}
.edit-section:last-child { border-bottom: none; }

/* --- NAICS rows --- */
.naics-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.naics-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.naics-row input {
    flex: 1;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.naics-row__remove {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.85rem;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}
.naics-row__remove:hover { color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* --- State checkbox grid --- */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
    margin-top: var(--space-sm);
}

.state-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    cursor: pointer;
}

.state-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* --- Set-aside checkbox grid --- */
.set-aside-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin-top: var(--space-sm);
}

.set-aside-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast);
}
.set-aside-check:hover {
    background: rgba(255,255,255,0.04);
}

.set-aside-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.set-aside-check__code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    opacity: 0.55;
    margin-left: auto;
    flex-shrink: 0;
}

.set-aside-excluded-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

/* --- Status actions (in edit modal) --- */
.status-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
    padding-top: var(--space-sm);
}

/* --- Stats Grid --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-card__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card__value--high { 
    background: linear-gradient(135deg, var(--priority-high), #4ade80);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card__value--medium {
    background: linear-gradient(135deg, var(--priority-medium), #facc15);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card__label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* --- Opportunity Section Header --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section-header__title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* =============================================================================
   Premium Filter Bar
   Pill-style filter controls inspired by SBA's clean filter UX
   ============================================================================= */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    /* Stacking context above opp-cards (which have no explicit z-index) */
    z-index: 50;
}

/* The divider between regular filters and Sort pill */
.filter-bar__divider {
    width: 1px;
    height: 20px;
    background: rgba(148, 163, 184, 0.15);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Filter count indicator */
.filter-bar__active-count {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-blue);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.filter-bar--has-active .filter-bar__active-count {
    display: inline-flex;
}

/* "Clear filters" link */
.filter-bar__clear {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    transition: color var(--duration-fast), background var(--duration-fast);
    margin-left: 2px;
    border: none;
    background: none;
    text-decoration: none;
}

.filter-bar__clear:hover {
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.08);
}

.filter-bar--has-active .filter-bar__clear {
    display: inline-flex;
}

/* --- Filter Pill Container --- */
.filter-pill {
    position: relative;
    flex-shrink: 0;
}

/* The clickable pill button */
.filter-pill__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-out);
    user-select: none;
}

.filter-pill__btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-primary);
}

/* Active pill — a filter is applied */
.filter-pill--active .filter-pill__btn {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text-primary);
}

.filter-pill--active .filter-pill__btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.65);
}

/* Open state — dropdown is showing */
.filter-pill--open .filter-pill__btn {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

.filter-pill__label {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.filter-pill--active .filter-pill__label {
    color: rgba(147, 197, 253, 0.8);
}

.filter-pill__value {
    font-weight: 600;
    font-size: 0.8rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-pill__chevron {
    font-size: 9px;
    opacity: 0.6;
    transition: transform var(--duration-fast) var(--ease-out);
    margin-left: 1px;
    flex-shrink: 0;
}

.filter-pill--open .filter-pill__chevron {
    transform: rotate(180deg);
}

/* The tooltip icon inside a pill */
.filter-pill__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    cursor: default;
    flex-shrink: 0;
    margin-left: -2px;
}

/* --- Filter Dropdown Panel --- */
.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #1a2540;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 500;
    overflow: hidden;
    animation: filterDropIn 0.15s var(--ease-out) both;
}

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

.filter-pill--open .filter-dropdown {
    display: block;
}

.filter-dropdown__header {
    padding: 10px 14px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.filter-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text-secondary);
    transition: background var(--duration-fast), color var(--duration-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
}

.filter-dropdown__item:hover {
    background: rgba(148, 163, 184, 0.07);
    color: var(--text-primary);
}

.filter-dropdown__item--active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.06);
}

.filter-dropdown__item--active:hover {
    background: rgba(59, 130, 246, 0.1);
}

.filter-dropdown__check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    font-size: 9px;
    color: transparent;
    background: rgba(30, 41, 59, 0.5);
    transition: all var(--duration-fast);
}

.filter-dropdown__item--active .filter-dropdown__check {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.filter-dropdown__divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.08);
    margin: 4px 0;
}

/* Sort pill is slightly visually distinct — right-side of bar */
.filter-pill--sort .filter-pill__btn {
    background: rgba(20, 30, 50, 0.5);
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.1);
}

.filter-pill--sort .filter-pill__btn:hover {
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.8);
}

/* Hidden native selects — kept for JS compatibility */
.filter-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* --- Select All --- */
.select-all {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    user-select: none;
    transition: color var(--duration-fast);
}

.select-all:hover {
    color: var(--text-secondary);
}

.select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.opp-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.opp-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.opp-card__checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.opp-card__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    transition: transform var(--duration-fast);
}

.opp-card__checkbox input[type="checkbox"]:hover {
    transform: scale(1.15);
}

.opp-card__body {
    flex: 1;
    min-width: 0;
}

.opp-card--selected {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 0 1px var(--accent-blue), var(--shadow-glow);
}

.opp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width var(--duration-slow) var(--ease-out);
}

.opp-card--high::before { background: var(--priority-high); }
.opp-card--medium::before { background: var(--priority-medium); }
.opp-card--low::before { background: var(--priority-low); }
.opp-card--disqualified::before { background: var(--priority-disqualified); }

.opp-card:hover {
    border-color: var(--border-active);
    transform: translateX(4px);
    box-shadow: var(--shadow-card);
}

.opp-card:hover::before {
    width: 6px;
}

.opp-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.opp-card__rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 28px;
}

.opp-card__title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.opp-card__score-gauge {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.opp-card__score-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--duration-slow) var(--ease-out);
}

.opp-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    padding-left: 28px;
}

.opp-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.opp-card__meta-icon {
    font-size: 0.9rem;
}



.opp-card__scores {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding-left: 28px;
}

.opp-card__score-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
}

.opp-card__score-chip span {
    font-weight: 600;
    color: var(--text-secondary);
}

/* --- Card Actions (Save / Dismiss) --- */
.opp-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    padding-left: 28px;
}

.opp-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: transparent;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    color: var(--text-muted);
}

.opp-action:hover {
    transform: translateY(-1px);
}

.opp-action--save:hover {
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.4);
    background: rgba(234, 179, 8, 0.08);
}

.opp-action--saved {
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.3);
    background: rgba(234, 179, 8, 0.1);
}

.opp-action--dismiss:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

/* --- Priority Badge --- */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.priority-badge--high {
    background: var(--priority-high-bg);
    color: var(--priority-high);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.priority-badge--medium {
    background: var(--priority-medium-bg);
    color: var(--priority-medium);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.priority-badge--low {
    background: var(--priority-low-bg);
    color: var(--priority-low);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.priority-badge--disqualified {
    background: var(--priority-disqualified-bg);
    color: var(--priority-disqualified);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- Source Badge --- */
.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.source-badge--sam {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.source-badge--esbd {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.source-badge--dir {
    background: rgba(20, 184, 166, 0.12);
    color: #14b8a6;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

/* --- Detail Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp var(--duration-slow) var(--ease-out);
}

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

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}

.modal__close:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.modal__section {
    margin-bottom: var(--space-lg);
}

.modal__section-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.modal__field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-lg);
}

.modal__field {
    padding: var(--space-sm) 0;
}

.modal__field-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.modal__field-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.modal__tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.modal__tag {
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* --- Loading State --- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    gap: var(--space-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state__message {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.empty-state__hint {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: var(--shadow-card);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-out);
    z-index: 2000;
}

.toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.toast--success { border-left: 3px solid var(--priority-high); }
.toast--error { border-left: 3px solid var(--priority-disqualified); }

/* --- Floating Export Bar --- */
.export-bar {
    position: fixed;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    width: max-content;
    max-width: 95vw;
    transition: bottom var(--duration-slow) var(--ease-out);
}

.export-bar--visible {
    bottom: var(--space-xl);
}

.export-bar__content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-xl);
    padding: var(--space-md) var(--space-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-blue-glow);
    backdrop-filter: blur(16px);
}

.export-bar__count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.export-bar__count strong {
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 1.1rem;
}

.export-bar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

/* --- Deep Analysis — Card Preview --- */
.deep-analysis-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.opp-card__deep-analysis {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-sm);
    margin-left: 28px;
    border-left: 3px solid var(--accent-purple);
}

.opp-card__deep-analysis-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}

.opp-card__deep-analysis-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Deep Analysis — Modal Sections --- */
.deep-analysis__divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--accent-purple);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.deep-analysis__divider::before,
.deep-analysis__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.deep-analysis__content {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-out),
                opacity var(--duration-normal) var(--ease-out);
}

.deep-analysis__content p {
    margin-bottom: var(--space-md);
}

.deep-analysis__content p:last-child {
    margin-bottom: 0;
}

.deep-analysis__content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Collapsible sections */
.deep-analysis__collapsible {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    user-select: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--duration-fast), opacity var(--duration-fast);
}

.deep-analysis__collapsible:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.08);
    padding-left: 4px;
    padding-right: 4px;
    margin-left: -4px;
    margin-right: -4px;
}

.deep-analysis__toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-size: 1rem;
    opacity: 0.7;
    transition: transform var(--duration-fast), opacity var(--duration-fast);
    flex-shrink: 0;
}

.deep-analysis__collapsed {
    max-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0;
    margin: 0;
}

/* Markdown headers inside deep analysis */
.deep-analysis__h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-lg) 0 var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.deep-analysis__h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--space-md) 0 var(--space-sm);
}

.deep-analysis__h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin: var(--space-md) 0 var(--space-xs);
}

.deep-analysis__list {
    list-style: none;
    padding-left: var(--space-md);
    margin: var(--space-sm) 0;
}

.deep-analysis__list li {
    position: relative;
    padding-left: var(--space-md);
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.deep-analysis__list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

/* Eligibility Flags */
.deep-analysis__flags {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.deep-analysis__flag {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: border-color var(--duration-fast);
}

.deep-analysis__flag--danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.deep-analysis__flag--warning {
    border-color: rgba(234, 179, 8, 0.3);
    background: rgba(234, 179, 8, 0.05);
}

.deep-analysis__flag-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.deep-analysis__flag-category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.deep-analysis__flag-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 2px;
}

/* Action Items */
.deep-analysis__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.deep-analysis__action {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.deep-analysis__action-priority {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.deep-analysis__action-text {
    color: var(--text-primary);
}

.deep-analysis__action-deadline,
.deep-analysis__action-owner {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Pagination --- */
.pagination {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
}

.pagination--visible {
    display: flex;
}

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

.pagination__info strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.pagination__controls {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.pagination__btn:hover:not(:disabled):not(.pagination__btn--active) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.pagination__btn--active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue-glow);
    font-weight: 700;
    cursor: default;
}

.pagination__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination__nav {
    font-size: 0.8rem;
    padding: 0 var(--space-md);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-dim);
    font-size: 0.9rem;
    user-select: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }

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

    .opp-card__header {
        flex-direction: column;
    }

    .opp-card__score-gauge {
        align-self: flex-end;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .export-bar__content {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md);
    }

    .pagination__controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* ── Mobile filter bar ──────────────────────────────────────── */
    /* Hide the pill bar on mobile */
    .filter-bar {
        display: none !important;
    }

    /* Show mobile trigger row */
    .filter-mobile-row {
        display: flex !important;
    }
}

/* --- Mobile Filter Trigger Row (hidden on desktop) --- */
.filter-mobile-row {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.filter-mobile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    flex: 1;
    justify-content: center;
}

.filter-mobile-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

.filter-mobile-btn__icon {
    font-size: 1rem;
    line-height: 1;
}

.filter-mobile-badge {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    margin-left: 2px;
}

.filter-mobile-btn--active .filter-mobile-badge {
    display: inline-flex;
}

.filter-mobile-btn--active {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

/* --- Mobile Filter Modal --- */
.filter-mobile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
}

.filter-mobile-modal.open {
    display: flex;
}

.filter-mobile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease both;
}

.filter-mobile-modal__sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: #111827;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-left: 1px solid rgba(148, 163, 184, 0.08);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpSheet 0.25s var(--ease-out) both;
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.filter-mobile-modal__handle {
    width: 36px;
    height: 4px;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.filter-mobile-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    flex-shrink: 0;
}

.filter-mobile-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.filter-mobile-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(148, 163, 184, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.filter-mobile-modal__close:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
}

.filter-mobile-modal__body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0 12px;
}

/* Each filter group in mobile modal */
.filter-mobile-section {
    padding: 4px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.filter-mobile-section:last-child {
    border-bottom: none;
}

.filter-mobile-section__label {
    padding: 10px 20px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.filter-mobile-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: background var(--duration-fast), color var(--duration-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
}

.filter-mobile-option:hover {
    background: rgba(148, 163, 184, 0.05);
    color: var(--text-primary);
}

.filter-mobile-option--active {
    color: var(--text-primary);
}

.filter-mobile-option__check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--duration-fast);
    font-size: 10px;
    color: transparent;
    background: rgba(30, 41, 59, 0.5);
}

.filter-mobile-option--active .filter-mobile-option__check {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.filter-mobile-modal__footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    flex-shrink: 0;
}

.filter-mobile-modal__apply {
    flex: 1;
    padding: 12px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast);
}

.filter-mobile-modal__apply:hover {
    background: #2563eb;
}

.filter-mobile-modal__clear {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.filter-mobile-modal__clear:hover {
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
}

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

    .tenant-tabs {
        flex-direction: column;
    }
}

/* --- Global Mobile Navigation --- */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show {
    display: block;
}
@media (max-width: 900px) {
    .mobile-nav-toggle { display: block; }
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0; bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 250px;
    }
    .sidebar.open {
        left: 0;
    }
    .main {
        margin-left: 0 !important;
        padding: 16px !important;
    }
    .layout { flex-direction: column; }
    .kpi-grid, .charts-grid, .stats-grid, .form-grid, .quota-vendors {
        grid-template-columns: 1fr !important;
    }
    .table-wrap { overflow-x: auto; width: 100%; }
    .tenant-switcher { flex-direction: column; align-items: stretch; }
    .tenant-switcher__left { width: 100%; flex-wrap: wrap; justify-content: space-between; }
    .tenant-switcher__right { width: 100%; flex-wrap: wrap; }
    .tenant-dropdown-wrap, .tenant-dropdown { width: 100%; min-width: 0; flex: 1; }
    .modal-content, #modal-content { max-width: 95vw; margin: 10px; padding: 16px; }
    .deep-analysis__action { grid-template-columns: 1fr; text-align: left; align-items: flex-start; }
    .on-demand-analysis__header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* =============================================================================
   On-Demand Deep Analysis Button
   ============================================================================= */

.on-demand-analysis {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.on-demand-analysis__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.on-demand-analysis__status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.on-demand-analysis__quota {
    text-align: right;
}

.on-demand-analysis__quota-text {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    letter-spacing: 0.02em;
}

.on-demand-analysis__quota--low {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.08);
}

.on-demand-analysis__quota--exhausted {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.on-demand-analysis__btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: none;
    border-radius: var(--radius-lg);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.on-demand-analysis__btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.on-demand-analysis__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.on-demand-analysis__note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 12px 0 0;
    text-align: center;
}

/* Loading spinner inside button */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* =============================================================================
   Trial Paywall — Locked opportunity cards & upgrade CTA
   ============================================================================= */

/* Locked card overlay */
.opp-card--locked {
    cursor: default !important;
}

.paywall-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
    background: rgba(10, 15, 26, 0.4);
    backdrop-filter: blur(2px);
}

.paywall-overlay__icon {
    font-size: 24px;
}

.paywall-overlay__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

/* Paywall CTA banner between opportunity list and pagination */
.paywall-cta {
    text-align: center;
    padding: 40px 24px;
    margin: 16px 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-lg);
}

.paywall-cta__icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.paywall-cta__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.paywall-cta__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.paywall-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: 0 4px 20px var(--accent-blue-glow);
}

.paywall-cta__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-blue-glow);
}

/* =============================================================================
   New-User Scanning Animation (empty dashboard for trial users)
   ============================================================================= */

.scanning-container {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.scanning-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    animation: scanPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.scanning-radar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(59,130,246,0.3);
    position: relative;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanning-radar::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(59,130,246,0.15);
    animation: radarRing 2s ease-out infinite;
}

.scanning-radar::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 1px solid rgba(59,130,246,0.08);
    animation: radarRing 2s ease-out infinite 0.5s;
}

@keyframes radarRing {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.scanning-radar-icon {
    font-size: 48px;
}

@keyframes radarSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scanning-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.scanning-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.scanning-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin-bottom: 32px;
}

.scanning-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(30,41,59,0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-12px);
    animation: stepFadeIn 0.5s ease-out forwards;
}

.scanning-step:nth-child(1) { animation-delay: 0.3s; }
.scanning-step:nth-child(2) { animation-delay: 1.2s; }
.scanning-step:nth-child(3) { animation-delay: 2.1s; }
.scanning-step:nth-child(4) { animation-delay: 3.0s; }
.scanning-step:nth-child(5) { animation-delay: 3.9s; }

.scanning-step.active {
    border-color: rgba(59,130,246,0.4);
    color: var(--text-primary);
}

.scanning-step .step-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.scanning-step .step-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59,130,246,0.3);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes stepFadeIn {
    to { opacity: 1; transform: translateX(0); }
}

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

.scanning-progress {
    width: 300px;
    height: 4px;
    background: rgba(59,130,246,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.scanning-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
    animation: scanProgress 8s ease-in-out infinite;
}

@keyframes scanProgress {
    0% { width: 0%; }
    50% { width: 80%; }
    100% { width: 100%; }
}

/* =============================================================================
   Intro.js Tour Dark Theme Overrides
   ============================================================================= */

.introjs-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    max-width: 420px !important;
    min-width: 320px !important;
}

.introjs-tooltiptext {
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    padding: 16px 20px !important;
}

.introjs-tooltip-title {
    color: var(--text-primary) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.introjs-tooltip-header {
    padding: 16px 20px 0 20px !important;
    position: relative !important;
}

.introjs-tooltipbuttons {
    border-top: 1px solid var(--border-subtle) !important;
    padding: 12px 16px !important;
}

.introjs-button {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-md) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    text-shadow: none !important;
    transition: all 0.15s !important;
}

.introjs-button:hover {
    background: var(--bg-card) !important;
    border-color: var(--accent-blue) !important;
    color: var(--text-primary) !important;
}

.introjs-button:focus {
    box-shadow: 0 0 0 3px var(--accent-blue-glow) !important;
}

.introjs-nextbutton, .introjs-donebutton {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: #fff !important;
}

.introjs-nextbutton:hover, .introjs-donebutton:hover {
    background: #60a5fa !important;
    border-color: #60a5fa !important;
}

.introjs-skipbutton {
    position: absolute !important;
    top: 16px !important;
    right: 20px !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.introjs-skipbutton:hover {
    color: var(--text-primary) !important;
}

.introjs-helperLayer {
    border-radius: var(--radius-md) !important;
    box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.6) !important;
}

.introjs-arrow {
    border-bottom-color: var(--bg-card) !important;
}

.introjs-arrow.top {
    border-bottom-color: var(--bg-card) !important;
}

.introjs-arrow.bottom {
    border-top-color: var(--bg-card) !important;
}

.introjs-arrow.left {
    border-right-color: var(--bg-card) !important;
}

.introjs-arrow.right {
    border-left-color: var(--bg-card) !important;
}

.introjs-bullets ul li a {
    background: var(--text-muted) !important;
}

.introjs-bullets ul li a.active {
    background: var(--accent-blue) !important;
}

.introjs-progress {
    background: rgba(59,130,246,0.15) !important;
}

.introjs-progressbar {
    background: var(--accent-blue) !important;
}

/* =============================================================================
   Filter Tooltip Utility  (.filter-tooltip-icon)
   A lightweight purely-CSS tooltip for inline ℹ️ icons in the filter bar.
   ============================================================================= */

.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: default;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.filter-tooltip-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.filter-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: normal;
    width: 220px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 200;
}

/* Caret */
.filter-tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(99, 102, 241, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 201;
}

.filter-tooltip-icon:hover::after,
.filter-tooltip-icon:hover::before {
    opacity: 1;
}

/* =============================================================================
   Support Chat System
   ============================================================================= */

/* --- Sidebar nav button --- */
.support-nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.support-nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.support-nav-btn.active { background: var(--accent-blue-glow); color: var(--accent-blue); }

/* Live indicator dot */
.support-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: support-ping 1.8s ease-in-out infinite;
}
.support-live-dot.offline {
    background: #64748b;
    box-shadow: none;
    animation: none;
}

@keyframes support-ping {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Unread badge on the nav button */
.support-unread-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}
.support-unread-badge.visible { display: flex; }

/* --- Panel overlay backdrop --- */
.support-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    animation: support-fade-in 0.2s ease;
}
.support-overlay.open { display: block; }

@keyframes support-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Chat panel drawer --- */
.support-panel {
    position: fixed;
    right: -420px;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 95vw;
    z-index: 901;
    background: linear-gradient(160deg, #13172a 0%, #0f1420 100%);
    border-left: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    transition: right 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.support-panel.open { right: 0; }

/* Panel header */
.support-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
}
.support-panel__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.support-panel__title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}
.support-panel__subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
}
.support-panel__close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #64748b;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.support-panel__close:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* Status pill in header */
.support-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.support-status-pill.online {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #22c55e;
}
.support-status-pill.offline {
    background: rgba(100, 116, 139, 0.12);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #64748b;
}

/* --- Chat messages area --- */
.support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}
.support-messages::-webkit-scrollbar { width: 4px; }
.support-messages::-webkit-scrollbar-track { background: transparent; }
.support-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Individual message bubbles */
.support-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: msg-appear 0.2s ease;
}
@keyframes msg-appear {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.support-msg.from-client { align-self: flex-end; flex-direction: row-reverse; }
.support-msg.from-support { align-self: flex-start; }

.support-msg__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.from-client .support-msg__avatar { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.from-support .support-msg__avatar { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }

.support-msg__bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 100%;
    word-break: break-word;
}
.from-client .support-msg__bubble {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #f8fafc;
    border-bottom-right-radius: 4px;
}
.from-support .support-msg__bubble {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.support-msg__meta {
    font-size: 10px;
    color: #475569;
    margin-top: 4px;
    text-align: right;
}
.from-support .support-msg__meta { text-align: left; }

/* Empty / welcome state */
.support-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 20px;
    gap: 12px;
    color: #64748b;
    flex: 1;
}
.support-welcome__icon { font-size: 40px; }
.support-welcome__title { font-size: 15px; font-weight: 600; color: #94a3b8; }
.support-welcome__sub { font-size: 13px; line-height: 1.6; }

/* --- Offline state --- */
.support-offline-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    gap: 14px;
    flex: 1;
}
.support-offline-state__icon { font-size: 44px; }
.support-offline-state__title { font-size: 16px; font-weight: 700; color: #f1f5f9; }
.support-offline-state__sub { font-size: 13px; color: #64748b; line-height: 1.7; }
.support-offline-state__hours {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 20px;
    width: 100%;
}
.support-offline-state__hours-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
}
.support-offline-state__hours-row span:first-child { color: #64748b; }
.support-offline-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}
.support-offline-btn:hover { background: rgba(59, 130, 246, 0.22); border-color: #3b82f6; color: #93c5fd; }

/* --- Input area --- */
.support-input-area {
    flex-shrink: 0;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.2);
}
.support-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.support-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f1f5f9;
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    padding: 10px 14px;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.15s;
}
.support-textarea::placeholder { color: #475569; }
.support-textarea:focus { border-color: rgba(139, 92, 246, 0.5); }
.support-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}
.support-send-btn:hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed); transform: translateY(-1px); }
.support-send-btn:active { transform: translateY(0); }
.support-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Typing indicator */
.support-typing {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #475569;
    padding: 0 0 8px;
}
.support-typing.visible { display: flex; }
.support-typing-dots { display: flex; gap: 3px; }
.support-typing-dot {
    width: 4px; height: 4px; border-radius: 50%; background: #64748b;
    animation: typing-bounce 1.2s ease-in-out infinite;
}
.support-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.support-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Trial/non-paid users see a prompt instead of chat */
.support-upgrade-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    gap: 14px;
    flex: 1;
}
.support-upgrade-prompt__icon { font-size: 40px; }
.support-upgrade-prompt__title { font-size: 15px; font-weight: 700; color: #f1f5f9; }
.support-upgrade-prompt__sub { font-size: 13px; color: #64748b; line-height: 1.7; }



/* Global size constraint for Lucide SVGs */
svg.lucide {
    width: 0.9em;
    height: 0.9em;
    vertical-align: text-bottom;
}

/* =============================================================================
   Mobile Responsive — Tenant UI (≤768px)
   ============================================================================= */
@media (max-width: 768px) {

    /* ── Layout ── */
    /* Hide desktop sidebar; mobile nav bar is injected by sidebar.js */
    .sidebar { display: none !important; }
    .layout  { display: block; }
    .main    { width: 100%; min-width: 0; }

    /* Hide old floating hamburger toggle (replaced by sticky top nav) */
    .mobile-nav-toggle  { display: none !important; }
    .sidebar-overlay    { display: none !important; }

    /* Ensure page content clears the 56px fixed top nav */
    body { padding-top: 56px; }

    /* app-container padding adjustments */
    .app-container { padding: var(--space-md); }

    /* ── App header (index / pipeline / tasks / deadlines / etc.) ── */
    /* Hide the full header block — title, subtitle, refresh, logout */
    .app-header { display: none !important; }

    /* ── Tenant Switcher ("Viewing:" section) ── */
    .tenant-switcher { display: none !important; }

    /* ── KPI stats grid (Total Opps, High Priority, Medium Priority, Avg Score) ── */
    .stats-grid { display: none !important; }

    /* ── Reduce top padding on section header so Top Opportunities is near the top ── */
    .section-header { margin-top: 4px; }

    /* ── View headers (tasks / deadlines / kanban) ── */
    .view-header { padding-bottom: 12px; }

    /* ── Kanban board: horizontal scroll on mobile ── */
    .kanban-board {
        grid-template-columns: repeat(6, minmax(260px, 1fr));
        overflow-x: auto;
        padding-bottom: var(--space-md);
    }
    .kanban-view { overflow-x: auto; }

    /* ── Opportunity cards in index view ── */
    .opp-card { min-width: 0; overflow: hidden; }

    /* ── Deadline cards ── */
    .deadline-card { flex-wrap: wrap; }
    .deadline-countdown { min-width: 60px; }

    /* ── Modals: full-screen on mobile ── */
    .modal__box {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .modal {
        padding: 0 !important;
        align-items: flex-start !important;
    }
}
