* { 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; }

/* Header */
.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: 12px 20px 28px 20px; }
.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 detail page */
.brand-detail { display: none; }
.brand-detail.active { display: block; }

.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #2F5496; cursor: pointer; margin-bottom: 20px; font-weight: 500; }
.back-btn:hover { text-decoration: underline; }

.brand-hero { background: #fff; border-radius: 10px; padding: 24px 28px; margin-bottom: 20px; border: 1px solid #e8ecf0; }
.brand-hero h2 { font-size: 26px; font-weight: 700; color: #1a2e4a; }
.brand-hero-sub { font-size: 13px; color: #888; margin-top: 4px; margin-bottom: 20px; }
.kpi-row { display: flex; gap: 24px; flex-wrap: wrap; }
.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; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto; padding: 0 0 8px 0; }
.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; }

/* 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: 8px 16px; cursor: pointer; font-size: 13.5px; 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: 12px; margin-bottom: 14px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.brand-top-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.brand-top-label { font-size: 10px; color: #94a3b8; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-right: 8px; min-width: 70px; }
.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; }

/* 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; }

/* ── 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; }

/* ── Three-column inner layout: pipeline | sales-by-year | product families ── */
.state-expand-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; }
.state-expand-left  { padding: 14px 16px 14px 20px; border-right: 1px solid #e2e8f0; }
.state-expand-mid   { padding: 14px 16px; border-right: 1px solid #e2e8f0; }
.state-expand-right { padding: 14px 16px; }

/* ── 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: 12px 20px; display: flex; overflow-x: auto; gap: 8px; }
.hub-nav-tab { padding: 8px 16px; font-size: 13.5px; 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,
#tools-panel .container { padding-top: 14px; }

/* ── 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: 190px; 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; }
    .state-expand-inner { grid-template-columns: 1fr; }
    .state-expand-left { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .state-expand-mid  { border-right: none; border-bottom: 1px solid #e2e8f0; }
}

/* 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;
}
