/* ============================================================
   BidEdge — CATMEX Landscaping Design System
   Extracted from base.html inline styles
   ============================================================ */

:root {
    --cm-forest: #1c2b33;
    --cm-green: #0aa2ba;
    --cm-sage: #5cbfcf;
    --cm-mint: #e0f5f9;
    --cm-cream: #f7f5f0;
    --cm-tiffany: #0aa2ba;
    --cm-tiffany-light: #e0f5f9;
    --cm-tiffany-glow: rgba(10,162,186,0.12);
    --cm-earth: #6b7b86;
    --cm-bark: #3d4f5a;
    --cm-gold: #d4a843;
    --cm-terracotta: #d46a4b;
    --cm-success: #2eaa6e;
    --cm-reviewing: #7c3aed;
    --cm-slate: #94a3b8;
    --cm-slate-dark: #475569;
    --cm-text: #1e2a30;
    --cm-muted: #6b7f8a;
    --cm-openai: #10a37f;
    --cm-success-light: #e0f5e9;
    --cm-danger-light: #fee2e2;
    --cm-ring-track: #e9ecef;
}

body { font-family: 'Inter', -apple-system, sans-serif; background: var(--cm-cream); color: var(--cm-text); font-size: 0.9rem; overflow-x: hidden; }
html { overflow-x: hidden; }

/* ── Navbar ── */
.navbar { background: linear-gradient(135deg, #1c2b33 0%, #263d4a 100%) !important; border-bottom: 3px solid var(--cm-tiffany); padding: 0.6rem 0; box-shadow: 0 2px 16px rgba(0,0,0,0.15); }
.navbar-brand { font-weight: 800; letter-spacing: -0.5px; font-size: 1.15rem; }
.navbar-brand .sub { font-size: 0.5rem; color: var(--cm-tiffany); letter-spacing: 1.5px; display: block; line-height: 1; margin-top: 2px; opacity: 0.8; }
.nav-link { font-weight: 500; font-size: 0.82rem; color: rgba(255,255,255,0.65) !important; transition: all 0.25s ease; padding: 8px 12px !important; border-radius: 6px; }
.nav-link:hover { color: #fff !important; background: rgba(10,162,186,0.15); }
.nav-link i { font-size: 0.88rem; }

/* ── Cards ── */
.card { border: none; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); transition: box-shadow 0.25s ease, transform 0.2s ease; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.card-header { background: #fff; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.85rem; font-weight: 600; border-radius: 12px 12px 0 0 !important; }

/* ── Stat cards ── */
.stat-card { border-left: 4px solid var(--cm-tiffany); background: #fff; transition: transform 0.2s ease; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--cm-forest); }
.stat-card .stat-label { color: var(--cm-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }

/* ── Badges ── */
.badge { font-weight: 600; font-size: 0.7rem; letter-spacing: 0.3px; transition: transform 0.15s; }
.badge:hover { transform: scale(1.05); }
.badge-draft { background: var(--cm-slate); }
.badge-submitted { background: var(--cm-tiffany); }
.badge-won { background: var(--cm-success); }
.badge-lost { background: var(--cm-terracotta); }
.badge-completed { background: #1c7a8a; }
.badge-open { background: var(--cm-tiffany); }
.badge-reviewing { background: var(--cm-reviewing); }
.badge-bidding { background: var(--cm-gold); color: #fff; }
.badge-passed { background: var(--cm-slate); }
.badge-closed { background: var(--cm-slate-dark); }
.badge-awarded { background: var(--cm-success); }

/* Audit status badges */
.badge-audit-pass { background: var(--cm-sage); color: #fff; }
.badge-audit-warning { background: var(--cm-gold); color: #fff; }
.badge-audit-fail { background: var(--cm-terracotta); color: #fff; }
.badge-audit-pending { background: var(--cm-muted); color: #fff; }

/* ── Utility: compact inputs ── */
.input-compact { width: 70px; min-width: 60px; }
.input-compact-group { width: 110px; min-width: 90px; }
@media (max-width: 768px) {
    .input-compact, .input-compact-group { width: 100%; min-width: unset; }
}

/* ── Utility: loading button ── */
.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading .spinner-border { width: 1em; height: 1em; border-width: 0.15em; vertical-align: middle; }

/* ── Utility: comparison values ── */
.comparison-value { font-size: 2rem; font-weight: 800; line-height: 1.2; }
@media (max-width: 768px) { .comparison-value { font-size: 1.5rem; } }

/* ── Buttons ── */
.btn { font-weight: 600; font-size: 0.85rem; border-radius: 8px; transition: all 0.25s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.btn:active { transform: translateY(0); }
.btn-success { background: var(--cm-tiffany); border-color: var(--cm-tiffany); }
.btn-success:hover { background: #088fa5; border-color: #088fa5; }
.btn-outline-success { color: var(--cm-tiffany); border-color: var(--cm-tiffany); }
.btn-outline-success:hover { background: var(--cm-tiffany); color: #fff; }
.btn-primary { background: var(--cm-tiffany); border-color: var(--cm-tiffany); }
.btn-primary:hover { background: #088fa5; border-color: #088fa5; }
.btn-outline-primary { color: var(--cm-tiffany); border-color: var(--cm-tiffany); }
.btn-outline-primary:hover { background: var(--cm-tiffany); color: #fff; }

/* ── Tables ── */
.table th { font-size: 0.72rem; text-transform: uppercase; color: var(--cm-muted); letter-spacing: 0.5px; font-weight: 600; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.table tbody tr { transition: background 0.15s ease; }
.table-hover tbody tr:hover { background: var(--cm-tiffany-glow); }

/* ── Opportunity cards ── */
.opp-card { border-left: 4px solid var(--cm-tiffany); transition: all 0.25s ease; }
.opp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(10,162,186,0.12); border-left-color: var(--cm-green); }
.opp-card.interested { border-left-color: var(--cm-green); }
.opp-card.maybe { border-left-color: var(--cm-gold); }
.opp-card.pass { border-left-color: var(--cm-slate); }
.due-soon { color: var(--cm-terracotta); font-weight: 700; animation: pulse 2s ease-in-out infinite; }
.due-ok { color: var(--cm-green); font-weight: 600; }

/* ── Misc ── */
.suggestion-box { background: linear-gradient(135deg, var(--cm-tiffany-light), var(--cm-mint)); border-radius: 12px; padding: 1.5rem; }
.market-indicator { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.market-indicator.below { background: #fef3c7; color: #92400e; }
.market-indicator.competitive { background: var(--cm-tiffany-light); color: #066c7d; }
.market-indicator.above { background: #fee2e2; color: #991b1b; }

.pw-badge { background: #ede9fe; color: #5b21b6; font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }
.sf-badge { background: var(--cm-tiffany-light); color: #066c7d; font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }

.alert { border-radius: 10px; font-size: 0.85rem; border: none; animation: slideDown 0.3s ease; }
.form-control, .form-select { border-radius: 8px; border-color: #d1d5db; font-size: 0.88rem; transition: border-color 0.2s, box-shadow 0.2s; }
.form-control:focus, .form-select:focus { border-color: var(--cm-tiffany); box-shadow: 0 0 0 3px var(--cm-tiffany-glow); }
.form-label { font-weight: 600; font-size: 0.82rem; color: var(--cm-muted); }

/* ── Role indicator ── */
.role-pill { font-size: 0.6rem; padding: 2px 8px; border-radius: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.role-admin { background: var(--cm-terracotta); color: #fff; }
.role-member { background: var(--cm-tiffany); color: #fff; }

/* ── Links ── */
a { transition: color 0.2s ease; }
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.list-group-item):not(.dropdown-item) { color: var(--cm-tiffany); }
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.list-group-item):not(.dropdown-item):hover { color: #088fa5; }

/* ── Animations ── */
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes progressGrow { from { width: 0; } }
@keyframes countPulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes strokeDraw { from { stroke-dasharray: 0, 100; } }

.container-fluid > .row, .container-fluid > .card, .container-fluid > .d-flex,
.container-fluid > h2, .container-fluid > .alert { animation: fadeIn 0.4s ease; }

/* ── Staggered card entrance ── */
.stagger-in { animation: fadeInUp 0.5s ease both; }
.stagger-in:nth-child(1) { animation-delay: 0s; }
.stagger-in:nth-child(2) { animation-delay: 0.08s; }
.stagger-in:nth-child(3) { animation-delay: 0.16s; }
.stagger-in:nth-child(4) { animation-delay: 0.24s; }
.stagger-in:nth-child(5) { animation-delay: 0.32s; }
.stagger-in:nth-child(6) { animation-delay: 0.40s; }

/* ── Progress bar animation ── */
.progress-bar { animation: progressGrow 0.8s ease both; animation-delay: 0.3s; }

/* ── SVG circle stroke animation ── */
.anim-circle { animation: strokeDraw 1s ease both; animation-delay: 0.4s; }

/* ── Stat value entrance ── */
.stat-card { animation: scaleIn 0.4s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

/* ── Card section slide-in ── */
.slide-in-left { animation: slideInLeft 0.5s ease both; }
.slide-in-left:nth-child(2) { animation-delay: 0.1s; }

/* ── Table row fade ── */
.table-hover tbody tr { animation: fadeIn 0.3s ease both; }
.table-hover tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table-hover tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table-hover tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table-hover tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table-hover tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* ── Reduce motion for accessibility ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cm-cream); }
::-webkit-scrollbar-thumb { background: var(--cm-sage); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cm-tiffany); }

/* ── Selection ── */
::selection { background: var(--cm-tiffany-light); color: var(--cm-forest); }

/* ── Print ── */
@media print {
    .navbar, .btn, .alert, form, .no-print { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    body { background: #fff !important; font-size: 11pt; }
    .container-fluid { padding: 0 !important; }
    a { color: #333 !important; text-decoration: none !important; }
    .stat-card { border-left-color: #333 !important; }
}

/* ── Custom Tooltips ── */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
    background: var(--cm-forest); color: #fff; padding: 6px 12px; border-radius: 8px;
    font-size: 0.72rem; font-weight: 500; white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); letter-spacing: 0.2px;
}
[data-tip]::before {
    content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--cm-forest);
    opacity: 0; transition: opacity 0.2s ease; z-index: 1000; pointer-events: none;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-tip]:hover::before { opacity: 1; }
.navbar [data-tip]::after { bottom: auto; top: calc(100% + 8px); transform: translateX(-50%) translateY(-4px); }
.navbar [data-tip]::before { bottom: auto; top: calc(100% + 2px); border-top-color: transparent; border-bottom-color: var(--cm-forest); }
.navbar [data-tip]:hover::after { transform: translateX(-50%) translateY(0); }

/* ── Mobile ── */
@media (max-width: 991px) {
    .navbar-collapse { max-height: 80vh; overflow-y: auto; padding: 10px 0; }
    .navbar-nav { gap: 2px; }
    .nav-link { padding: 10px 14px !important; border-radius: 8px; }
    .nav-link:hover { background: rgba(10,162,186,0.15); }
    .navbar-nav .nav-item .nav-link i { margin-right: 6px; width: 20px; text-align: center; }
    .nav-icon-label { display: inline !important; }
    .navbar-nav .dropdown-menu { border: none; background: rgba(255,255,255,0.05); margin: 0; padding: 4px 0; }
}
@media (min-width: 992px) {
    .nav-icon-label { display: none !important; }
}
@media (max-width: 768px) {
    .container-fluid { padding-left: 12px !important; padding-right: 12px !important; }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card .stat-label { font-size: 0.65rem; }
    h2 { font-size: 1.3rem; }
    .opp-card .row { gap: 8px; }
    .opp-card .col-lg-5, .opp-card .col-lg-2, .opp-card .col-lg-1 { text-align: left !important; }
    [data-tip]::after, [data-tip]::before { display: none; }
    .navbar-brand { font-size: 1rem; }
    .btn { font-size: 0.8rem; padding: 6px 14px; }
    .btn-sm { font-size: 0.72rem; padding: 4px 10px; }
    .card-body { padding: 14px; }
    .table { font-size: 0.82rem; overflow-x: auto; display: block; }
    .navbar form input { width: 100% !important; }
    .navbar form { width: 100%; margin: 6px 0; }
}
@media (max-width: 480px) {
    .stat-card .stat-value { font-size: 1rem; }
    .hero-stats { gap: 16px; }
    .d-flex.gap-2 { gap: 4px !important; }
}
/* ── Portrait phone fix ── */
@media (max-width: 430px) {
    .container-fluid { padding-left: 8px !important; padding-right: 8px !important; }
    .card-body { padding: 10px; }
    .table-responsive, .card { overflow-x: auto; max-width: 100vw; }
    .btn-group { flex-wrap: wrap; }
    .btn-group .btn { font-size: 0.72rem; padding: 5px 10px; }
    .btn-group .dropdown-toggle-split { padding: 5px 8px; }
    .stat-card .stat-value { font-size: 0.9rem; }
    .stat-card .stat-label { font-size: 0.6rem; }
    h2 { font-size: 1.1rem; }
    .suggestion-box { padding: 1rem; }
    .chart-section-body { padding: 10px; }
    .chart-section-body canvas { max-height: 220px; }
    .sim-slider-group label { font-size: 0.7rem; }
    .sim-result { font-size: 1.1rem; }
    .nav-pills .nav-link { font-size: 0.78rem; padding: 6px 12px; }
    .chart-guidance { padding: 8px 12px; font-size: 0.75rem; }
    #cad-container { height: 350px; }
    .opp-card .card-body { padding: 10px; }
    .dropdown-menu { font-size: 0.78rem; }
}

/* ── Breadcrumb ── */
.breadcrumb { background: none; padding: 0; margin: 0; }
.breadcrumb-item a { color: var(--cm-tiffany); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { color: #088fa5; }
.breadcrumb-item.active { color: var(--cm-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--cm-slate); }

/* ── Modal polish ── */
.modal-content { border: none; border-radius: 12px; }
.modal-header { border-radius: 12px 12px 0 0; }

/* ── List group in dark mode ── */
.list-group-item-action:hover { background: var(--cm-tiffany-glow); }

/* ── Table footer styling ── */
.table tfoot td { border-bottom: none; padding-top: 8px; padding-bottom: 8px; }

/* ── Dark Mode ── */
[data-bs-theme="dark"] {
    --cm-cream: #1a1f25;
    --cm-mint: #1c2b33;
    --cm-text: #e0e8ec;
    --cm-muted: #9db0bc;
    --cm-forest: #c8dce6;
    --cm-forest-bg: #0d1b22;
    --cm-bark: #b0bec5;
    --cm-card-bg: #1e2830;
    --cm-card-border: #2a3a44;
    --cm-input-bg: #232e36;
    --cm-input-border: #3a4d58;
    --cm-hover-bg: rgba(10,162,186,0.1);
    --cm-tiffany-light: rgba(10,162,186,0.15);
    --cm-tiffany-glow: rgba(10,162,186,0.12);
    --cm-openai: #10a37f;
    --cm-success-light: rgba(46,170,110,0.15);
    --cm-danger-light: rgba(212,106,75,0.15);
    --cm-ring-track: #2a3a44;
}
[data-bs-theme="dark"] body { background: var(--cm-cream); color: var(--cm-text); }
[data-bs-theme="dark"] .navbar { background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important; }
[data-bs-theme="dark"] .small, [data-bs-theme="dark"] small { color: var(--cm-muted); }

/* Cards */
[data-bs-theme="dark"] .card { background: var(--cm-card-bg); border: 1px solid var(--cm-card-border); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
[data-bs-theme="dark"] .card-header { background: #243038; border-bottom-color: var(--cm-card-border); color: var(--cm-text); }

/* Stat cards — readable text */
[data-bs-theme="dark"] .stat-card { background: var(--cm-card-bg); border-left-color: var(--cm-tiffany); }
[data-bs-theme="dark"] .stat-card .stat-value { color: var(--cm-forest); }
[data-bs-theme="dark"] .stat-card .stat-label { color: var(--cm-muted); }

/* Suggestion box */
[data-bs-theme="dark"] .suggestion-box { background: linear-gradient(135deg, rgba(10,15,20,0.88) 0%, rgba(8,12,16,0.92) 100%); border: 1px solid rgba(10,162,186,0.08); }

/* Form inputs — proper dark borders/backgrounds */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: var(--cm-input-bg);
    border-color: var(--cm-input-border);
    color: var(--cm-text);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: var(--cm-input-bg);
    border-color: var(--cm-tiffany);
    color: var(--cm-text);
    box-shadow: 0 0 0 3px rgba(10,162,186,0.2);
}
[data-bs-theme="dark"] .form-control::placeholder { color: #5a7080; }
[data-bs-theme="dark"] .form-label { color: var(--cm-muted); }
[data-bs-theme="dark"] .form-check-input { background-color: var(--cm-input-bg); border-color: var(--cm-input-border); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--cm-tiffany); border-color: var(--cm-tiffany); }

/* Tables — alternating dark rows */
[data-bs-theme="dark"] .table { color: var(--cm-text); }
[data-bs-theme="dark"] .table th { color: var(--cm-muted); border-bottom-color: var(--cm-card-border); }
[data-bs-theme="dark"] .table td { border-bottom-color: var(--cm-card-border); }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: rgba(10,162,186,0.04); color: var(--cm-text); }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > * { --bs-table-bg-type: rgba(0,0,0,0.08); color: var(--cm-text); }
[data-bs-theme="dark"] .table tbody tr:nth-of-type(odd) { background: rgba(10,162,186,0.04); }
[data-bs-theme="dark"] .table tbody tr:nth-of-type(even) { background: rgba(0,0,0,0.08); }
[data-bs-theme="dark"] .table-hover tbody tr:hover { background: var(--cm-hover-bg); }

/* Opportunity cards */
[data-bs-theme="dark"] .opp-card { background: var(--cm-card-bg); }
[data-bs-theme="dark"] .opp-card:hover { box-shadow: 0 6px 20px rgba(10,162,186,0.15); }

/* Background utilities */
[data-bs-theme="dark"] .bg-light { background: var(--cm-card-bg) !important; }
[data-bs-theme="dark"] .bg-white { background: var(--cm-card-bg) !important; }

/* Dropdown menus — dark backgrounds */
[data-bs-theme="dark"] .dropdown-menu { background: var(--cm-card-bg); border: 1px solid var(--cm-card-border); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
[data-bs-theme="dark"] .dropdown-item { color: var(--cm-text); }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus { background: rgba(10,162,186,0.12); color: #3dc8db; }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--cm-card-border); }

/* Alerts */
[data-bs-theme="dark"] .alert { background: var(--cm-card-bg); color: var(--cm-text); border: 1px solid var(--cm-card-border); }
[data-bs-theme="dark"] .alert-success { background: rgba(46,170,110,0.15); border-color: rgba(46,170,110,0.3); color: #5fe0a0; }
[data-bs-theme="dark"] .alert-danger { background: rgba(212,106,75,0.15); border-color: rgba(212,106,75,0.3); color: #f0a090; }
[data-bs-theme="dark"] .alert-warning { background: rgba(212,168,67,0.15); border-color: rgba(212,168,67,0.3); color: #e8c870; }
[data-bs-theme="dark"] .alert-info { background: rgba(10,162,186,0.15); border-color: rgba(10,162,186,0.3); color: #3dc8db; }

/* Text utilities */
[data-bs-theme="dark"] .text-muted { color: var(--cm-muted) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--cm-text) !important; }
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 { color: var(--cm-text); }

/* Links — tiffany pops in dark mode */
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.list-group-item):not(.dropdown-item) { color: #3dc8db; }
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.list-group-item):not(.dropdown-item):hover { color: #5ed8e8; }

/* Badges — visible contrast in dark mode */
[data-bs-theme="dark"] .badge-draft { background: #3d5060; color: #c0d0dc; }
[data-bs-theme="dark"] .badge-submitted { background: rgba(10,162,186,0.25); color: #3dc8db; }
[data-bs-theme="dark"] .badge-won { background: rgba(46,170,110,0.25); color: #5fe0a0; }
[data-bs-theme="dark"] .badge-lost { background: rgba(212,106,75,0.25); color: #f0a090; }
[data-bs-theme="dark"] .badge-completed { background: rgba(28,122,138,0.3); color: #4dd0e0; }
[data-bs-theme="dark"] .badge-open { background: rgba(10,162,186,0.25); color: #3dc8db; }
[data-bs-theme="dark"] .badge-reviewing { background: rgba(124,58,237,0.25); color: #a78bfa; }
[data-bs-theme="dark"] .badge-bidding { background: rgba(212,168,67,0.25); color: #e8c870; }
[data-bs-theme="dark"] .badge-passed { background: #3d5060; color: #c0d0dc; }
[data-bs-theme="dark"] .badge-closed { background: #2a3a44; color: #90a0ac; }
[data-bs-theme="dark"] .badge-awarded { background: rgba(46,170,110,0.25); color: #5fe0a0; }
[data-bs-theme="dark"] .sf-badge { background: rgba(10,162,186,0.2); color: #3dc8db; }
[data-bs-theme="dark"] .pw-badge { background: rgba(124,58,237,0.2); color: #a78bfa; }

/* Audit badges dark mode */
[data-bs-theme="dark"] .badge-audit-pass { background: rgba(92,191,207,0.25); color: #7dd8e8; }
[data-bs-theme="dark"] .badge-audit-warning { background: rgba(212,168,67,0.25); color: #e8c870; }
[data-bs-theme="dark"] .badge-audit-fail { background: rgba(212,106,75,0.25); color: #f0a090; }
[data-bs-theme="dark"] .badge-audit-pending { background: #3d5060; color: #c0d0dc; }

/* Market indicators */
[data-bs-theme="dark"] .market-indicator.below { background: rgba(212,168,67,0.15); color: #e8c870; }
[data-bs-theme="dark"] .market-indicator.competitive { background: rgba(10,162,186,0.15); color: #3dc8db; }
[data-bs-theme="dark"] .market-indicator.above { background: rgba(212,106,75,0.15); color: #f0a090; }

/* Modals */
[data-bs-theme="dark"] .modal-content { background: var(--cm-card-bg); border: 1px solid var(--cm-card-border); }
[data-bs-theme="dark"] .modal-header { border-bottom-color: var(--cm-card-border); color: var(--cm-text); }
[data-bs-theme="dark"] .modal-footer { border-top-color: var(--cm-card-border); }

/* List groups */
[data-bs-theme="dark"] .list-group-item { background: var(--cm-card-bg); border-color: var(--cm-card-border); color: var(--cm-text); }
[data-bs-theme="dark"] .list-group-item-action:hover { background: var(--cm-hover-bg); }

/* Breadcrumbs */
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--cm-muted); }
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #5a7080; }

/* Code */
[data-bs-theme="dark"] code { background: rgba(10,162,186,0.15); color: #3dc8db; }
[data-bs-theme="dark"] pre { background: #0d1b22; border: 1px solid var(--cm-card-border); }

/* Scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: var(--cm-cream); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a4d58; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--cm-tiffany); }

/* Selection */
[data-bs-theme="dark"] ::selection { background: rgba(10,162,186,0.3); color: #fff; }

/* Buttons in dark mode */
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--cm-muted); border-color: var(--cm-input-border); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: var(--cm-input-bg); color: var(--cm-text); }
[data-bs-theme="dark"] .btn-light { background: var(--cm-card-bg); border-color: var(--cm-card-border); color: var(--cm-text); }
[data-bs-theme="dark"] .btn-light:hover { background: #2a3a44; }

/* Tooltips */
[data-bs-theme="dark"] [data-tip]::after { background: #0d1117; color: #e0e8ec; }
[data-bs-theme="dark"] [data-tip]::before { border-top-color: #0d1117; }
[data-bs-theme="dark"] .navbar [data-tip]::before { border-top-color: transparent; border-bottom-color: #0d1117; }

/* AI Chat widget mobile */
@media (max-width: 480px) {
    #ai-chat-panel { width: calc(100vw - 32px) !important; right: 16px !important; left: 16px !important; }
    #ai-chat-btn { right: 16px !important; bottom: 16px !important; }
}

/* AI Chat widget dark mode */
[data-bs-theme="dark"] #ai-chat-panel { background: var(--cm-card-bg) !important; border: 1px solid var(--cm-card-border); }
[data-bs-theme="dark"] #ai-chat-panel > div:last-child { border-top-color: var(--cm-card-border) !important; }
[data-bs-theme="dark"] #ai-chat-input { background: var(--cm-input-bg) !important; border-color: var(--cm-input-border) !important; color: var(--cm-text) !important; }
[data-bs-theme="dark"] #ai-chat-input::placeholder { color: #5a7080; }
[data-bs-theme="dark"] #ai-chat-msgs { color: var(--cm-text); }
[data-bs-theme="dark"] #ai-chat-msgs > div:not([style*="margin-left"]) { background: var(--cm-mint) !important; color: var(--cm-text) !important; }

/* Pagination dark mode */
[data-bs-theme="dark"] .page-link { background: var(--cm-card-bg); border-color: var(--cm-card-border); color: var(--cm-text); }
[data-bs-theme="dark"] .page-link:hover { background: var(--cm-hover-bg); color: #3dc8db; }
[data-bs-theme="dark"] .page-item.active .page-link { background: var(--cm-tiffany); border-color: var(--cm-tiffany); }
[data-bs-theme="dark"] .page-item.disabled .page-link { background: var(--cm-input-bg); color: #5a7080; }

/* Accordion dark mode */
[data-bs-theme="dark"] .accordion-item { background: var(--cm-card-bg); border-color: var(--cm-card-border); }
[data-bs-theme="dark"] .accordion-button { background: var(--cm-card-bg); color: var(--cm-text); }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background: rgba(10,162,186,0.08); color: #3dc8db; }
[data-bs-theme="dark"] .accordion-body { background: var(--cm-card-bg); }

/* Nav tabs/pills dark mode */
[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--cm-muted); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background: var(--cm-card-bg); border-color: var(--cm-card-border); color: var(--cm-text); }
[data-bs-theme="dark"] .nav-pills .nav-link.active { background: var(--cm-tiffany); }

/* Footer dark mode */
[data-bs-theme="dark"] .catmex-footer { background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important; border-top-color: var(--cm-tiffany) !important; }

/* ── Chart Sections (Analytics) ── */
.chart-section { background: var(--cm-card-bg, #fff); border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); overflow: hidden; }
.chart-section-header { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.chart-section-header h6 { margin: 0; font-weight: 700; font-size: 0.88rem; }
.chart-section-body { padding: 14px 18px; }
.chart-section.collapsed .chart-section-body { display: none; }
.chart-section.collapsed .collapse-icon { transform: rotate(180deg); }
.collapse-icon { transition: transform 0.2s ease; color: var(--cm-muted); }

.chart-guidance { border-left: 3px solid var(--cm-tiffany); padding: 10px 14px; background: var(--cm-tiffany-glow); border-radius: 0 8px 8px 0; font-size: 0.82rem; }
.guidance-title { font-weight: 700; font-size: 0.78rem; color: var(--cm-forest); margin-bottom: 4px; }
.guidance-text { color: var(--cm-muted); font-size: 0.78rem; line-height: 1.5; }

.sim-slider-group { font-size: 0.82rem; }
.sim-slider-group label { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 600; color: var(--cm-text); }
.sim-slider-group input[type="range"] { width: 100%; accent-color: var(--cm-tiffany); }
.sim-result { font-size: 1.4rem; font-weight: 800; }
.sim-result.positive { color: var(--cm-success); }
.sim-result.negative { color: var(--cm-terracotta); }

[data-bs-theme="dark"] .chart-section { background: var(--cm-card-bg); border: 1px solid var(--cm-card-border); }
[data-bs-theme="dark"] .chart-guidance { background: rgba(10,162,186,0.08); }
[data-bs-theme="dark"] .guidance-title { color: var(--cm-forest); }

/* Print override */
@media print { [data-bs-theme="dark"] { --cm-cream: #fff; } [data-bs-theme="dark"] body { background: #fff !important; color: #000 !important; } }
