/* ============================================================
   Inventory Ally — Brand Design System
   brand.css: single source of truth for all dashboard styles
   ============================================================ */

/* ── 1. CSS VARIABLES ─────────────────────────────────────── */
:root {
  --ia-pink:          #C45AB3;
  --ia-pink-lt:       #F7E8F5;
  --ia-green:         #4E9E78;
  --ia-green-dk:      #2D5A42;
  --ia-green-lt:      #E8F5EE;
  --ia-green-banner:  #3D7A5E;
  --ia-slate:         #3D4F6B;
  --ia-slate-lt:      #EBF0F8;
  --ia-beige:         #FFFDF2;
  --ia-beige-d:       #F5F1E0;
  --ia-beige-b:       #E8E3CC;
  --ia-text-muted:    #6B6B60;
  --ia-black:         #1A1A18;
}

/* ── 2. RESET + BODY ──────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--ia-beige);
  color: var(--ia-black);
  line-height: 1.5;
}

/* ── 3. SHARED NAV ────────────────────────────────────────── */
.top-nav {
  background: var(--ia-beige);
  border-bottom: 0.5px solid var(--ia-beige-b);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 27px;
  height: 27px;
  background: var(--ia-green-banner);
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-logo-icon img {
  width: 27px;
  height: 27px;
  object-fit: cover;
  object-position: center;
  border-radius: 7px;
  display: block;
}
.nav-logo-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ia-black);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px;
  height: 28px;
  background: var(--ia-green-banner);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}
.logout-link {
  font-size: 12px;
  color: var(--ia-text-muted);
  text-decoration: none;
}
.logout-link:hover { color: var(--ia-green-dk); }

/* Tab nav */
.tab-nav {
  background: var(--ia-beige);
  border-bottom: 0.5px solid var(--ia-beige-b);
  padding: 0 24px;
}
.tab-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
}
.tab-link {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ia-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-link:hover { color: var(--ia-green-dk); }
.tab-link.active {
  color: var(--ia-green-dk);
  font-weight: 500;
  border-bottom-color: var(--ia-green);
}

/* Pipeline page — slate active state override */
.pipeline-page .tab-link.active {
  color: var(--ia-slate);
  border-bottom-color: var(--ia-slate);
}
.pipeline-page .nav-logo-icon {
  background: var(--ia-slate);
}
.pipeline-page .avatar {
  background: var(--ia-slate);
}

/* Nav selectors (period/AE) */
.ae-selector,
.period-selector {
  padding: 6px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--ia-beige-b);
  background: white;
  font-size: 13px;
  font-family: inherit;
}
.period-selector { min-width: 190px; }

/* ── 4. MAIN CONTENT WRAPPER ──────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 24px;
}

/* ── 5. GLOBAL BADGE STYLES ───────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .03em;
  white-space: nowrap;
  display: inline-block;
}
.badge-won        { background: var(--ia-green-lt);  color: var(--ia-green-dk); }
.badge-reassign   { background: #FFF0E6;              color: #A04010; }
.badge-churned    { background: var(--ia-pink-lt);   color: var(--ia-pink); }
.badge-demo       { background: #EEF3FF;              color: #3050A0; }
.badge-cs         { background: #F0ECFF;              color: #5040A0; }
.badge-not-csm    { background: var(--ia-beige-d);   color: var(--ia-text-muted); }
.badge-risk       { background: var(--ia-pink-lt);   color: var(--ia-pink); }
.badge-active     { background: var(--ia-green-lt);  color: var(--ia-green-dk); }
.badge-historical { background: #FEF3C7;              color: #92400e; }
.badge-unmatched  { background: var(--ia-pink-lt);   color: var(--ia-pink); }
.badge-test       { background: #F0ECFF;              color: #5040A0; }
.badge-onboarding { background: var(--ia-green-lt);  color: var(--ia-green-dk); }

/* ── 6. HOME PAGE ─────────────────────────────────────────── */
.live-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 32px;
}
.live-card {
  border-radius: 10px;
  padding: 20px;
  min-height: 130px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.live-card:hover { opacity: 0.92; }
.live-card.commission { background: var(--ia-green-banner); }
.live-card.pipeline   { background: var(--ia-slate); }
.live-card::before {
  content: '';
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  top: -50px; right: -40px;
  pointer-events: none;
}
.live-card::after {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -30px; right: 60px;
  pointer-events: none;
}
.lc-live {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  position: relative;
  z-index: 1;
}
.lc-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  position: relative;
  z-index: 1;
}
.lc-sub {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}
.lc-arrow {
  font-size: 16px;
  color: rgba(255,255,255,.4);
  text-align: right;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
.lc-body { position: relative; z-index: 1; }

/* Home — historical section */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ia-text-muted);
  margin-bottom: 12px;
}
details {
  margin-bottom: 8px;
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 10px;
  overflow: hidden;
}
details[open] { border-color: var(--ia-beige-b); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: var(--ia-beige); }
.year-label { font-size: 14px; font-weight: 500; color: var(--ia-black); }
.year-meta { display: flex; align-items: center; gap: 12px; }
.year-count { font-size: 12px; color: var(--ia-text-muted); font-weight: 500; }
.chevron { font-size: 13px; color: var(--ia-text-muted); transition: transform 0.15s; }
details[open] .chevron { transform: rotate(180deg); }

.period-list {
  padding: 4px 12px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ia-beige-b);
}
.period-card {
  display: block;
  background: white;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ia-black);
  transition: background 0.12s;
}
.period-card:hover { background: var(--ia-beige); }
.period-dates { font-size: 12px; font-weight: 500; }
.period-sub   { font-size: 10px; color: var(--ia-text-muted); margin-top: 2px; }

.no-history {
  background: white;
  border: 0.5px dashed var(--ia-beige-b);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  color: var(--ia-text-muted);
  font-size: 14px;
}

/* Home page header */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 20px; font-weight: 600; color: var(--ia-black); }
.page-header p  { color: var(--ia-text-muted); margin-top: 4px; font-size: 13px; }

/* ── 7. SHARED BANNER ─────────────────────────────────────── */
.banner {
  background: var(--ia-green-banner);
  border-radius: 12px;
  padding: 20px 28px;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Pipeline banner overrides — use body.pipeline-page or .banner.pipeline */
.pipeline-page .banner { background: var(--ia-slate); }

.banner-left  { display: flex; flex-direction: column; gap: 4px; }
.banner-title { font-size: 16px; font-weight: 600; }
.banner-subtitle { font-size: 11px; color: rgba(255,255,255,.6); }
.banner-meta {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner-refresh-btn {
  padding: 3px 10px;
  border-radius: 5px;
  border: 0.5px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: inherit;
}
.banner-refresh-btn:hover { background: rgba(255,255,255,.25); }

.banner-right { display: flex; align-items: center; gap: 32px; }
.banner-col   { text-align: right; }
.banner-col-label {
  font-size: 9px;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.banner-col-val    { font-size: 24px; font-weight: 600; margin-top: 2px; }
.banner-col-val-sm { font-size: 20px; font-weight: 600; margin-top: 2px; }
.banner-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.badge-hist { background: #fef3c7; color: #92400e; }
.badge-test-banner { background: #ede9fe; color: #5b21b6; }

/* ── 8. TOOLTIPS ──────────────────────────────────────────── */
.tipwrap { position: relative; display: inline-flex; align-items: center; }
.tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ia-beige-d); color: var(--ia-text-muted);
  font-size: 9px; font-weight: 700; cursor: default;
  margin-left: 5px; flex-shrink: 0; line-height: 1;
}
.tip-icon:hover + .tip-box,
.tip-icon:focus + .tip-box { opacity: 1; pointer-events: auto; }
.tip-box {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: white;
  font-size: 11px; line-height: 1.5; padding: 6px 10px;
  border-radius: 6px; white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
  z-index: 200; max-width: 220px; text-align: left;
}
.tip-box::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
}

/* ── 9. STAT GRID (Dashboard) ─────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ia-beige-b);
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  overflow: visible;
  gap: 1px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  padding: 20px 22px;
  position: relative;
}
.stat-card:first-child { border-radius: 11px 0 0 11px; }
.stat-card:last-child  { border-radius: 0 11px 11px 0; }
.stat-card-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ia-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-card-val {
  font-size: 20px;
  font-weight: 500;
  color: var(--ia-black);
  margin-top: 6px;
}
.stat-card-sub { font-size: 11px; color: var(--ia-text-muted); margin-top: 4px; }
.stat-card-sub.green { color: var(--ia-green); font-weight: 500; }
.stat-card-sub.red   { color: var(--ia-pink);  font-weight: 500; }

/* ── 10. TIER PROGRESS (Dashboard) ───────────────────────── */
.tier-section {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
}
.tier-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.tier-title  { font-size: 15px; font-weight: 600; color: var(--ia-black); }
.tier-period { font-size: 12px; color: var(--ia-text-muted); }
.tier-meta   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tier-arr    { font-size: 13px; color: var(--ia-text-muted); }
.tier-arr strong { color: var(--ia-green); }
.tier-current { font-size: 13px; font-weight: 600; color: var(--ia-black); }

.tier-bar-wrap {
  position: relative;
  height: 7px;
  border-radius: 4px;
  background: var(--ia-beige-d);
  display: flex;
  overflow: visible;
}
.tier-seg { position: relative; cursor: default; height: 7px; border-radius: 4px; }
.tier-seg-1 { background: var(--ia-green); border-radius: 4px 0 0 4px; }
.tier-seg-2 { background: var(--ia-green); }
.tier-seg-3 { background: var(--ia-green-lt); border-radius: 0 4px 4px 0; }
.tier-seg:hover .tier-seg-tip { opacity: 1; pointer-events: auto; }
.tier-seg-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: white;
  font-size: 11px; line-height: 1.5; padding: 6px 10px;
  border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 200;
}
.tier-seg-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
}
.tier-unfill {
  position: absolute; top: 0; bottom: 0; right: 0;
  background: var(--ia-green-lt); border-radius: 0 4px 4px 0;
  pointer-events: none;
}
.tier-marker {
  position: absolute; top: -4px; bottom: -4px; width: 3px;
  background: white; border-radius: 2px;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.18); z-index: 10; cursor: default;
}
.tier-marker:hover .tier-marker-tip { opacity: 1; }
.tier-marker-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: white;
  font-size: 11px; line-height: 1.5; padding: 6px 10px;
  border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 200;
}
.tier-marker-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
}

/* ── 11. HOLDBACK EQUATION (Dashboard) ───────────────────── */
.hb-equation {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  padding: 18px 28px;
  margin-bottom: 24px;
}
.hb-equation-title {
  font-size: 12px; font-weight: 700;
  color: var(--ia-text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.hb-equation:not([open]) { padding: 16px 28px; }
.hb-equation[open] .hb-equation-title {
  margin-bottom: 16px;
  border-bottom: 0.5px solid var(--ia-beige-b);
  padding-bottom: 12px;
}
.hb-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; font-size: 14px; color: var(--ia-text-muted);
  border-bottom: 0.5px solid var(--ia-beige-b);
}
.hb-row:last-of-type { border-bottom: none; }
.hb-row.total {
  border-top: 1px solid var(--ia-beige-b);
  margin-top: 6px; padding-top: 10px;
  font-size: 14px; font-weight: 500; color: var(--ia-black);
}
.hb-row.released  { color: var(--ia-green); }
.hb-row.forfeited { color: var(--ia-pink); }
.hb-val { font-weight: 600; }
.hb-row.total .hb-val { font-size: 14px; color: var(--ia-green-dk); }
.hb-period-note { font-size: 11px; color: var(--ia-text-muted); margin-top: 12px; line-height: 1.5; }
.hb-deal-list { margin-top: 14px; border-top: 0.5px solid var(--ia-beige-b); padding-top: 10px; }
.hb-deal-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 12px; color: var(--ia-text-muted);
}
.hb-outcome-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.hb-outcome-released  { background: var(--ia-green-lt);  color: var(--ia-green-dk); }
.hb-outcome-forfeited { background: var(--ia-pink-lt);   color: var(--ia-pink); }
.hb-outcome-pending   { background: #fef3c7; color: #92400e; }
.hb-churn-list { margin: 4px 0 8px 24px; display: flex; flex-direction: column; gap: 3px; }
.hb-churn-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ia-pink); padding: 2px 0; }
.hb-churn-hospital { font-weight: 500; }
.hb-churn-amount { font-variant-numeric: tabular-nums; }

/* ── 12. DEALS SECTION (Dashboard) ───────────────────────── */
.deals-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.deals-title  { font-size: 17px; font-weight: 600; color: var(--ia-black); }
.deals-count  { font-size: 13px; color: var(--ia-text-muted); }
.ae-group-header {
  font-size: 11px; font-weight: 700;
  color: var(--ia-pink);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--ia-beige-b);
}
.ae-group-header:first-child { margin-top: 0; }
.empty-deals {
  background: white;
  border: 0.5px dashed var(--ia-beige-b);
  border-radius: 12px;
  padding: 40px; text-align: center;
  color: var(--ia-text-muted); font-size: 14px;
}

/* ── 13. DEAL CARD (shared partial) ──────────────────────── */
.deal-card {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: visible;
}
.deal-card summary { display: block; cursor: pointer; list-style: none; }
.deal-card summary::-webkit-details-marker { display: none; }
.deal-card .summary-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
  transition: background 0.12s;
  border-radius: 9px;
}
.deal-card summary:hover .summary-row { background: var(--ia-beige); }
.deal-card[open] .summary-row { background: var(--ia-beige); border-radius: 9px 9px 0 0; }

.deal-card .expanded-detail {
  padding: 0 20px 18px;
  border-top: 0.5px solid var(--ia-beige-b);
  border-radius: 0 0 9px 9px;
}
.deal-card .detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.deal-card .detail-panel {
  background: var(--ia-beige);
  border-radius: 8px;
  padding: 14px 16px;
}
.deal-card .detail-panel-label {
  font-size: 10px; font-weight: 700;
  color: var(--ia-text-muted);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px;
}
.deal-card .detail-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 13px;
  border-bottom: 0.5px solid var(--ia-beige-b);
}
.deal-card .detail-row:last-child { border-bottom: none; }
.deal-card .detail-row-label { color: var(--ia-text-muted); }

.deal-card .commission-total {
  display: flex; justify-content: space-between;
  padding: 8px 0 5px;
  font-size: 14px; font-weight: 500;
  color: var(--ia-green-dk);
  border-top: 1px solid var(--ia-beige-b);
  margin-top: 2px;
}
.deal-card .flag-box {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #FFF8EC;
  border: 0.5px solid #F0C060;
  border-radius: 8px;
  font-size: 12px;
  color: #7A5010;
  line-height: 1.5;
}

/* ── 14. PAGE TITLES (non-banner pages) ───────────────────── */
.page-title   { font-size: 20px; font-weight: 600; color: var(--ia-black); }
.page-sub     { font-size: 13px; color: var(--ia-text-muted); margin-top: 3px; }
.generated-at { font-size: 12px; color: var(--ia-text-muted); }

/* ── 15. PIPELINE PAGE ────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 0.5px solid var(--ia-beige-b);
  background: white;
  font-size: 13px; font-weight: 500;
  color: var(--ia-text-muted);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.filter-btn:hover { border-color: var(--ia-green-banner); color: var(--ia-green-dk); }
.filter-btn.active { background: var(--ia-green-banner); border-color: var(--ia-green-banner); color: white; }

.pipeline-table {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  overflow: hidden;
}
.pipeline-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1.2fr 1fr;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--ia-beige-b);
  gap: 12px;
}
.pipeline-row:last-child { border-bottom: none; }
.pipeline-row:hover { background: var(--ia-beige); }
.pipeline-row.header {
  background: var(--ia-beige-d);
  border-bottom: 0.5px solid var(--ia-beige-b);
}
.pipeline-row.header div {
  font-size: 11px; font-weight: 700;
  color: var(--ia-text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.pipeline-row:not(.header) { cursor: pointer; }
.pipeline-row:not(.header):hover { background: var(--ia-beige); }

.sort-col { cursor: pointer; user-select: none; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.sort-col:hover { color: var(--ia-green-dk); }
.sort-arrow       { font-size: 10px; color: var(--ia-beige-b); }
.sort-arrow.asc   { color: var(--ia-green); }
.sort-arrow.desc  { color: var(--ia-green); }

.deal-company { font-size: 14px; font-weight: 600; color: var(--ia-black); }
.deal-meta    { font-size: 12px; color: var(--ia-text-muted); margin-top: 2px; }
.deal-mrr     { font-size: 14px; font-weight: 600; color: var(--ia-black); }
.deal-arr     { font-size: 14px; font-weight: 600; color: var(--ia-black); }
.est-label    { font-size: 10px; color: var(--ia-text-muted); margin-top: 1px; }
.deal-commission         { font-size: 14px; font-weight: 700; color: var(--ia-green-dk); }
.deal-commission.pending { color: var(--ia-text-muted); font-weight: 500; font-size: 12px; }

.expand-hint { font-size: 10px; color: var(--ia-text-muted); margin-top: 4px; }

.pipeline-drill {
  background: var(--ia-beige);
  border-bottom: 0.5px solid var(--ia-beige-b);
  padding: 14px 24px;
}
.drill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; font-size: 13px;
}
.drill-label {
  font-size: 9px; font-weight: 700;
  color: var(--ia-text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 4px;
}
.drill-val { font-weight: 600; color: var(--ia-black); }

/* Stage badges (pipeline) */
.stage-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.stage-won       { background: var(--ia-green-lt);  color: var(--ia-green-dk); }
.stage-transfer  { background: #FEF3C7;              color: #92400e; }   /* In Setup */
.stage-demo      { background: #EEF3FF;              color: #3050A0; }   /* Demo Scheduled */
.stage-negotiate { background: #F3EEFF;              color: #5B21B6; }   /* Negotiation / Considering */
.stage-default   { background: var(--ia-beige-d);   color: var(--ia-text-muted); }
.stage-churned   { background: var(--ia-pink-lt, #fce8ef); color: var(--ia-pink-dk, #c0306a); }

/* ── Churned / Holdback-at-Risk section ───────────────────── */
.churn-section > summary { padding: 6px 0; user-select: none; }
.churn-section > summary .churn-toggle-hint { transition: opacity .15s; }
.churn-section[open] > summary .churn-toggle-hint { opacity: 0; }

/* CSM badges (pipeline) */
.csm-badge      { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.csm-active     { background: var(--ia-green-lt);  color: var(--ia-green-dk); }
.csm-onboarding { background: #F0ECFF;              color: #5040A0; }
.csm-at-risk    { background: var(--ia-pink-lt);   color: var(--ia-pink); }
.csm-churned    { background: var(--ia-beige-d);   color: var(--ia-text-muted); }

/* At-risk banner */
.risk-banner {
  background: var(--ia-pink-lt);
  border: 0.5px solid var(--ia-pink);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 14px;
}
.risk-banner-icon  { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.risk-banner-title { font-size: 14px; font-weight: 700; color: var(--ia-pink); margin-bottom: 4px; }
.risk-banner-names { font-size: 13px; color: var(--ia-pink); font-weight: 500; }
.risk-banner-details {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
.risk-banner-details summary { list-style: none; }
.risk-banner-details summary::-webkit-details-marker { display: none; }

/* Pipeline empty state */
.empty-state       { padding: 60px 24px; text-align: center; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--ia-black); margin-bottom: 8px; }
.empty-state-body  { font-size: 14px; color: var(--ia-text-muted); line-height: 1.7; }
.empty-state code  { background: var(--ia-beige-d); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--ia-green-dk); }

/* Contextual column visibility */
.col-commission { }
.col-csm        { }
.col-stage      { }
.pipeline-table[data-view="csm"]   .col-commission { display: none; }
.pipeline-table[data-view="sales"] .col-csm        { display: none; }

/* Date filter bar */
.date-filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.date-input {
  padding: 6px 10px; border-radius: 6px;
  border: 0.5px solid var(--ia-beige-b);
  background: white; font-size: 13px; font-family: inherit;
}

/* ── 16. UNMATCHED PAGE ───────────────────────────────────── */
.summary-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.summary-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.chip-total   { background: #fef3c7; color: #92400e; }
.chip-noguid  { background: #fef9c3; color: #854d0e; }
.chip-notindb { background: #ffedd5; color: #9a3412; }
.chip-sub     { background: var(--ia-beige-d); color: var(--ia-text-muted); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.6; }

.um-table { background: white; border: 0.5px solid #fde68a; border-radius: 12px; overflow: hidden; }
.um-row {
  display: grid;
  grid-template-columns: 2.4fr 0.85fr 0.85fr 2.1fr 2fr;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 0.5px solid var(--ia-beige-b);
  gap: 14px;
}
.um-row:last-child { border-bottom: none; }
.um-row:hover:not(.um-header) { background: #fffbeb; }
.um-row.um-header { background: #fffbeb; border-bottom: 0.5px solid #fde68a; }
.um-row.um-header div {
  font-size: 11px; font-weight: 700;
  color: #92400e; text-transform: uppercase; letter-spacing: .06em;
}
.um-clinic   { font-size: 14px; font-weight: 600; color: var(--ia-black); }
.um-dealname { font-size: 12px; color: var(--ia-text-muted); margin-top: 2px; }
.um-period   { font-size: 12px; color: var(--ia-text-muted); }
.um-date     { font-size: 13px; color: var(--ia-text-muted); }
.um-badge    { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.um-guid     { font-size: 10px; font-family: monospace; color: var(--ia-text-muted); word-break: break-all; margin-top: 3px; }
.um-guid-missing { font-size: 12px; font-weight: 600; color: var(--ia-pink); }

/* Rerun panel */
.rerun-panel {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 28px;
}
.rerun-panel-title { font-size: 14px; font-weight: 700; color: var(--ia-black); margin-bottom: 4px; }
.rerun-panel-sub   { font-size: 13px; color: var(--ia-text-muted); margin-bottom: 16px; }
.rerun-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 0.5px solid var(--ia-beige-b); gap: 16px;
}
.rerun-row:last-child { border-bottom: none; padding-bottom: 0; }
.rerun-period-label { font-size: 13px; font-weight: 600; color: var(--ia-black); }
.rerun-deal-count   { font-size: 12px; color: var(--ia-text-muted); margin-top: 2px; }
.rerun-right  { display: flex; align-items: center; gap: 12px; }
.rerun-btn {
  padding: 6px 16px; border-radius: 7px;
  border: 0.5px solid var(--ia-green-banner);
  background: white; color: var(--ia-green-dk);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.12s; white-space: nowrap; font-family: inherit;
}
.rerun-btn:hover:not(:disabled) { background: var(--ia-green-banner); color: white; }
.rerun-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rerun-status     { font-size: 12px; min-width: 0; }
.rerun-status.ok  { color: var(--ia-green); }
.rerun-status.err { color: var(--ia-pink); }
.period-select    { padding: 0.4rem 0.6rem; border-radius: 6px; border: 1px solid var(--ia-border); font-size: 0.85rem; background: white; }

/* ── 17. STATUS PAGE ──────────────────────────────────────── */
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.status-card {
  background: white;
  border: 0.5px solid var(--ia-beige-b);
  border-radius: 12px;
  padding: 22px 24px;
}
.status-card.warn { border-color: #fde68a; background: #fffbeb; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ia-text-muted); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill-ok   { background: var(--ia-green-lt); color: var(--ia-green-dk); }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-gray { background: var(--ia-beige-d); color: var(--ia-text-muted); }
.pill-dot  { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.metric-row   { display: flex; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.metric-val   { font-size: 26px; font-weight: 700; color: var(--ia-black); line-height: 1.1; }
.metric-val.dim   { color: var(--ia-text-muted); font-size: 20px; }
.metric-val.amber { color: var(--ia-pink); }
.metric-label { font-size: 11px; color: var(--ia-text-muted); margin-top: 3px; }
.card-detail  { font-size: 12px; color: var(--ia-text-muted); margin-bottom: 4px; }
.card-detail strong { color: var(--ia-black); }
.card-link {
  display: inline-block; margin-top: 14px;
  font-size: 12px; font-weight: 600;
  color: var(--ia-green); text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

/* ── 18. LOGIN PAGE ───────────────────────────────────────── */
.left-panel {
  width: 52%;
  background: var(--ia-green-banner);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}
.left-panel::before {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  top: -120px; right: -160px;
}
.left-panel::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  bottom: -80px; left: -80px;
}
.left-logo      { display: flex; align-items: center; gap: 12px; }
.left-logo-icon {
  width: 32px; height: 32px;
  background: var(--ia-pink);
  border-radius: 8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.left-logo-icon img {
  width: 32px; height: 32px;
  object-fit: cover; object-position: center;
  display: block;
}
.left-logo-name { font-size: 18px; font-weight: 600; color: white; }
.left-body      { z-index: 1; position: relative; }
.left-headline  { font-size: 26px; font-weight: 600; color: white; line-height: 1.25; margin-bottom: 16px; }
.left-sub       { font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.6; max-width: 340px; }
.feature-tiles  { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; z-index: 1; }
.feature-tile   {
  background: rgba(255,255,255,.08);
  border: 0.5px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
}
.feature-icon        { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature-text-label  { font-size: 13px; font-weight: 600; color: white; }
.feature-text-sub    { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 1px; }
.left-footer    { font-size: 11px; color: rgba(255,255,255,.35); z-index: 1; position: relative; }

.right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: white;
}
.login-card {
  background: white;
  border-radius: 14px;
  border: 0.5px solid var(--ia-beige-b);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  padding: 44px 40px;
  width: 100%;
  max-width: 360px;
}
.card-eyebrow {
  font-size: 10px; font-weight: 600;
  color: var(--ia-pink);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 10px;
}
.card-title { font-size: 22px; font-weight: 600; color: var(--ia-black); margin-bottom: 6px; }
.card-sub   { font-size: 13px; color: var(--ia-text-muted); margin-bottom: 32px; line-height: 1.5; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: var(--ia-green-banner);
  color: white;
  padding: 13px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500; font-size: 14px;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(61,122,94,.3);
  border: none;
  font-family: inherit;
}
.btn-google:hover { background: var(--ia-green-dk); box-shadow: 0 4px 12px rgba(61,122,94,.35); }
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }
.card-footer { margin-top: 20px; font-size: 11px; color: var(--ia-text-muted); text-align: center; line-height: 1.6; }

/* ── 19. LOGIN MOBILE ─────────────────────────────────────── */
@media (max-width: 700px) {
  body { flex-direction: column; }
  .left-panel { width: 100%; padding: 28px 24px 32px; }
  .left-headline { font-size: 22px; }
  .feature-tiles { display: none; }
  .left-body .left-sub { display: none; }
  .left-footer { display: none; }
  .right-panel { padding: 32px 20px; }
  .login-card { padding: 32px 24px; }
}
