/* FreightDeck Rates — Dark Theme */
:root {
    --bg: #0d0d0d;
    --surface: #141414;
    --surface2: #1a1a1a;
    --surface3: #222;
    --border: #2a2a2a;
    --border-light: #333;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --blue: #3b82f6;
    --blue-dim: rgba(59,130,246,0.15);
    --green: #22c55e;
    --green-dim: rgba(34,197,94,0.15);
    --amber: #f59e0b;
    --amber-dim: rgba(245,158,11,0.15);
    --purple: #a78bfa;
    --purple-dim: rgba(167,139,250,0.15);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* App Shell */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 20px 16px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); }
.logo-icon { font-size: 20px; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; background: none; color: var(--text-muted); font-size: 13px; font-weight: 500; border-radius: 6px; cursor: pointer; text-align: left; width: 100%; transition: all 0.15s; }
.nav-btn:hover { background: var(--surface3); color: var(--text); }
.nav-btn.active { background: var(--blue-dim); color: var(--blue); }
.sidebar-user { padding: 12px; border-top: 1px solid var(--border); }
.user-email { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; width: 100%; }
.logout-btn:hover { border-color: var(--red); color: var(--red); }
.login-btn { background: var(--blue); color: #fff; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; width: 100%; }
.demo-btn { background: none; border: 1px solid var(--blue); color: var(--blue); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 500; width: 100%; margin-top: 6px; transition: all 0.15s; }
.demo-btn:hover { background: var(--blue-dim); }

/* Main Content */
.main-content { margin-left: 220px; flex: 1; padding: 24px 32px; min-height: 100vh; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Page Header */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Auth Overlay */
.auth-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.auth-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 360px; }
.auth-logo { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.auth-form h3 { font-size: 15px; margin-bottom: 16px; text-align: center; }
.auth-form input { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; margin-bottom: 8px; outline: none; }
.auth-form input:focus { border-color: var(--blue); }
.auth-form button { width: 100%; padding: 10px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.auth-switch a { color: var(--blue); text-decoration: none; }
.auth-error { color: var(--red); font-size: 12px; text-align: center; margin-top: 8px; min-height: 16px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 11px; color: var(--text-dim); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-demo-btn { width: 100%; padding: 10px; background: var(--surface); border: 1px solid var(--blue); color: var(--blue); border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.auth-demo-btn:hover { background: var(--blue-dim); }

/* Rate Check Layout */
.ratecheck-main-layout { display: grid; grid-template-columns: 0.85fr 1fr; gap: 20px; margin-bottom: 20px; }
.ratecheck-form-panel { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.ratecheck-map-panel { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-height: 320px; position: relative; }
.form-section { margin-bottom: 14px; }
.form-section label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-section input, .form-section select { width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; outline: none; }
.form-section input:focus, .form-section select:focus { border-color: var(--blue); }
.lane-row { display: flex; gap: 8px; align-items: flex-end; }
.lane-field { flex: 1; position: relative; }
.lane-swap { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-dim); font-size: 16px; margin-bottom: 2px; border-radius: 4px; }
.lane-swap:hover { background: var(--surface3); color: var(--blue); }
.form-row-inline { display: flex; gap: 12px; }
.form-field { flex: 1; }
.form-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-field input { width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; outline: none; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.btn-get-rate { flex: 1; padding: 10px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-get-rate:disabled { opacity: 0.6; }
.btn-clear { padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; font-size: 13px; cursor: pointer; }

/* Autocomplete */
.autocomplete-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; z-index: 50; display: none; max-height: 200px; overflow-y: auto; }
.autocomplete-dropdown.show { display: block; }
.autocomplete-item { padding: 8px 12px; font-size: 12px; cursor: pointer; color: var(--text-muted); }
.autocomplete-item:hover { background: var(--blue-dim); color: var(--text); }

/* Map */
.map-container { height: 100%; min-height: 320px; position: relative; }
.map-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); font-size: 12px; background: linear-gradient(135deg, var(--surface2) 0%, var(--surface) 100%); }
.map-container.has-route .map-placeholder { display: none; }
.map-miles-badge { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.8); color: var(--blue); padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; z-index: 10; border: 1px solid var(--border); }

/* Rate Result Cards */
.ratecheck-results-section { margin-top: 20px; }
.rates-row-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rates-card { background: linear-gradient(135deg, #1e1e1e 0%, var(--surface2) 100%); border: 1px solid var(--border-light); border-radius: 10px; padding: 16px; transition: transform 0.15s, box-shadow 0.15s; }
.rates-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.rates-card.compact { padding: 14px; }
.rates-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rates-header h4 { font-size: 13px; font-weight: 700; color: var(--text); }
.rates-source { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.beta-tag { font-size: 9px; padding: 2px 6px; border-radius: 3px; background: var(--purple-dim); color: var(--purple); font-weight: 600; letter-spacing: 0.5px; }

/* Rate Confidence */
.rates-confidence { margin-bottom: 8px; }
.conf-value { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.conf-value.high { background: var(--green-dim); color: var(--green); }
.conf-value.medium { background: var(--amber-dim); color: var(--amber); }
.conf-value.low { background: var(--red-dim); color: var(--red); }

/* Rate Rows */
.rate-range { display: flex; flex-direction: column; gap: 4px; }
.rate-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 6px; border: 1px solid transparent; }
.rate-row.rate-low { background: var(--green-dim); border-color: rgba(34,197,94,0.2); }
.rate-row.rate-avg { background: var(--blue-dim); border-color: rgba(59,130,246,0.2); }
.rate-row.rate-high { background: var(--amber-dim); border-color: rgba(245,158,11,0.2); }
.rate-label { font-size: 11px; font-weight: 600; color: var(--text-muted); width: 50px; }
.rate-value { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; text-align: center; }
.rate-per-mile { font-size: 11px; color: var(--text-dim); width: 70px; text-align: right; }
.rate-row.rate-low .rate-value { color: var(--green); }
.rate-row.rate-avg .rate-value { color: var(--blue); }
.rate-row.rate-high .rate-value { color: var(--amber); }

/* FD Rate Card */
.fd-confidence-row { margin-bottom: 8px; }
.fd-rate-section { padding: 6px 0; }
.fd-rate-label { font-size: 10px; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.fd-rate-row { display: flex; gap: 12px; }
.fd-rate-col { flex: 1; text-align: center; }
.fd-rate-sublabel { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.fd-rate-value { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
.fd-rate-pm { display: block; font-size: 11px; color: var(--text-dim); }
.fd-margin { color: var(--green) !important; font-size: 14px !important; }
.ai-reasoning { font-size: 11px; color: var(--text-dim); padding: 8px 0; line-height: 1.5; border-top: 1px solid var(--border); margin-top: 8px; }

/* Quote Builder */
.quote-builder { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; }
.quote-builder-inputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.quote-input-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quote-input-row label { font-size: 12px; color: var(--text-muted); min-width: 90px; }
.input-with-unit { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex: 1; }
.unit-prefix, .unit-suffix { padding: 0 8px; font-size: 12px; color: var(--text-dim); }
.input-with-unit input { border: none; background: transparent; color: var(--text); padding: 8px; font-size: 13px; width: 100%; outline: none; }
.quote-result { border-top: 1px solid var(--border); padding-top: 10px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.quote-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.quote-divider { height: 1px; background: var(--border); margin: 4px 0; }
.quote-total { font-size: 16px; font-weight: 700; padding-top: 8px; }

/* Card Feedback */
.card-feedback { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.card-feedback-label { font-size: 10px; color: var(--text-dim); margin-right: 4px; }
.card-fb-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 3px 8px; border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.15s; }
.card-fb-btn:hover { border-color: var(--blue); color: var(--blue); }
.card-fb-btn.selected { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* Bottom Actions */
.rate-bottom-actions { margin-top: 16px; display: flex; justify-content: center; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 20px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* ==== My Data Tab ==== */
.upload-zone { border: 2px dashed var(--border-light); border-radius: 10px; padding: 40px; text-align: center; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); background: var(--blue-dim); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone a { color: var(--blue); text-decoration: none; }
.upload-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.upload-history { margin-top: 24px; }
.upload-history h3 { font-size: 14px; margin-bottom: 12px; }
.upload-item { display: flex; align-items: center; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; }
.upload-item-info { flex: 1; font-size: 13px; }
.upload-item-stats { font-size: 11px; color: var(--text-muted); margin-right: 12px; }
.upload-delete { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; }
.upload-delete:hover { color: var(--red); }
.load-browser { margin-top: 24px; }
.load-browser h3 { font-size: 14px; margin-bottom: 12px; }
.load-controls { margin-bottom: 12px; }
.load-controls select { padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; }
.load-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.load-table th { text-align: left; padding: 8px 10px; background: var(--surface); color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.load-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.load-table tr:hover td { background: var(--surface2); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 24px; width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-content h3 { font-size: 16px; margin-bottom: 4px; }
.modal-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.mapping-field { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mapping-field label { width: 120px; font-size: 12px; color: var(--text-muted); }
.mapping-field select { flex: 1; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 12px; }
.mapping-preview { margin-top: 12px; max-height: 160px; overflow-x: auto; }
.mapping-preview table { font-size: 10px; border-collapse: collapse; }
.mapping-preview th, .mapping-preview td { padding: 4px 6px; border: 1px solid var(--border); white-space: nowrap; }
.mapping-preview th { background: var(--surface); color: var(--text-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-secondary { padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-primary { padding: 8px 16px; background: var(--blue); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }

/* ==== Analytics Tab ==== */
.analytics-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.hero-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; position: relative; overflow: hidden; }
.hero-stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.hero-stat.blue::before { background: var(--blue); }
.hero-stat.green::before { background: var(--green); }
.hero-stat.amber::before { background: var(--amber); }
.hero-stat.purple::before { background: var(--purple); }
.hero-value { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.hero-label { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-sub { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* Analytics Sub-tabs */
.analytics-tabs { display: flex; gap: 2px; background: var(--surface); border-radius: 8px; padding: 3px; margin-bottom: 20px; width: fit-content; }
.analytics-tab { padding: 6px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border: none; background: none; transition: all 0.15s; }
.analytics-tab.active { background: var(--blue); color: #fff; }
.analytics-tab:hover:not(.active) { color: var(--text); background: var(--surface3); }

/* Analytics Panels */
.analytics-panel { display: none; }
.analytics-panel.active { display: block; }

/* Analytics Grid */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analytics-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.analytics-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.analytics-card.full-width { grid-column: 1 / -1; }

/* Bar Chart */
.bar-chart-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bar-label { font-size: 11px; color: var(--text-muted); width: 90px; flex-shrink: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 20px; background: var(--surface); border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; min-width: 2px; }
.bar-value { font-size: 11px; color: var(--text-muted); width: 80px; flex-shrink: 0; text-align: left; }
.bar-label.wide { width: 140px; }
.bar-value.wide { width: 120px; }

/* Carrier Table */
.carrier-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.carrier-table th { text-align: left; padding: 8px 10px; background: var(--surface); color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.carrier-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.carrier-table tr:hover td { background: var(--surface3); }
.carrier-table .carrier-rank { color: var(--text-dim); font-weight: 600; width: 30px; }
.carrier-table .carrier-name { color: var(--text); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carrier-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.carrier-pct-bar { width: 60px; height: 6px; background: var(--surface); border-radius: 3px; display: inline-block; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.carrier-pct-fill { height: 100%; border-radius: 3px; background: var(--blue); }

/* Distance Bands */
.distance-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 12px; background: var(--surface); border-radius: 8px; }
.distance-label { font-size: 12px; color: var(--text); width: 130px; font-weight: 500; }
.distance-stats { display: flex; gap: 16px; flex: 1; justify-content: flex-end; }
.distance-stat { text-align: center; }
.distance-stat-value { font-size: 14px; font-weight: 700; color: var(--text); }
.distance-stat-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.3px; }

/* DOW Heatmap */
.dow-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow-cell { text-align: center; padding: 10px 4px; border-radius: 6px; }
.dow-day { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.dow-count { font-size: 16px; font-weight: 700; }
.dow-avg { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* Rate Distribution Histogram */
.histogram { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 0 4px; }
.hist-bar { flex: 1; background: var(--blue); border-radius: 2px 2px 0 0; transition: height 0.5s ease; position: relative; min-width: 8px; cursor: pointer; }
.hist-bar:hover { background: #60a5fa; }
.hist-bar:hover::after { content: attr(data-label); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 10px; color: var(--text); white-space: nowrap; z-index: 10; }
.hist-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-dim); margin-top: 4px; padding: 0 4px; }

/* Weekly Trend */
.trend-bars { display: flex; align-items: flex-end; gap: 2px; height: 80px; }
.trend-bar { flex: 1; border-radius: 2px 2px 0 0; position: relative; cursor: pointer; min-width: 4px; }
.trend-bar:hover::after { content: attr(data-label); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 10px; color: var(--text); white-space: nowrap; z-index: 10; }
.trend-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-dim); margin-top: 4px; }

/* Login Prompt */
.login-prompt { text-align: center; padding: 40px; color: var(--text-muted); }
.login-prompt p { margin-bottom: 12px; font-size: 13px; }

/* Empty State */
.empty-state { text-align: center; padding: 40px; color: var(--text-dim); }

/* Coming Soon */
.coming-soon { text-align: center; padding: 40px 20px; max-width: 500px; margin: 0 auto; }
.coming-soon-icon { font-size: 48px; margin-bottom: 16px; }
.coming-soon h2 { font-size: 20px; margin-bottom: 8px; }
.coming-soon p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.coming-soon-features { list-style: none; text-align: left; margin-top: 20px; }
.coming-soon-features li { padding: 6px 0; font-size: 12px; color: var(--text-muted); }
.coming-soon-features li::before { content: '\2713'; color: var(--green); margin-right: 8px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 10000; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Spinner */
.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: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1100px) {
    .ratecheck-main-layout { grid-template-columns: 1fr; }
    .rates-row-layout { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-hero { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .logo-text, .sidebar .nav-btn span:not(.logo-icon), .sidebar-user { display: none; }
    .main-content { margin-left: 60px; padding: 16px; }
    .analytics-hero { grid-template-columns: repeat(2, 1fr); }
    .dow-grid { grid-template-columns: repeat(4, 1fr); }
}


/* === Insights Cards === */
.insights-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.insights-summary-card {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.insights-summary-card .summary-value {
    font-size: 32px;
    font-weight: 700;
    color: #f8fafc;
}
.insights-summary-card .summary-label {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-card {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    border-left: 4px solid #64748b;
    transition: transform 0.15s, box-shadow 0.15s;
}
.insight-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.insight-card.severity-high { border-left-color: #ef4444; }
.insight-card.severity-medium { border-left-color: #f59e0b; }
.insight-card.severity-low { border-left-color: #22c55e; }
.insight-card.type-risk { border-left-color: #ef4444; }
.insight-card.type-warning { border-left-color: #f59e0b; }
.insight-card.type-opportunity { border-left-color: #22c55e; }
.insight-card.type-info { border-left-color: #3b82f6; }

.insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}
.type-risk .insight-icon { background: rgba(239,68,68,0.15); color: #ef4444; }
.type-warning .insight-icon { background: rgba(245,158,11,0.15); color: #f59e0b; }
.type-opportunity .insight-icon { background: rgba(34,197,94,0.15); color: #22c55e; }
.type-info .insight-icon { background: rgba(59,130,246,0.15); color: #3b82f6; }

.insight-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    flex: 1;
}
.insight-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.insight-badge.risk { background: rgba(239,68,68,0.15); color: #ef4444; }
.insight-badge.warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.insight-badge.opportunity { background: rgba(34,197,94,0.15); color: #22c55e; }
.insight-badge.info { background: rgba(59,130,246,0.15); color: #3b82f6; }

.insight-detail {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: pre-line;
}
.insight-action {
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.5;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.insight-action::before {
    content: '\279C ';
    color: #22c55e;
    font-weight: bold;
}
.insight-impact {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #22c55e;
    background: rgba(34,197,94,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Insight mini-charts */
.insight-dow-chart {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    align-items: flex-end;
    height: 60px;
}
.insight-dow-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.insight-dow-bar .bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}
.insight-dow-bar .bar-label {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}
.insight-dow-bar .bar-value {
    font-size: 9px;
    color: #94a3b8;
    margin-bottom: 2px;
}

/* Filter pills */
.insight-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.insight-filter {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border, #334155);
    background: transparent;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.insight-filter:hover { border-color: #3b82f6; color: #e2e8f0; }
.insight-filter.active { background: #3b82f6; border-color: #3b82f6; color: white; }
