* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; min-height: 100vh; }

/* ── Standard Hub Page Header (canonical pattern for all Massanois hubs) ───────
 *
 * Use this structure on every hub page:
 *
 *   <div class="hub-page-header">
 *     <div class="hub-page-header-left">
 *       <h1>Hub Name</h1>
 *       <div class="hub-page-subtitle">Subtitle · More · Info</div>
 *     </div>
 *     <div class="hub-page-header-right">
 *       <a href="/" class="btn btn-ghost">← Massanois Tools</a>
 *     </div>
 *   </div>
 *
 *   <div class="hub-nav">
 *     <div class="hub-nav-inner">
 *       <button class="hub-nav-tab active" data-tab="xxx" onclick="...">Label</button>
 *     </div>
 *   </div>
 * ─────────────────────────────────────────────────────────────────────────── */
.hub-page-header { background: linear-gradient(135deg, #2F5496 0%, #1a3a6e 100%); padding: 20px 32px; display: flex; justify-content: space-between; align-items: center; }
.hub-page-header-left { flex: 1; }
.hub-page-header-left h1 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.hub-page-subtitle { background: #2F5496; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; display: inline-block; }
.hub-page-header-right { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }

/* Legacy header class — kept for backward compatibility, maps to same visual */
.header { background: linear-gradient(135deg, #2F5496 0%, #1a3a6e 100%); color: #fff; padding: 20px 32px; display: flex; justify-content: space-between; align-items: center; }
.header-left h1 { font-size: 22px; font-weight: 700; }
.header-left p { font-size: 13px; opacity: 0.7; margin-top: 2px; }
.header-subtitle-btn { background: #2F5496; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; margin-top: 6px; display: inline-block; }
.header-right { display: flex; gap: 10px; align-items: center; }
.btn { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: background 0.15s; }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.25); }
.btn-primary { background: #2F5496; color: #fff; }
.btn-primary:hover { background: #1a3a6e; }
.btn-new-brand { background: #5a8ddb; color: #fff; }
.btn-new-brand:hover { background: #4478c5; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Brand list */
.container { max-width: 1200px; margin: 0 auto; padding: 8px 20px 8px 20px; }

/* Tighten breadcrumb spacing */
#breadcrumb-nav { padding: 0.25rem 0 !important; margin-bottom: -8px !important; }
#breadcrumb-nav .container { padding: 0.25rem 20px !important; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title { font-size: 13px; font-weight: 600; color: #2F5496; text-transform: uppercase; letter-spacing: 1px; }
.search-bar { padding: 7px 12px; border: 1px solid #d0d8e8; border-radius: 6px; font-size: 13px; width: 220px; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.brand-card { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid #e8ecf0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.brand-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); transform: translateY(-2px); }
.brand-card-name { font-size: 16px; font-weight: 600; color: #1a2e4a; margin-bottom: 4px; }
.brand-card-group { font-size: 12px; color: #888; margin-bottom: 12px; }
.brand-card-stats { display: flex; gap: 16px; }
.brand-stat { text-align: center; }
.brand-stat-val { font-size: 15px; font-weight: 600; color: #1a2e4a; }
.brand-stat-lbl { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.lifecycle-badge { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 10px; margin-top: 10px; }
.badge-live { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.brand-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.brand-phase-chip { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.brand-rev-chip { font-size: 11px; font-weight: 700; color: #1a2e4a; background: #f1f5f9; border-radius: 8px; padding: 2px 7px; }
.brand-leads-chip { font-size: 10px; font-weight: 600; color: #7c3aed; background: #ede9fe; border-radius: 8px; padding: 2px 7px; }
.brand-card-first-sale { font-size: 11px; color: #64748b; margin-top: 6px; }
.brand-card-stats-block { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 10px 0; padding: 10px 12px; background: #f8fafc; border-radius: 7px; border: 1px solid #eef1f5; }
.bcs-row { display: flex; flex-direction: column; }
.bcs-row.bcs-full { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; }
.bcs-label { font-size: 10px; color: #9aa4b2; text-transform: uppercase; letter-spacing: 0.4px; line-height: 1; margin-bottom: 3px; }
.bcs-row.bcs-full .bcs-label { margin-bottom: 0; }
.bcs-value { font-size: 13px; font-weight: 600; color: #1a2e4a; line-height: 1; }
.bcs-row.bcs-full .bcs-value { font-size: 12px; font-weight: 500; color: #4a6080; }
.bcs-value.bcs-muted { color: #aab4be; font-weight: 400; font-size: 12px; }

/* Brand detail page */
.brand-detail { display: none; }
.brand-detail.active { display: block; }

.brand-hero { background: #fff; border-radius: 10px; padding: 12px 20px; margin-top: -4px; margin-bottom: 8px; border: 1px solid #e8ecf0; }
.brand-hero h2 { font-size: 26px; font-weight: 700; color: #1a2e4a; margin: 0 0 4px 0; }
.brand-hero-sub { font-size: 13px; color: #888; margin: 0 0 8px 0; }
.kpi-row { display: flex; gap: 24px; flex-wrap: wrap; margin: 0; }
.kpi { text-align: left; }
.kpi-val { font-size: 22px; font-weight: 700; color: #1a2e4a; font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }
.kpi-delta { font-size: 12px; margin-top: 2px; }
.delta-up { color: #16a34a; }
.delta-down { color: #dc2626; }

/* Secondary navigation (team/group filter) */
.secondary-nav { background: #fff; border-bottom: 1px solid #e8ecf0; padding: 8px 12px; display: flex; flex-direction: column; gap: 0; max-height: 300px; overflow-y: auto; }
.nav-group-header { font-size: 12px; font-weight: 600; color: #444; padding: 8px 12px; display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; transition: color 0.15s; text-transform: none; letter-spacing: 0; }
.nav-group-header:hover { color: #2F5496; }
.nav-chevron { display: inline-block; transition: transform 0.2s ease; font-size: 11px; }
.nav-group-header.expanded .nav-chevron { transform: rotate(90deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; padding-left: 20px; max-height: 500px; overflow: hidden; transition: max-height 0.2s ease, opacity 0.2s ease; opacity: 1; }
.nav-group-items.collapsed { max-height: 0; opacity: 0; }
.secondary-nav-tab { padding: 6px 12px; font-size: 12px; font-weight: 500; color: #555; background: #f5f7fa; border: 1px solid #e8ecf0; border-radius: 4px; cursor: pointer; transition: all 0.15s; white-space: nowrap; text-align: left; }
.secondary-nav-tab:hover { color: #2F5496; border-color: #2F5496; background: #f0f4ff; }
.secondary-nav-tab.active { color: #fff; background: #2F5496; border-color: #2F5496; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-top: 4px; margin-bottom: 0; overflow: visible; padding: 0; align-items: center; }
.tab { padding: 8px 16px 8px 16px; font-size: 13.5px; font-weight: 500; color: #64748b; background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; margin-bottom: 0; }
.tab:hover { color: #2F5496; }
.tab.active { color: #2F5496; border-bottom-color: #2F5496; font-weight: 600; }

/* More ▾ overflow dropdown */
.tab-more-wrapper { position: relative; margin-left: auto; flex-shrink: 0; }
.tab-more-btn { font-size: 13px; color: #64748b; }
.tab-more-btn.active { color: #2F5496; border-bottom-color: #2F5496; font-weight: 600; }
.tab-more-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 160px;
    z-index: 500;
    padding: 4px 0;
}
.tab-more-dropdown.open { display: block; }
.tab-more-item { padding: 9px 18px; font-size: 13px; font-weight: 500; color: #64748b; cursor: pointer; white-space: nowrap; transition: background 0.1s, color 0.1s; }
.tab-more-item:hover { background: #f0f4ff; color: #2F5496; }
.tab-more-item.active { color: #2F5496; font-weight: 600; background: #f0f4ff; }

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Chart area */
.chart-card { background: #fff; border-radius: 10px; padding: 20px 24px; border: 1px solid #e8ecf0; margin-bottom: 16px; }
.chart-title { font-size: 13px; font-weight: 600; color: #444; margin-bottom: 16px; }
.chart-area { height: 200px; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 28px; }
.bar { width: 100%; border-radius: 3px 3px 0 0; transition: opacity 0.15s; }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 9px; color: #999; white-space: nowrap; }

/* Distribution */
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.state-card { background: #fff; border-radius: 8px; padding: 12px 14px; border: 1px solid #e8ecf0; font-size: 12px; }
.state-card-direct { border-left: 3px solid #2F5496; background: #f8faff; }
.state-name { font-weight: 600; color: #1a2e4a; font-size: 13px; margin-bottom: 4px; }
.state-distrib { color: #555; margin-bottom: 4px; }
.dist-sort-btn { background: #f0f4f8; color: #555; border: 1px solid #d0d8e8; }
.dist-sort-btn:hover { background: #e2e8f0; }
.dist-sort-btn.active { background: #1a2e4a; color: #fff; border-color: #1a2e4a; }
.state-status { font-size: 11px; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.pill-active   { background: #dcfce7; color: #166534; }
.pill-launch   { background: #dbeafe; color: #1d4ed8; }
.pill-hold     { background: #fee2e2; color: #991b1b; }
.pill-review   { background: #fef9c3; color: #854d0e; }
.pill-empty    { background: #f0f0f0; color: #888; }

/* Leads table */
.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leads-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e8ecf0; }
.leads-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.leads-table tr:hover td { background: #f8f9fb; }

/* Inventory table */
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-table th { text-align: right; padding: 8px 10px; font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; border-bottom: 2px solid #e8ecf0; }
.inv-table th:first-child { text-align: left; }
.inv-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; text-align: right; font-variant-numeric: tabular-nums; }
.inv-table td:first-child { text-align: left; color: #1a2e4a; font-weight: 500; }

/* Sync status bar */
.sync-bar { background: #f0f4ff; border: 1px solid #c7d7f5; border-radius: 8px; padding: 10px 16px; font-size: 12px; color: #1a3a6e; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: #aaa; font-size: 14px; }
.empty-state h3 { color: #666; margin-bottom: 8px; }

/* Spinner */
.loading { text-align: center; padding: 40px; color: #888; font-size: 14px; }

/* Add lead modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; padding: 28px; width: 480px; max-width: 95vw; }
.modal h3 { font-size: 18px; font-weight: 600; color: #1a2e4a; margin-bottom: 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 8px 10px; border: 1px solid #d0d8e8; border-radius: 6px; font-size: 13px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel { background: #f0f0f0; color: #555; }
.btn-cancel:hover { background: #e0e0e0; }

/* Lifecycle Tab */
.lifecycle-container { padding: 0; }
.lifecycle-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #e8ecf0; }
.lifecycle-header h3 { font-size: 18px; font-weight: 600; color: #1a2e4a; margin-bottom: 12px; }
.lifecycle-header p { font-size: 12px; color: #999; }

.core-sku-badge { display: inline-flex; gap: 12px; align-items: center; background: #f0f4f9; padding: 8px 16px; border-radius: 6px; font-size: 13px; }
.badge-label { color: #666; font-weight: 500; }
.badge-value { font-weight: 700; color: #2F5496; }
.badge-pct { color: #999; font-size: 12px; }

.lifecycle-phases { background: #fff; padding: 20px; border-radius: 10px; border: 1px solid #e8ecf0; }
.lifecycle-phase { border: 1px solid #e8ecf0; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.phase-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #f8f9fb; cursor: pointer; transition: background 0.15s; user-select: none; border-radius: 8px 8px 0 0; }
.chevron { color: #999; font-size: 13px; width: 16px; }
.phase-status { font-size: 16px; width: 20px; }
.phase-name { flex: 1; font-weight: 500; color: #1a2e4a; }
.phase-progress { font-size: 12px; color: #999; min-width: 60px; }
.phase-pct { font-size: 12px; color: #2F5496; font-weight: 600; min-width: 40px; text-align: right; }

.phase-body { background: #fff; padding: 0; border: 1px solid #e8ecf0; border-top: none; border-radius: 0 0 8px 8px; overflow: hidden; }
.item-row { display: flex; align-items: center; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.item-row:hover { background: #f8faff; }
.item-row:last-child { border-bottom: none; }
.item-status { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; min-width: 70px; }
.item-status.done { background: #d1fae5; color: #047857; }
.item-status.pending { background: #fef3c7; color: #d97706; }
.item-status.working-on-it { background: #93c5fd; color: #1e40af; }
.item-status.in-progress { background: #dbeafe; color: #1e40af; }
.item-status.stuck { background: #fecaca; color: #991b1b; }
.item-status.waiting-for-review { background: #f0e68c; color: #854d0e; }
.item-name { flex: 1; color: #333; }
.item-owner { color: #999; font-size: 12px; min-width: 100px; }
.item-due { color: #999; font-size: 12px; min-width: 90px; }
.item-edit-btn { color: #2F5496; opacity: 0; font-size: 12px; margin-left: auto; padding: 0 4px; transition: opacity 0.15s; }
.item-row:hover .item-edit-btn { opacity: 1; }
.item-notes-preview { padding: 4px 16px 8px 88px; font-size: 11px; color: #888; font-style: italic; white-space: pre-wrap; word-break: break-word; }
.phase-complete-banner { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #d1fae5; color: #065f46; padding: 12px 20px; border-radius: 6px; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; }

.lifecycle-states { background: #fff; padding: 20px; border-radius: 10px; border: 1px solid #e8ecf0; }
.states-header { display: grid; gap: 10px; padding: 12px 16px; background: #f8f9fb; font-weight: 600; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e8ecf0; }
.states-list { /* full list — let the page scroll, don't trap rows in an inner scrollable region */ }
.state-row { display: grid; gap: 10px; padding: 12px 16px; align-items: center; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.state-prior-dist { color: #555; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-plan-pill { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; background: #e0f2fe; color: #0369a1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.state-plan-pill.plan-maintain { background: #dcfce7; color: #166534; }
.state-plan-pill.plan-transition { background: #fef3c7; color: #92400e; }
.state-plan-pill.plan-new { background: #ede9fe; color: #5b21b6; }
.state-plan-pill.plan-hold { background: #f3f4f6; color: #6b7280; }
.state-plan-pill.plan-direct { background: #dbeafe; color: #1e40af; }
.state-plan-pill.plan-stay { background: #dcfce7; color: #166534; }
.state-row:hover { background: #f8f9fb; }
.state-code { font-weight: 600; color: #2F5496; }
.state-name { color: #333; }
.state-distributor { color: #666; }
.state-status { text-align: center; padding: 4px 8px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 600; }
.state-samples { text-align: center; color: #666; }
.state-sales { color: #666; font-size: 12px; }
.state-edit { text-align: right; }
.btn-small { padding: 4px 10px; font-size: 12px; background: #2F5496; color: #fff; border: none; border-radius: 4px; cursor: pointer; transition: background 0.15s; }
.btn-small:hover { background: #1a3a6e; }

/* State row: compact layout set by JS inline grid-template-columns */
.lc-state-row { display: grid; gap: 10px; padding: 10px 16px; align-items: center; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.lc-state-row:hover { background: #f8f9fb; }

/* Brand list view sub-tabs */
.brand-view-tabs { margin: 0; }
.sub-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-tab { padding: 5px 12px; cursor: pointer; font-size: 12px; font-weight: 500; color: #64748b; background: none; border: none; border-radius: 6px; white-space: nowrap; transition: color 0.15s, background 0.15s; user-select: none; }
.sub-tab:hover { background: #f0f4ff; color: #1a2e4a; }
.sub-tab.active { background: #2F5496; color: #fff; font-weight: 600; }

/* Top-level filter strip: Priority + Lifecycle Stage */
.brand-top-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.brand-top-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.brand-top-label { font-size: 9px; color: #94a3b8; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; margin-right: 5px; min-width: 50px; }
.brand-top-divider { width: 1px; align-self: stretch; background: #e2e8f0; }

/* Region/portfolio sub-tabs (now subordinate to top filters) */
.brand-region-tabs { margin-bottom: 12px; flex-wrap: wrap; }
.brand-region-label { font-size: 10px; color: #94a3b8; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; align-self: center; margin-right: 8px; }
.brand-region-divider { margin: 0 8px; color: #e2e8f0; align-self: center; font-size: 16px; }

/* Lifecycle stage sub-tabs */
.lc-stage-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin: 16px 0 0; padding-bottom: 0; }
.lc-stage-tab { padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 500; color: #666; border-radius: 6px 6px 0 0; border: 1px solid transparent; border-bottom: none; position: relative; display: flex; align-items: center; gap: 8px; transition: background 0.1s; }
.lc-stage-tab:hover { background: #f0f4f8; color: #1a2e4a; }
.lc-stage-tab.active { background: #fff; border-color: #e2e8f0; border-bottom-color: #fff; color: #1a2e4a; font-weight: 600; margin-bottom: -2px; }
.lc-stage-tab-label { }
.lc-stage-tab-pct { font-size: 11px; color: #aaa; }
.lc-stage-tab.active .lc-stage-tab-pct { color: #10b981; font-weight: 600; }
.lc-stage-current-dot { color: #10b981; font-size: 10px; }
.lc-stage-content { background: #fff; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 8px 8px; padding: 20px; }

/* Lifecycle stage badges (hero + brand cards) */
.lifecycle-stage-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; vertical-align: middle; }
.stage-evaluate        { background: #f3f4f6; color: #374151; }
.stage-evaluation      { background: #f3f4f6; color: #374151; } /* legacy */
.stage-go_no_go        { background: #ede9fe; color: #5b21b6; }
.stage-pre_launch      { background: #fef3c7; color: #92400e; }
.stage-launch          { background: #dbeafe; color: #1e40af; } /* legacy */
.stage-launch_deploy   { background: #dbeafe; color: #1e40af; }
.stage-active          { background: #dcfce7; color: #166534; }
.stage-rejected_eval   { background: #fee2e2; color: #991b1b; }
.stage-disco_massanois { background: #f1f5f9; color: #475569; }
.stage-disco_brand     { background: #f1f5f9; color: #64748b; }

/* Stage selector dropdown on Lifecycle tab */
.lc-stage-select { padding: 5px 10px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #1a2e4a; cursor: pointer; min-width: 170px; }
.lc-stage-select:hover { border-color: #2F5496; }
.lc-stage-select:focus { outline: none; border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.15); }

/* Go/No-Go decision gate placeholder */
.lc-decision-gate { background: #ede9fe; border: 1px solid #c4b5fd; border-radius: 8px; padding: 18px 22px; margin: 16px 0 24px; }
.lc-decision-gate-title { font-size: 13px; font-weight: 700; color: #5b21b6; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.lc-decision-gate-body { font-size: 13px; color: #4c1d95; line-height: 1.55; }
.lc-decision-gate-body strong { color: #2e1065; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1001; }
.modal-content { background: #fff; border-radius: 12px; padding: 28px; width: 500px; max-width: 95vw; }
.modal-content h3 { font-size: 18px; font-weight: 600; color: #1a2e4a; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group textarea, .form-group select, .form-group input { width: 100%; padding: 10px 12px; border: 1px solid #d0d8e8; border-radius: 6px; font-size: 13px; font-family: inherit; }
.form-group textarea:focus, .form-group select:focus, .form-group input:focus { outline: none; border-color: #2F5496; box-shadow: 0 0 0 3px rgba(47, 84, 150, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal .btn { padding: 8px 16px; font-size: 13px; }


/* Lifecycle table-based layout (Distributor Hub style) */
.lifecycle-table { background: #fff; overflow: hidden; }
.lifecycle-col-headers { display: grid; grid-template-columns: 32px 1fr 140px 140px 140px 1fr; gap: 16px; padding: 8px 16px; background: #f9fafb; border-bottom: 1px solid #e8ecf0; font-size: 11px; font-weight: 600; color: #666; letter-spacing: 0.4px; }
.lc-col-chevron { grid-column: 1; }
.lc-col-name { grid-column: 2; }
.lc-col-status { grid-column: 3; }
.lc-col-owner { grid-column: 4; }
.lc-col-due { grid-column: 5; }
.lc-col-notes { grid-column: 6; text-align: right; }

/* Item rows */
.lc-item-group { border-bottom: 1px solid #e8ecf0; }
.lc-item-group:last-child { border-bottom: none; }
.lc-item-main { display: grid; grid-template-columns: 32px 1fr 140px 140px 140px 1fr; gap: 16px; padding: 12px 16px; align-items: center; }
.lc-item-main:hover { background: #f9fafb; }
.lc-col-chevron { display: flex; align-items: center; justify-content: center; }
.lc-chevron { cursor: pointer; font-size: 14px; color: #666; user-select: none; }
.lc-chevron:hover { color: #2F5496; }
.lc-chevron-spacer { display: inline-block; width: 14px; }
.lc-col-name { font-size: 13px; font-weight: 500; color: #1a2e4a; }
.lc-col-status, .lc-col-owner, .lc-col-due, .lc-col-notes { display: flex; align-items: center; }
.lc-status-select, .lc-owner-select, .lc-due-input { font-size: 12px; padding: 5px 8px; border: 1px solid #d0d8e8; border-radius: 4px; background: #fff; width: 100%; }
.lc-status-select:focus, .lc-owner-select:focus, .lc-due-input:focus { outline: none; border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.1); }
.lc-notes-box { font-size: 12px; padding: 5px 8px; border: 1px solid #d0d8e8; border-radius: 4px; background: #fff; width: 100%; cursor: pointer; font-weight: 500; color: #2F5496; transition: all 0.15s; }
.lc-notes-box:hover { border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.1); }
.lc-notes-box:active { background: #f9fafb; }

/* Field status messages (saving/saved/error) */
.lc-field-status { font-size: 10px; font-weight: 500; margin-top: 2px; padding: 2px 4px; border-radius: 2px; white-space: nowrap; }
.lc-status-loading { color: #2F5496; }
.lc-status-success { color: #10b981; background: #d1fae5; }
.lc-status-error { color: #dc2626; background: #fee2e2; }

/* Expanded content */
.lc-item-expand { border-top: 1px solid #e8ecf0; background: #f9fafb; }
.lc-expand-content { padding: 16px 16px 16px 48px; }
.lc-subitems-section { margin-bottom: 20px; }
.lc-subitems-list { }
.lc-subitem-row { display: grid; grid-template-columns: 1fr 140px 140px 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e8ecf0; align-items: center; }
.lc-subitem-row:last-child { border-bottom: none; }
.lc-subitem-name { font-size: 12px; color: #666; font-style: italic; }
.lc-assignments-section { margin-bottom: 20px; }
.lc-assignment-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 12px; }
.lc-assignment-label { color: #666; min-width: 80px; font-size: 11px; font-weight: 500; }
.lc-assignment-row select { font-size: 12px; padding: 5px 8px; border: 1px solid #d0d8e8; border-radius: 4px; background: #fff; min-width: 120px; }
.lc-assignment-row select:focus { outline: none; border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.1); }
.lc-notes-section { }
.lc-notes-history { margin-bottom: 12px; }
.lc-note-entry { padding: 8px 0; border-bottom: 1px solid #e8ecf0; font-size: 12px; color: #333; }
.lc-note-entry:last-child { border-bottom: none; }
.lc-note-meta { font-size: 11px; color: #999; margin-bottom: 4px; }
.lc-add-note { margin-top: 12px; }
.lc-add-note textarea { width: 100%; font-size: 12px; padding: 8px 10px; border: 1px solid #d0d8e8; border-radius: 4px; background: #fff; resize: vertical; font-family: inherit; }
.lc-add-note textarea:focus { outline: none; border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.1); }
.lc-add-note button { margin-top: 8px; font-size: 12px; padding: 6px 16px; background: #2F5496; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: 500; }
.lc-add-note button:hover { background: #1a3a6e; }

/* Priority badges on brand cards */
.priority-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.priority-A { background: #1a5c9a; color: #fff; }
.priority-B { background: #2d7a2d; color: #fff; }
.priority-C { background: #c05621; color: #fff; }
.priority-D { background: #888; color: #fff; }
.priority-X { background: #b71c1c; color: #fff; }

/* TO DO count badge */
.todo-count-badge { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 12px; margin-left: 6px; vertical-align: middle; background: #3b82f6; color: #fff; }

/* Brand group header row */
.brand-group-header { grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #2F5496; padding: 8px 4px 4px; border-bottom: 2px solid #2F5496; margin-top: 8px; }

/* ── Pipeline status badge ──────────────────────────────────────────────── */
.state-pipeline-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }

/* ── State chevron ──────────────────────────────────────────────────────── */
.state-chevron { font-size: 10px; color: #aaa; cursor: pointer; user-select: none; transition: color 0.15s; }
.lc-state-row:hover .state-chevron { color: #2F5496; }
.lc-state-row { cursor: pointer; }
.lc-state-active { background: #f0fdf4 !important; border-left: 3px solid #16a34a; }
.lc-state-gap { background: #fffbeb; border-left: 3px solid #f59e0b; }
.gap-icon-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: #f59e0b; padding: 0; line-height: 1; vertical-align: middle; flex-shrink: 0; }
.st-franchise-chip { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 8px; flex-shrink: 0; cursor: default; }
.st-franchise      { background: #fed7aa; color: #c2410c; }
.st-franchise-soft { background: #fef08a; color: #854d0e; }

/* ── Franchise state callout (expanded state row) ───────────────────────── */
.franchise-callout {
    display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
    padding: 9px 14px; border-radius: 8px; margin-bottom: 8px;
    border-left: 4px solid;
}
.franchise-warn  { background: #fff7ed; border-color: #f97316; }
.franchise-soft  { background: #fefce8; border-color: #eab308; }
.franchise-badge {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.franchise-warn .franchise-badge  { background: #fed7aa; color: #c2410c; }
.franchise-soft .franchise-badge  { background: #fef08a; color: #92400e; }
.franchise-rules-text { font-size: 12px; color: #44403c; line-height: 1.4; flex: 1; }
.franchise-rel        { font-size: 12px; color: #44403c; white-space: nowrap; flex-shrink: 0; }

/* Distributor cross-link — clickable distributor name in Brand Hub state rows */
.dist-link { color: #2F5496; text-decoration: none; font-weight: 500; }
.dist-link:hover { text-decoration: underline; color: #1a2e4a; }

/* ── Expand panel wrapper ───────────────────────────────────────────────── */
.state-expand-panel { background: #f8f9fb; border-bottom: 2px solid #e2e8f0; border-left: 3px solid #2F5496; }
.state-expand-section-hdr { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #2F5496; margin-bottom: 10px; }

/* ── Vertical stack layout for Pipeline tab sections ── */
.state-expand-inner { display: grid; grid-template-columns: 1fr; gap: 0; }
.state-expand-section { padding: 14px 16px 14px 20px; border-bottom: 1px solid #e2e8f0; }
.state-expand-section:last-child { border-bottom: none; }

/* Legacy classes for backward compatibility */
.state-expand-left  { padding: 14px 16px 14px 20px; }
.state-expand-mid   { padding: 14px 16px; }
.state-expand-right { padding: 14px 16px; }

/* ── Account Leads section (below 3-column expand panel) ───────────────── */
.state-leads-section { border-top: 1px solid #e2e8f0; padding: 12px 20px 16px; background: #fcfcfe; }
.state-leads-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.sl-total-badge { background: #2F5496; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.sl-chips { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.sl-summary-chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 8px; }
.sl-status-new       { background: #f0f4ff; color: #2F5496; }
.sl-status-contacted { background: #e0f2fe; color: #0369a1; }
.sl-status-sampled   { background: #fef9c3; color: #854d0e; }
.sl-status-won       { background: #dcfce7; color: #166534; }
.sl-status-stalled   { background: #fff7ed; color: #c2410c; }
.sl-status-lost      { background: #fee2e2; color: #991b1b; }
.sl-add-btn { margin-left: auto; padding: 4px 12px; background: #2F5496; color: #fff; border: none; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sl-add-btn:hover { background: #1F3864; }
.sl-lead-list { display: flex; flex-direction: column; gap: 1px; }
.sl-lead-row { display: flex; flex-direction: column; gap: 2px; padding: 5px 8px; border-radius: 5px; background: #fff; border: 1px solid #f0f4f8; }
.sl-lead-row:hover { background: #f5f8ff; }
.sl-lead-row-top { display: flex; align-items: center; gap: 8px; }
.sl-lead-name { flex: 1; font-size: 12px; color: #1a2e4a; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-lead-city { font-size: 11px; color: #94a3b8; margin-left: 5px; font-weight: 400; }
.sl-acct-info { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-left: 1px; }
.sl-acct-type { font-size: 10px; color: #888; }
.sl-acct-badge { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
.sl-acct-active { background: #e6f4ea; color: #1e7e34; }
.sl-acct-inactive { background: #f5f5f5; color: #999; }
.sl-acct-meta { font-size: 10px; color: #94a3b8; }
.sl-acct-rep { font-size: 10px; color: #64748b; font-style: italic; }
.sl-lead-dist-badge { font-size: 10px; font-weight: 700; background: #ede9fe; color: #5b21b6; padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.sl-lead-ch-natl { font-size: 10px; font-weight: 700; background: #fff3e0; color: #c2410c; padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.sl-lead-notes { font-size: 13px; flex-shrink: 0; cursor: help; }
.sl-lead-status-btn { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; cursor: pointer; flex-shrink: 0; border: none; transition: opacity 0.1s; }
.sl-lead-status-btn:hover { opacity: 0.75; }
.sl-overflow { font-size: 12px; color: #2F5496; cursor: pointer; padding: 5px 8px; text-align: center; }
.sl-overflow:hover { text-decoration: underline; }
.sl-empty { font-size: 12px; color: #94a3b8; font-style: italic; padding: 4px 0; }
.sl-empty a { color: #2F5496; }

/* Add Lead modal */
.add-lead-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.add-lead-modal-box { background: #fff; border-radius: 10px; width: 100%; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.add-lead-modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid #f0f4f8; font-size: 14px; color: #1a2e4a; }
.add-lead-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.add-lead-row label { display: block; font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.add-lead-input { width: 100%; padding: 7px 10px; border: 1px solid #d1d9e6; border-radius: 6px; font-size: 13px; font-family: inherit; box-sizing: border-box; color: #1a2e4a; }
.add-lead-input:focus { outline: none; border-color: #2F5496; }
.add-lead-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid #f0f4f8; }

/* ── Pipeline steps ─────────────────────────────────────────────────────── */
.pipeline-steps { display: flex; flex-direction: column; gap: 2px; }
.pipeline-step { display: grid; grid-template-columns: 18px auto 1fr 54px; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; }
.step-marker { font-size: 11px; font-weight: 700; width: 18px; text-align: center; }
.step-marker-blank { display: inline-block; width: 18px; }
.pipeline-step-done .step-marker { color: #16a34a; }
.pipeline-step-current .step-marker { color: #2F5496; }
.step-label { color: #444; white-space: nowrap; }
.pipeline-step-future .step-label { color: #aaa; }
.pipeline-step-current .step-label { color: #1a2e4a; font-weight: 600; }
.pipeline-step-done .step-label { color: #555; }
.step-note-right { font-size: 11px; color: #6b7280; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pipeline-step-current .step-note-right { color: #3b5fa0; }
.step-date { font-size: 10px; color: #9ca3af; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pipeline-step-done .step-date { color: #6b7280; }
.pipeline-step-current .step-date { color: #2F5496; }
.step-by { font-size: 9px; color: #b0b8cc; margin-left: 2px; }
.step-label-col { display: flex; flex-direction: column; gap: 1px; }
.step-meta { font-size: 10px; color: #94a3b8; line-height: 1.3; white-space: normal; }
.pipeline-step-current .step-meta { color: #6b82c0; }
.pipeline-step-done .step-meta { color: #9ca3af; }

/* ── Notes box ──────────────────────────────────────────────────────────── */
.expand-notes-box { background: #fff; border: 1px solid #e2e8f0; border-left: 3px solid #2F5496; border-radius: 4px; padding: 7px 10px; margin-bottom: 10px; font-size: 12px; color: #333; line-height: 1.5; }
.expand-notes-status { font-weight: 600; color: #2F5496; }
.expand-notes-empty { font-size: 11px; color: #bbb; font-style: italic; margin-bottom: 10px; }

/* ── Sales history list ─────────────────────────────────────────────────── */
.sales-history-list { display: flex; flex-direction: column; gap: 4px; }
.sales-yr-row { display: grid; grid-template-columns: 36px 36px 50px 1fr 52px; align-items: baseline; gap: 6px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
.sales-yr-row:last-child { border-bottom: none; }
.sales-yr-lbl { color: #888; font-size: 11px; }
.sales-yr-dist { color: #555; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-yr-val { color: #1a2e4a; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sales-yr-val.live { color: #2F5496; }
.sales-yr-yoy  { font-size: 10px; font-weight: 600; text-align: right; min-width: 48px; font-variant-numeric: tabular-nums; }
.sales-yr-yoy.up   { color: #16a34a; }
.sales-yr-yoy.down { color: #dc2626; }
.sales-yr-yoy.flat { color: #9ca3af; }
.live-tag { font-size: 9px; font-weight: 700; background: #dbeafe; color: #1d4ed8; padding: 1px 4px; border-radius: 3px; margin-left: 3px; vertical-align: middle; }
.supplier-tag { font-size: 9px; font-weight: 700; background: #f3e8ff; color: #6b21a8; padding: 1px 4px; border-radius: 3px; margin-left: 3px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.04em; }
.expand-meta-line { font-size: 11px; color: #666; margin-top: 8px; line-height: 1.5; }
.first-sale-line { font-size: 11px; color: #888; margin-top: 8px; padding-top: 6px; border-top: 1px solid #e8ecf0; }

/* Product family breakdown */
.fam-breakdown { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e8ecf0; }
.fam-section-hdr { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px; }
.fam-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 50px 50px 52px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.fam-row.fam-row-no-total { grid-template-columns: minmax(0, 1.4fr) 60px 60px 18px; }
.fam-row.fam-row-hdr { font-size: 9px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 0 6px 0; border-bottom: 1px solid #e5e7eb; }
.fam-row.fam-row-hdr .fam-cs-ever, .fam-row.fam-row-hdr .fam-cs-recent, .fam-row.fam-row-hdr .fam-last-order { color: #94a3b8; font-weight: 700; text-align: right; }
.fam-name { color: #374151; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fam-cs-ever { color: #1a2e4a; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.fam-cs-recent { font-size: 11px; color: #6b7280; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.fam-last-order { font-size: 11px; color: #94a3b8; white-space: nowrap; text-align: right; }
.fam-unsold .fam-name { color: #6b7280; font-weight: 400; }
.fam-unsold { grid-template-columns: minmax(0, 1fr) auto 18px; }
.fam-sampled-tag { font-size: 10px; background: #fef9c3; color: #92400e; border: 1px solid #fde68a; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.fam-unsampled-tag { font-size: 10px; color: #d1d5db; white-space: nowrap; }
.fam-note-btn { font-size: 12px; cursor: pointer; opacity: 0.75; transition: opacity 0.15s; line-height: 1; }
.fam-note-btn:hover { opacity: 1; }

/* ── Hub navigation (top-level tabs) ───────────────────────────────────────── */
.hub-nav { background: #fff; border-bottom: 2px solid #e2e8f0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.hub-nav-inner { max-width: 1200px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; overflow-x: auto; gap: 4px; }
.hub-nav-tab { padding: 6px 14px; font-size: 13px; font-weight: 500; color: #64748b; background: none; border: none; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: color 0.15s, background 0.15s; letter-spacing: 0.1px; }
.hub-nav-tab:hover { color: #1a2e4a; background: #f0f4ff; }
.hub-nav-tab.active { background: #2F5496; color: #fff; font-weight: 600; }
/* Tighter top padding for hub content panels so gap below hub-nav is consistent */
#brand-list-view .container,
#portfolio-panel .container,
#marketing-panel .container,
#brand-report-panel .container,
#tools-panel .container { padding-top: 14px; }

/* ── Brand Report — standard hub page styling ──────────────────────────── */
#brand-report-panel { background: #f5f7fa; width: 100%; margin: 0; overflow-x: hidden; }
#brand-report-panel .container { position: relative; box-sizing: border-box; overflow-x: hidden; }
#brand-report-panel * { box-sizing: border-box; }

/* ── Tools & Resources — coming-soon cards ──────────────────────────────── */
.tools-coming-soon { text-align: center; padding: 56px 40px; max-width: 560px; margin: 0 auto; }
.tools-cs-icon { font-size: 40px; margin-bottom: 16px; }
.tools-cs-title { font-size: 20px; font-weight: 700; color: #1a2e4a; margin-bottom: 12px; }
.tools-cs-badge { display: inline-block; background: #e0f2fe; color: #0369a1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 10px; border-radius: 20px; margin-bottom: 16px; }
.tools-cs-desc { font-size: 13px; color: #94a3b8; line-height: 1.6; margin: 0; }

/* ── Portfolio brand pills (used in portfolio tab country breakdown) ─────── */
.portfolio-brand-pill { padding: 4px 10px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 14px; font-size: 12px; color: #1a2e4a; cursor: pointer; transition: background 0.15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.portfolio-brand-pill:hover { background: #dde6f0; }

/* ── Shared nav search input (inline in Product Type bar) ─────────────────── */
.bh-search-input { padding: 6px 11px; border: 1px solid #d0d8e8; border-radius: 6px; font-size: 13px; width: 280px; outline: none; background: #fff; }
.bh-search-input:focus { border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.15); }

/* ── Priority List — sort arrows, search bar, note button ──────────────────── */
.sort-arrow { font-size: 11px; opacity: 0.4; margin-left: 2px; }
.sort-arrow-active { opacity: 1; color: #2F5496; }
.pl-search-bar { padding: 6px 11px; border: 1px solid #d0d8e8; border-radius: 6px; font-size: 13px; width: 200px; outline: none; }
.pl-search-bar:focus { border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.15); }
.pl-note-btn { padding: 3px 9px; font-size: 11px; font-weight: 500; background: #f0f4ff; color: #2F5496; border: 1px solid #c7d7f5; border-radius: 5px; cursor: pointer; white-space: nowrap; transition: background 0.12s; }
.pl-note-btn:hover { background: #dce9ff; }

/* ── Brand note modal ───────────────────────────────────────────────────────── */
#brand-note-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.bnm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.bnm-box { position: relative; background: #fff; border-radius: 12px; padding: 24px 28px; width: 100%; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 1; }
.bnm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bnm-title { font-size: 15px; font-weight: 700; color: #1a2e4a; }
.bnm-close { background: none; border: none; font-size: 16px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 0; }
.bnm-close:hover { color: #1a2e4a; }
.bnm-textarea { width: 100%; border: 1px solid #d0d8e8; border-radius: 7px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; }
.bnm-textarea:focus { border-color: #2F5496; box-shadow: 0 0 0 2px rgba(47,84,150,0.15); }
.bnm-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* override btn-ghost for non-header context */
.bnm-footer .btn-ghost { background: #f1f5f9; color: #374151; border: 1px solid #d0d8e8; }
.bnm-footer .btn-ghost:hover { background: #e2e8f0; }

/* Phase 1 Onboarding Components */
.phase1-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.phase1-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e8ecf0; }
.phase1-table td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.phase1-table tr:hover td { background: #f8f9fb; }
.phase1-table tbody tr:last-child td { border-bottom: none; }

.phase1-agreement-card { background: #fff; border: 1px solid #e8ecf0; border-radius: 8px; padding: 14px 16px; }
.phase1-agreement-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.contacts-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.contacts-table td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.contacts-table tr:hover td { background: #f8f9fb; }
.contacts-table tbody tr:last-child td { border-bottom: none; }

/* 7-Phase Lifecycle Model */
.lc-phase-strip { display: flex; gap: 6px; flex-wrap: nowrap; padding: 6px 0 6px; margin-bottom: 12px; overflow-x: auto; }
.lc-phase-pill { display: flex; align-items: center; gap: 4px; padding: 8px 14px 6px 14px; border: none; border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer; font-size: 13px; font-weight: 500; color: #64748b; background: none; white-space: nowrap; transition: all 0.15s; }
.lc-phase-pill:hover { color: #2F5496; }
.lc-phase-pill.viewed { color: #2F5496; border-bottom-color: #2F5496; font-weight: 600; }
.lc-phase-pill.current { background: #16a34a; color: #fff; border-radius: 6px; border-bottom: none; padding: 8px 14px; }
.lc-phase-pill.disco { opacity: 0.45; font-style: italic; }

/* Collapsible sections */
.lc-collapsible { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; }
.lc-coll-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: #1a2e4a; user-select: none; }
.lc-coll-header:hover { background: #f8fafc; border-radius: 8px; }
.lc-coll-chevron { font-size: 10px; transition: transform 0.15s; }
.lc-coll-chevron.open { transform: rotate(90deg); }
.lc-coll-badge { margin-left: auto; background: #e2e8f0; color: #475569; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.lc-coll-body { overflow: hidden; }

/* Phase navigation buttons */
.btn-phase-nav { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: none; cursor: pointer; font-size: 12px; font-weight: 500; color: #475569; transition: all 0.15s; white-space: nowrap; }
.btn-phase-nav:hover { border-color: #2F5496; color: #2F5496; background: #f0f4ff; }

@media (max-width: 600px) {
    .header { padding: 16px; flex-direction: column; gap: 10px; align-items: flex-start; }
    .kpi-row { gap: 16px; }
    .dist-grid { grid-template-columns: 1fr 1fr; }
}

/* New Brand Modal */
.new-brand-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.new-brand-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.new-brand-modal .modal-inner {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a2e4a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1a2e4a;
    margin-bottom: 6px;
}

.form-group .optional {
    font-weight: 400;
    color: #888;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1a2e4a;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2F5496;
    box-shadow: 0 0 0 2px rgba(47, 84, 150, 0.15);
}

.modal-note {
    font-size: 12px;
    color: #888;
    margin: 12px 0 20px 0;
    font-style: italic;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-footer .btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-footer .btn-primary {
    background: #2F5496;
    color: white;
}

.modal-footer .btn-primary:hover:not(:disabled) {
    background: #1e3a5f;
    box-shadow: 0 4px 12px rgba(47, 84, 150, 0.2);
}

.modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-footer .btn-ghost {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #d0d8e8;
}

.modal-footer .btn-ghost:hover {
    background: #e2e8f0;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.modal-input:focus {
    border-color: #2F5496;
    box-shadow: 0 0 0 2px rgba(47, 84, 150, 0.1);
}

.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #d0d8e8;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Shared TO DO modal (#detailModal) — reset conflicting .modal styles so the
   overlay covers the full viewport and the inner .modal-content carries the
   white box styles, not the overlay itself. */
#detailModal.modal {
    background: transparent;
    border-radius: 0;
    padding: 0;
    width: auto;
    max-width: none;
}

/* brands.css gives .modal-overlay { z-index: 1000 } for the leads modal,
   but that stacks the overlay on top of .modal-content inside #detailModal.
   Reset it here so DOM order determines stacking (content comes after overlay). */
#detailModal .modal-overlay {
    z-index: auto;
}

/* ── Lead detail slide-out panel ─────────────────────────────────────────── */
.lead-slideout-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 95vw;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    z-index: 1051;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.lead-slideout-panel.open {
    transform: translateX(0);
}
.lead-slideout-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.lead-slideout-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a2e4a;
    line-height: 1.3;
}
.lead-slideout-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}
.lead-slideout-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.lead-slideout-close:hover { color: #475569; background: #e2e8f0; }
.lead-slideout-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}
.lead-slideout-section {
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9;
}
.lead-slideout-section:first-child { border-top: none; padding-top: 16px; margin-top: 0; }
.lead-slideout-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}
.lead-slideout-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.lead-slideout-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.lead-slideout-input,
.lead-slideout-select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #d0d8e8;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    box-sizing: border-box;
    background: #fff;
}
.lead-slideout-input:focus,
.lead-slideout-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.lead-slideout-textarea {
    width: 100%;
    padding: 8px 9px;
    border: 1px solid #d0d8e8;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    box-sizing: border-box;
    resize: vertical;
    min-height: 90px;
}
.lead-slideout-textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.lead-slideout-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

/* Rep badge on Distribution tab lead rows */
.sl-rep-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.5;
    vertical-align: middle;
    margin-left: 2px;
}

/* Auto-assign button in state leads header */
.sl-auto-assign-btn {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.sl-auto-assign-btn:hover { background: #ede9fe; }

/* Rep hint below dropdown in slide-out */
.lead-slideout-hint {
    font-size: 11px;
    color: #7c3aed;
    margin-top: 5px;
    font-style: italic;
}

/* Account match section in slide-out */
.lead-acct-match-loading, .lead-acct-match-none {
    font-size: 12px;
    color: #64748b;
    padding: 6px 0;
}
.lead-acct-match-none { color: #059669; font-weight: 500; }
.lead-acct-match-row {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f8fafc;
}
.lead-acct-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a2e4a;
    margin-bottom: 4px;
}
.lead-acct-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}
.lead-acct-type {
    font-size: 11px;
    color: #475569;
    background: #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
}
.lead-acct-state {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}
.lead-acct-badge {
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    padding: 1px 6px;
}
.lead-acct-active { color: #059669; background: #d1fae5; }
.lead-acct-inactive { color: #64748b; background: #f1f5f9; }
.lead-acct-stats {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 10px;
}
.lead-acct-rev { font-weight: 600; color: #1a2e4a; }

/* ── Master Collection Rules Page ──────────────────────────────────────────── */
.cr-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; }
.cr-section-title { font-size: 14px; font-weight: 700; color: #1a2e4a; margin-bottom: 14px; }
.cr-field label { display: block; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.cr-input { width: 100%; padding: 7px 10px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 5px; box-sizing: border-box; }
.cr-input:focus { outline: none; border-color: #2563eb; }
.cr-select { width: 100%; padding: 7px 8px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 5px; background: #fff; }
.cr-input-sm { padding: 4px 7px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 4px; }
.cr-input-sm:focus { outline: none; border-color: #2563eb; }
.cr-select-sm { padding: 4px 6px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; }
.cr-use-hidden td { opacity: .45; }
.cr-btn-save { padding: 8px 18px; font-size: 13px; font-weight: 600; background: #1a2e4a; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.cr-btn-save:hover { background: #2563eb; }
.cr-btn-sm { padding: 5px 12px; font-size: 12px; font-weight: 600; border: none; border-radius: 5px; cursor: pointer; }
.cr-btn-xs { padding: 2px 7px; font-size: 11px; font-weight: 700; border: none; border-radius: 4px; cursor: pointer; }
.cr-btn-blue { background: #2563eb; color: #fff; }
.cr-btn-blue:hover { background: #1d4ed8; }
.cr-btn-green { background: #15803d; color: #fff; }
.cr-btn-green:hover { background: #166534; }
.cr-btn-gray { background: #e2e8f0; color: #475569; }
.cr-btn-gray:hover { background: #cbd5e1; }
.cr-btn-red { background: #ef4444; color: #fff; }
.cr-btn-red:hover { background: #dc2626; }
.cr-tranche-row:hover, .cr-use-row:not(.cr-use-hidden):hover { background: #f8fafc; }
.cr-filter-row { display: flex; flex-wrap: wrap; gap: 5px; }
.cr-filter-pill { padding: 3px 10px; font-size: 11px; font-weight: 600; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #64748b; cursor: pointer; white-space: nowrap; }
.cr-filter-pill:hover { background: #f1f5f9; }
.cr-filter-pill-active { background: #1a2e4a; border-color: #1a2e4a; color: #fff; }

/* ── Spend Tracker v2 ───────────────────────────────────────────────────── */
.st-table { width:100%; border-collapse:collapse; font-size:13px; }
.st-table thead th { padding:9px 12px; background:#f8fafc; border-bottom:2px solid #e2e8f0; color:#64748b; font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.st-table thead th:nth-child(7), .st-table thead th:nth-child(8) { text-align:right; }
.st-brand-hdr { background:#f0f4f8; cursor:pointer; border-top:2px solid #e2e8f0; }
.st-brand-hdr:hover { background:#e8eef5; }
.st-brand-hdr-cell { padding:9px 14px; }
.st-chevron { font-size:10px; transition:transform .15s; color:#64748b; flex-shrink:0; }
.st-chevron-open { transform:rotate(90deg); }
.st-brand-lbl { font-weight:700; font-size:13px; color:#1a2e4a; cursor:pointer; text-decoration:underline; text-underline-offset:2px; text-decoration-color:rgba(30,50,80,.25); white-space:nowrap; }
.st-brand-lbl:hover { text-decoration-color:#1a2e4a; }
.st-brand-planned { font-size:12px; font-weight:600; color:#059669; margin-left:6px; }
.st-brand-meta { font-size:11px; color:#64748b; white-space:nowrap; }
.st-add-btn { padding:3px 10px; font-size:11px; font-weight:700; background:#15803d; color:#fff; border:none; border-radius:4px; cursor:pointer; white-space:nowrap; }
.st-add-btn:hover { background:#166534; }
.st-data-row:hover { background:#f0f9ff; }
.st-cell { padding:8px 12px; border-bottom:1px solid #f1f5f9; color:#334155; vertical-align:middle; min-width:80px; cursor:text; position:relative; }
.st-cell:hover { background:#eff6ff; outline:1px dashed #93c5fd; }
.st-amt-cell { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.st-desc-cell { min-width:160px; }
.st-edit-btn { background:none; border:none; color:#cbd5e1; font-size:14px; cursor:pointer; padding:0 3px; line-height:1; }
.st-edit-btn:hover { color:#3b82f6; }
.st-del-btn { background:none; border:none; color:#e2e8f0; font-size:16px; cursor:pointer; padding:0 4px; line-height:1; }
.st-del-btn:hover { color:#ef4444; }
.st-inline-inp { width:100%; border:1px solid #2563eb; border-radius:3px; padding:4px 6px; font-size:13px; font-family:inherit; outline:none; box-shadow:0 0 0 2px rgba(37,99,235,.2); }
.st-src-chip { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
.st-chip-winery  { background:#dbeafe; color:#1e40af; }
.st-chip-ap      { background:#fef9c3; color:#a16207; }
.st-chip-mas     { background:#dcfce7; color:#166534; }
.st-chip-tariff  { background:#fee2e2; color:#c62828; }
.st-chip-split   { background:#fef3c7; color:#92400e; }
/* Searchable dropdown */
.st-dd-anchor { position:relative; }
.st-dd-search { width:100%; padding:5px 8px; border:1px solid #2563eb; border-bottom:none; border-radius:4px 4px 0 0; font-size:12px; box-sizing:border-box; outline:none; background:#fff; }
.st-dd-list { position:absolute; top:100%; left:0; min-width:100%; max-height:220px; overflow-y:auto; background:#fff; border:1px solid #2563eb; border-radius:0 0 4px 4px; z-index:9999; box-shadow:0 4px 16px rgba(0,0,0,.14); }
.st-dd-opt { padding:5px 10px; font-size:12px; cursor:pointer; white-space:nowrap; }
.st-dd-opt:hover, .st-dd-opt:focus { background:#eff6ff; outline:none; }
.st-dd-selected { background:#e0f2fe; color:#0277bd; font-weight:600; }
.st-dd-addnew { color:#2563eb; font-style:italic; border-top:1px solid #e2e8f0; }
.st-kpi-card { background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 20px rgba(0,0,0,.12); min-width:240px; overflow:hidden; }
.st-kpi-title { padding:10px 14px; background:#1a2e4a; color:#fff; font-weight:700; font-size:13px; }
.st-kpi-tbl { width:100%; border-collapse:collapse; }
.st-kpi-tbl td { padding:6px 14px; font-size:12px; color:#334155; }
.st-kpi-tbl tr:nth-child(even) { background:#f8fafc; }
.st-kpi-total-row td { font-weight:700; border-bottom:1px solid #e2e8f0; }
.st-kpi-sub td { color:#64748b; padding-left:24px; font-size:11px; }

/* ── Lead Slide-out: Notes, Email, Granola, AI Extract ──────────────────── */
.lead-note-history { max-height:220px; overflow-y:auto; margin-bottom:8px; border:1px solid #e2e8f0; border-radius:6px; background:#fafafa; }
.lead-note-item { padding:8px 10px; border-bottom:1px solid #f1f5f9; }
.lead-note-item:last-child { border-bottom:none; }
.lead-note-meta { font-size:11px; color:#94a3b8; margin-bottom:3px; }
.lead-note-text { font-size:12px; color:#334155; white-space:pre-wrap; }
.lead-note-empty { padding:10px; font-size:12px; color:#94a3b8; text-align:center; }
.lead-note-history-btn { font-size:11px; font-weight:600; color:#2563eb; background:none; border:none; cursor:pointer; padding:0; }
.lead-note-history-btn:hover { text-decoration:underline; }
.lead-note-add-btn { padding:6px 14px; font-size:12px; font-weight:600; background:#1a2e4a; color:#fff; border:none; border-radius:5px; cursor:pointer; white-space:nowrap; align-self:flex-end; }
.lead-note-add-btn:hover { background:#2563eb; }
.lead-note-add-btn:disabled { opacity:.5; cursor:not-allowed; }
.lead-src-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
.lead-src-email { background:#dbeafe; color:#1e40af; }
.lead-src-granola { background:#f3e8ff; color:#7c3aed; }
.lead-src-expand-btn { font-size:11px; font-weight:600; color:#2563eb; background:none; border:none; cursor:pointer; padding:0; }
.lead-src-expand-btn:hover { text-decoration:underline; }
.lead-src-view-link { font-size:11px; font-weight:600; color:#2563eb; text-decoration:none; }
.lead-src-view-link:hover { text-decoration:underline; }
.lead-extract-hint { font-size:11px; color:#94a3b8; margin-bottom:6px; line-height:1.5; }
.lead-extract-btn { margin-top:6px; padding:7px 16px; font-size:12px; font-weight:700; background:#7c3aed; color:#fff; border:none; border-radius:5px; cursor:pointer; }
.lead-extract-btn:hover { background:#6d28d9; }
.lead-extract-btn:disabled { opacity:.5; cursor:not-allowed; }

/* ── SKU Focus Tab ──────────────────────────────────────────────────────── */
.skuf-table { width:100%; border-collapse:collapse; font-size:13px; }
.skuf-table thead th { padding:8px 10px; text-align:left; font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.4px; border-bottom:2px solid #e2e8f0; white-space:nowrap; }
.skuf-row td { padding:9px 10px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.skuf-row:hover td { background:#f8fafc; }
.skuf-row.skuf-dirty td { background:#fffbeb; }
.skuf-name { font-weight:600; color:#1e293b; }
.skuf-sales { color:#475569; text-align:right; font-variant-numeric:tabular-nums; }
.skuf-pill-cell { white-space:nowrap; }
/* Status + flags pills */
.skuf-pill { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:20px; border:1px solid; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; transition:opacity .1s; }
.skuf-pill:hover { opacity:.85; }
.skuf-pill-core    { background:#dbeafe; color:#1d4ed8; border-color:#bfdbfe; }
.skuf-pill-noncore { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
.skuf-pill-unset   { background:#f1f5f9; color:#94a3b8; border-color:#e2e8f0; }
.skuf-pill-flags-on  { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.skuf-pill-flags-off { background:#f8fafc; color:#94a3b8; border-color:#e2e8f0; font-weight:400; }
/* Dropdown */
.skuf-drop { position:absolute; z-index:9999; background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.12); padding:4px; min-width:120px; }
.skuf-drop-item { padding:7px 12px; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer; }
.skuf-drop-item:hover { background:#f1f5f9; }
.skuf-drop-core    { color:#1d4ed8; }
.skuf-drop-noncore { color:#15803d; }
.skuf-drop-clear   { color:#94a3b8; font-weight:400; }
/* Flag checkboxes inside dropdown */
.skuf-drop-check-item { display:flex; align-items:center; gap:8px; padding:7px 12px; border-radius:6px; font-size:13px; cursor:pointer; color:#334155; }
.skuf-drop-check-item:hover { background:#f1f5f9; }
.skuf-chk { display:inline-block; width:14px; height:14px; border:2px solid #cbd5e1; border-radius:3px; flex-shrink:0; }
.skuf-chk.on { background:#f59e0b; border-color:#f59e0b; }
/* Last sale date column */
.skuf-last-sale { font-size:12px; color:#64748b; white-space:nowrap; }
/* Other SKUs chevron row */
.skuf-other-header td { padding:10px 10px; background:#f8fafc; cursor:pointer; border-top:2px solid #e2e8f0; border-bottom:1px solid #e2e8f0; }
.skuf-other-header:hover td { background:#f1f5f9; }
.skuf-chevron { display:inline-block; font-size:11px; margin-right:6px; color:#64748b; transition:transform .15s; }
/* Per-row expand chevron */
.skuf-row-chevron { display:inline-block; font-size:10px; color:#94a3b8; cursor:pointer; margin-right:4px; width:12px; text-align:center; transition:color .1s; user-select:none; }
.skuf-row-chevron:hover { color:#475569; }
.skuf-row-chevron.open { color:#2563eb; }
.skuf-chevron-placeholder { display:inline-block; width:12px; margin-right:4px; }
/* SKU sub-rows */
.skuf-sku-row td { padding:6px 10px; border-bottom:1px solid #f8fafc; background:#f8fafc; font-size:12px; }
.skuf-sku-row:last-of-type td { border-bottom:1px solid #e2e8f0; }
.skuf-sku-name { color:#475569; }
/* Vintage badges */
.skuf-vbadge { display:inline-block; padding:1px 6px; border-radius:8px; font-size:10px; font-weight:700; margin-left:5px; vertical-align:middle; }
.skuf-vbadge-current  { background:#dcfce7; color:#15803d; }
.skuf-vbadge-clearance { background:#fef9c3; color:#854d0e; }
.skuf-vbadge-dnr      { background:#f1f5f9; color:#94a3b8; }

/* Warehouse on-hand link + popup */
.skuf-inv-link { color:#2563eb; cursor:pointer; text-decoration:underline dotted; white-space:nowrap; }
.skuf-inv-link:hover { color:#1d4ed8; }
.skuf-wh-pop { position:absolute; z-index:9999; background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.12); padding:10px 14px; min-width:160px; font-size:13px; }
.skuf-wh-pop-title { font-weight:700; color:#334155; margin-bottom:6px; font-size:12px; text-transform:uppercase; letter-spacing:0.4px; }
.skuf-wh-row { display:flex; justify-content:space-between; align-items:center; padding:3px 0; border-bottom:1px solid #f1f5f9; }
.skuf-wh-row:last-child { border-bottom:none; }
.skuf-wh-label { color:#64748b; }
.skuf-wh-val { font-weight:600; color:#1e293b; }
.skuf-wh-empty { color:#94a3b8; font-style:italic; }

/* ── Distribution Setup table ─────────────────────────────────── */
.setup-table { border: 1px solid #e2e8f0; border-radius: 7px; overflow: hidden; }
.setup-header {
    display: grid; grid-template-columns: 60px 210px 120px 1fr;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
    font-size: 11px; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.setup-row {
    display: grid; grid-template-columns: 60px 210px 120px 1fr;
    border-bottom: 1px solid #f1f5f9; align-items: start;
}
.setup-row:last-child { border-bottom: none; }
.setup-row:hover { background: #fafbfc; }
.setup-cell { padding: 10px 12px; font-size: 13px; }
.setup-state { font-weight: 700; color: #1a2e4a; font-size: 12px; align-self: center; }
.setup-type { align-self: center; }
.setup-type-select {
    width: 100%; padding: 5px 8px; font-size: 12px;
    border: 1px solid #d1d9e6; border-radius: 4px;
    background: #fff; color: #1a2e4a;
    border-left-width: 3px;
}
.setup-type-select:focus { outline: none; border-color: #2F5496; }
.setup-plan { cursor: pointer; }
.setup-plan:hover .setup-plan-preview { color: #2F5496; }
.setup-plan-preview { font-size: 12px; color: #475569; line-height: 1.4; white-space: pre-wrap; }
.setup-plan-ta {
    width: 100%; box-sizing: border-box;
    border: 1px solid #2F5496; border-radius: 4px;
    padding: 7px 9px; font-size: 12px; font-family: inherit;
    resize: vertical; background: #fff; color: #1a2e4a; line-height: 1.5;
}
.setup-plan-ta:focus { outline: none; }
.setup-due { align-self: center; }
.setup-due-input {
    width: 100%; padding: 5px 6px; font-size: 12px;
    border: 1px solid #d1d9e6; border-radius: 4px;
    background: #fff; color: #1a2e4a;
}
.setup-due-input:focus { outline: none; border-color: #2F5496; }
