/* ───────── Reset & base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F4F6FA;
  color: #0F172A;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; }
table { border-collapse: collapse; }

/* ───────── Layout shell ───────── */
.app {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
}

/* ───────── Sidebar ───────── */
.sidebar {
  background: linear-gradient(180deg, #060A1A 0%, #0A0F26 50%, #0B0F22 100%);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column;
  padding: 16px 0;
  position: sticky; top: 0; height: 100vh;
  z-index: 5;
}
.sidebar-logo {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.sidebar-logo-img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
  padding: 2px;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 16px;
}
.sidebar-foot {
  margin-top: auto; padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-item {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: transparent; border: 0;
  color: rgba(255,255,255,0.5);
  transition: all .15s ease;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-item.is-active {
  background: #FAF7EC;
  color: #1B1809;
  box-shadow: 0 2px 8px rgba(244, 213, 141, 0.18);
}

/* ───────── Top bar ───────── */
.topbar {
  height: 64px;
  background: linear-gradient(90deg, #060A1A 0%, #0B1430 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0;
  z-index: 4;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-title { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.topbar-crumbs { display: flex; gap: 6px; align-items: center; font-size: 11px; color: rgba(255,255,255,0.45); }
.topbar-crumb-sep { color: rgba(255,255,255,0.22); }
.topbar-crumb.is-current { color: rgba(255,255,255,0.78); font-weight: 500; }

.topbar-right { display: flex; gap: 12px; align-items: center; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 12px;
  width: 360px; height: 38px;
  color: rgba(255,255,255,0.6);
}
.topbar-search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: #fff; font-size: 13px;
}
.topbar-search input::placeholder { color: rgba(255,255,255,0.4); }
.topbar-search kbd {
  font-family: inherit; font-size: 10px;
  background: rgba(255,255,255,0.08);
  padding: 2px 6px; border-radius: 4px;
  color: rgba(255,255,255,0.55);
}
.topbar-bell {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  display: grid; place-items: center;
}
.topbar-bell-dot {
  position: absolute; top: -4px; right: -4px;
  background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 600;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 5px;
  display: grid; place-items: center;
  border: 2px solid #060A1A;
}
.topbar-cta {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #FBF6E4, #F1E1A8);
  color: #1B1809;
  font-weight: 600; font-size: 13px;
  height: 38px; padding: 0 16px;
  border: 0; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(244, 213, 141, 0.32);
}
.topbar-cta:hover { filter: brightness(1.04); }

/* ───────── Page header ───────── */
.main { padding: 0; }
.page { padding: 24px 28px 80px; }
.pageheader {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.pageheader-title {
  margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  color: #0B1430;
}
.pageheader-sub { margin: 4px 0 0; color: #64748B; font-size: 14px; max-width: 720px; }
.pageheader-tools { display: flex; gap: 16px; align-items: flex-end; }
.pageheader-tool { display: flex; flex-direction: column; gap: 4px; }
.pageheader-tool label { font-size: 11px; color: #94A3B8; font-weight: 500; padding-left: 4px; }
.select { position: relative; }
.select select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #E2E8F0;
  background: #fff;
  padding: 0 32px 0 12px;
  height: 38px; min-width: 200px;
  border-radius: 10px;
  font: inherit; font-size: 13px;
  color: #0F172A;
}
.select svg { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #64748B; pointer-events: none; }
.seg-group {
  display: inline-flex;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 3px;
  height: 38px;
}
.seg-group.small { height: 32px; padding: 2px; }
.seg {
  background: transparent; border: 0;
  padding: 0 14px;
  font-size: 12px; font-weight: 500;
  color: #64748B;
  border-radius: 7px;
  min-width: 44px;
}
.seg-group.small .seg { font-size: 11.5px; padding: 0 12px; min-width: 40px; }
.seg.is-on {
  background: #FBF6E4; color: #1B1809;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.seg:hover:not(.is-on) { color: #0F172A; }

/* ───────── Hero KPI strip ───────── */
.hero {
  background:
    radial-gradient(800px 320px at 20% -20%, rgba(99,102,241,0.18) 0%, transparent 60%),
    radial-gradient(600px 240px at 90% 10%, rgba(34,197,94,0.12) 0%, transparent 60%),
    linear-gradient(135deg, #060A1A 0%, #0B1430 60%, #0E1740 100%);
  border-radius: 18px;
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 8px 32px rgba(11, 20, 48, 0.18);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(1200px 400px at 50% 120%, rgba(99,102,241,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
  position: relative;
}
.hero-head-left { display: flex; gap: 14px; align-items: center; }
.hero-head-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid; place-items: center;
  color: #FCD34D;
}
.hero-head-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.hero-head-sub { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.hero-head-meta { display: flex; gap: 18px; }
.hero-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.7); }
.hero-meta-dot { width: 8px; height: 8px; border-radius: 50%; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
}
.kpi-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 108px;
  backdrop-filter: blur(8px);
}
.kpi-row { display: flex; align-items: center; gap: 8px; }
.kpi-icon {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
}
.kpi-label {
  font-size: 11.5px; font-weight: 600;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.01em;
  flex: 1;
  display: inline-flex; align-items: center; gap: 5px;
}
.info-dot {
  position: relative;
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  color: rgba(255,255,255,0.4);
  cursor: help;
  outline: none;
}
.info-dot:hover, .info-dot:focus { color: rgba(255,255,255,0.8); }
.info-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #0F172A;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.32);
  opacity: 0; pointer-events: none;
  transition: opacity .12s ease;
  z-index: 50;
}
.info-tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0F172A;
}
.info-dot:hover .info-tip,
.info-dot:focus .info-tip { opacity: 1; }
/* For info dots inside light cards — invert tooltip to dark on light bg works fine since tip itself is dark */
.card .info-dot { color: #94A3B8; }
.card .info-dot:hover, .card .info-dot:focus { color: #475569; }
.kpi-delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}
.kpi-delta.is-up   { color: #4ADE80; background: rgba(34,197,94,0.12); }
.kpi-delta.is-down { color: #F87171; background: rgba(239,68,68,0.12); }
.kpi-value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.kpi-sub { font-size: 11px; color: rgba(255,255,255,0.5); }
.kpi-target {
  margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px;
  color: #FCD34D;
}

.hero-foot {
  margin-top: 14px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative;
  flex-wrap: wrap; gap: 10px;
}
.hero-foot-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.hero-foot-pill b { color: #fff; font-weight: 600; }
.hero-foot-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0;
  color: #93C5FD;
  font-size: 12.5px; font-weight: 500;
}
.link-btn:hover { color: #DBEAFE; }

/* ───────── Alert cards row ───────── */
.alerts-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.alert-card {
  border: 1px solid;
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 138px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.alert-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.alert-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.alert-card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.alert-card-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: lowercase;
}
.alert-card-count { font-weight: 700; font-size: 11px; }
.alert-card-title { font-size: 14px; font-weight: 600; color: #0F172A; line-height: 1.3; }
.alert-card-detail { font-size: 12px; color: #475569; line-height: 1.45; flex: 1; }
.alert-card-cta {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0; padding: 0;
  font-size: 12px; font-weight: 600;
  align-self: flex-start;
}

/* ───────── Generic card ───────── */
.card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head-left {
  display: flex; align-items: center; gap: 8px;
  color: #0F172A;
}
.card-head-left h2 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.card-head-count {
  font-size: 11px; font-weight: 500;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-head-right { display: flex; gap: 10px; align-items: center; }
.card-head-link {
  background: transparent; border: 0;
  color: #2563EB; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px; border-radius: 6px;
}
.card-head-link:hover { background: #EFF6FF; }

/* ───────── Main grid ───────── */
.main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.lower-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

/* ───────── Leaderboard ───────── */
.leaderboard { padding: 18px 0 6px; }
.leaderboard .card-head { padding: 0 18px 14px; margin-bottom: 0; }
.lb-table-wrap { overflow-x: auto; }
.lb-table {
  width: 100%;
  font-size: 12.5px;
}
.lb-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  text-align: left;
  padding: 10px 12px;
  background: #F8FAFC;
  border-top: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
}
.lb-table thead th.right { text-align: right; }
.lb-table thead th.sort-head { cursor: pointer; user-select: none; }
.sort-head-inner { display: inline-flex; align-items: center; gap: 4px; }
.lb-table thead th.right .sort-head-inner { justify-content: flex-end; width: 100%; }
.lb-table thead th.sort-head:hover { color: #475569; }
.sort-arrow { color: #CBD5E1; margin-left: 4px; font-size: 9px; }
.sort-arrow.is-on { color: #2563EB; }
.lb-row { transition: background .1s ease; }
.lb-row:hover { background: #F8FAFC; cursor: pointer; }
.lb-row td {
  padding: 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.lb-row td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: #0F172A; }
.lb-col-rank { width: 44px; text-align: center; }
.rank-pill {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600;
  background: #F1F5F9; color: #475569;
  margin: 0 auto;
}
.rank-pill.is-top { background: #DCFCE7; color: #15803D; }
.rank-pill.is-bot { background: #FEE2E2; color: #B91C1C; }
.lb-name { font-weight: 600; color: #0F172A; font-size: 13px; }
.lb-sub { font-size: 11px; color: #94A3B8; margin-top: 2px; }
.lb-operator { color: #334155; font-size: 12.5px; font-weight: 500; }
.lb-open { color: #CBD5E1; width: 24px; }
.lb-row:hover .lb-open { color: #2563EB; }

.delta-text {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta-text.up   { color: #16A34A; }
.delta-text.down { color: #DC2626; }
.delta-text.down svg { transform: rotate(-90deg); }

.util-wrap { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.util-bar {
  width: 60px; height: 6px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
}
.util-bar.small { width: 80px; }
.util-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }

.nps-chip {
  display: inline-block;
  font-weight: 600; font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
}
.nps-chip.good { background: #DCFCE7; color: #15803D; }
.nps-chip.mid  { background: #FEF3C7; color: #B45309; }
.nps-chip.low  { background: #FEE2E2; color: #B91C1C; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-live { background: #DCFCE7; color: #15803D; }
.pill-pre  { background: #F3E8FF; color: #6B21A8; }

/* ───────── Charts ───────── */
.chart-card { padding: 18px; }
.chart-bigstat { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.bigstat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #16A34A; font-variant-numeric: tabular-nums; }
.bigstat-label { font-size: 11px; color: #94A3B8; margin-top: 2px; }
.bigstat-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.bigstat-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #F1F5F9; color: #475569;
}
.bigstat-tag.good { background: #DCFCE7; color: #15803D; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #64748B; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-grad {
  width: 80px; height: 8px;
  background: linear-gradient(90deg, #DCFCE7, #16A34A);
  border-radius: 4px;
  display: inline-block;
}
.legend-min, .legend-max { font-size: 10px; color: #94A3B8; }

/* ───────── Bar list ───────── */
.bar-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-list.small { gap: 10px; }
.bar-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 5px; }
.bar-list-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.bar-list-sub { font-size: 11px; color: #94A3B8; margin-top: 1px; }
.bar-list-val { font-size: 13px; font-weight: 600; color: #0F172A; font-variant-numeric: tabular-nums; }
.bar-list-bar { height: 6px; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.bar-list-fill { height: 100%; border-radius: 999px; }

/* ───────── Operators list ───────── */
.op-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.op-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; transition: background .1s ease; }
.op-list li:hover { background: #F8FAFC; }
.op-rank {
  width: 28px; height: 28px; border-radius: 8px;
  background: #F1F5F9; color: #475569;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.op-list li:nth-child(1) .op-rank { background: #FEF3C7; color: #B45309; }
.op-list li:nth-child(2) .op-rank { background: #E0E7FF; color: #3730A3; }
.op-list li:nth-child(3) .op-rank { background: #FFEDD5; color: #C2410C; }
.op-meta { flex: 1; }
.op-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.op-sub { font-size: 11px; color: #94A3B8; }
.op-num { text-align: right; }
.op-num-v { font-size: 13px; font-weight: 600; color: #0F172A; font-variant-numeric: tabular-nums; }

/* ───────── Pipeline ───────── */
.pipeline-card { padding: 18px; }
.pipe-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pipe-list li {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(220px, 1.6fr) 110px;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #F1F5F9;
  border-radius: 10px;
}
.pipe-list li:hover { border-color: #E2E8F0; background: #FAFBFD; }
.pipe-city { display: flex; gap: 10px; align-items: center; color: #475569; }
.pipe-city-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.pipe-city-sub { font-size: 11px; color: #94A3B8; }
.pipe-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pipe-step { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0.45; }
.pipe-step.is-on { opacity: 1; }
.pipe-step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #E2E8F0;
  position: relative;
}
.pipe-step.is-on .pipe-step-dot { background: #2563EB; }
.pipe-step.is-cur .pipe-step-dot {
  background: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(37,99,235,0.32); }
  70%  { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0   rgba(37,99,235,0); }
}
.pipe-step-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748B; font-weight: 500; }
.pipe-pct { display: flex; align-items: center; gap: 8px; }
.pipe-pct-bar { flex: 1; height: 6px; background: #E2E8F0; border-radius: 999px; overflow: hidden; }
.pipe-pct-fill { height: 100%; background: linear-gradient(90deg, #60A5FA, #2563EB); border-radius: 999px; }
.pipe-pct span { font-size: 11px; font-variant-numeric: tabular-nums; color: #475569; font-weight: 600; min-width: 28px; text-align: right; }

/* ───────── Marketing ───────── */
.mk-table { width: 100%; font-size: 12.5px; }
.mk-table thead th {
  text-align: left;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #94A3B8;
  padding: 8px 10px;
  border-bottom: 1px solid #E5E7EB;
}
.mk-table thead th.num { text-align: right; }
.mk-table tbody td { padding: 10px; border-bottom: 1px solid #F1F5F9; }
.mk-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mk-table .strong { font-weight: 600; color: #0F172A; }
.mk-table .muted { color: #64748B; }
.roas-chip {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.roas-chip.good { background: #DCFCE7; color: #15803D; }
.roas-chip.mid  { background: #FEF3C7; color: #B45309; }
.roas-chip.low  { background: #FEE2E2; color: #B91C1C; }

/* ───────── Staff health ───────── */
.staff-card { gap: 14px; }
.staff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.staff-stat { background: #F8FAFC; border-radius: 10px; padding: 12px; }
.staff-stat-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #0F172A; }
.staff-stat-l { font-size: 11px; color: #64748B; margin-top: 2px; }
.staff-bars-head { font-size: 11px; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-bottom: 8px; }
.staff-bar-row { display: grid; grid-template-columns: 80px 1fr 80px; gap: 10px; align-items: center; padding: 6px 0; }
.staff-bar-region { font-size: 12px; color: #475569; font-weight: 500; }
.staff-bar-track { display: flex; height: 8px; border-radius: 999px; background: #F1F5F9; overflow: hidden; }
.staff-bar-hire { background: #16A34A; }
.staff-bar-attr { background: #FB7185; }
.staff-bar-vals { font-size: 11px; text-align: right; }
.staff-bar-vals .up { color: #16A34A; font-weight: 600; }
.staff-bar-vals .down { color: #DC2626; font-weight: 600; }

/* ───────── Map ───────── */
.map-card { padding: 18px; }
.map-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #FAFBFD; border-radius: 12px; overflow: hidden; }
.map-svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.map-bub {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0; border-radius: 50%; background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease;
}
.map-bub:hover, .map-bub.is-on { transform: translate(-50%, -50%) scale(1.06); }
.map-bub-lbl {
  position: absolute;
  top: 100%; left: 50%; transform: translate(-50%, 6px);
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 10.5px;
  white-space: nowrap;
  display: flex; flex-direction: column; align-items: center;
  gap: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.map-bub-lbl b { color: #0F172A; font-weight: 600; }
.map-bub-lbl span { color: #64748B; }
.map-bub:hover .map-bub-lbl, .map-bub.is-on .map-bub-lbl { opacity: 1; }
.map-legend-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-region-pill {
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  display: flex; align-items: center; gap: 6px;
}
.map-region-pill.is-on { border-color: #2563EB; background: #EFF6FF; color: #1E3A8A; }
.map-region-name { font-weight: 600; color: #0F172A; }
.map-region-pill.is-on .map-region-name { color: #1E3A8A; }
.map-region-meta { color: #64748B; font-variant-numeric: tabular-nums; }

/* ───────── Drill-down detail overlay ───────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(11, 20, 48, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; justify-content: flex-end;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.detail {
  background: #F4F6FA;
  width: min(960px, 100%);
  height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,0.18);
  animation: slidein .22s cubic-bezier(.16,1,.3,1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.detail-head {
  background: #fff;
  padding: 16px 24px;
  border-bottom: 1px solid #E5E7EB;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  flex-shrink: 0;
}
.detail-back { background: transparent; border: 0; color: #2563EB; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; padding: 0; margin-bottom: 6px; }
.detail-title-row { display: flex; gap: 14px; align-items: center; }
.detail-shop-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FBF6E4, #F1E1A8);
  color: #1B1809;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em;
}
.detail-title-row h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: #0B1430; }
.detail-shop-meta { display: flex; gap: 14px; font-size: 12px; color: #64748B; margin-top: 4px; }
.detail-shop-meta span { display: inline-flex; align-items: center; gap: 4px; }
.detail-head-right { display: flex; gap: 8px; align-items: center; }
.ghost-btn {
  background: #fff; border: 1px solid #E2E8F0;
  font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px;
  color: #0F172A;
}
.ghost-btn:hover { background: #F8FAFC; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid #E2E8F0; background: #fff;
  display: grid; place-items: center;
  color: #64748B;
}
.icon-btn:hover { background: #F8FAFC; color: #0F172A; }

.detail-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.detail-kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.dk { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px; }
.dk-l { font-size: 11px; color: #64748B; font-weight: 500; }
.dk-v { font-size: 19px; font-weight: 700; color: #0F172A; margin: 4px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dk-sub { font-size: 11px; color: #94A3B8; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.detail-block {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
}
.detail-block h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: #0F172A; }
.detail-block-wide { grid-column: span 2; }

.day-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.day-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day-bar-track {
  width: 100%; height: 110px; background: #F8FAFC; border-radius: 6px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.day-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #34D399, #16A34A);
  border-radius: 6px 6px 0 0;
  transition: height .3s ease;
}
.day-bar-l { font-size: 10px; color: #94A3B8; font-weight: 500; }
.day-bar-v { font-size: 10.5px; color: #0F172A; font-weight: 600; font-variant-numeric: tabular-nums; }

.detail-staff { width: 100%; font-size: 12.5px; }
.detail-staff thead th { text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94A3B8; padding: 8px; border-bottom: 1px solid #E5E7EB; }
.detail-staff thead th.num { text-align: right; }
.detail-staff tbody td { padding: 10px 8px; border-bottom: 1px solid #F1F5F9; }
.detail-staff tbody td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.detail-staff td:first-child { display: flex; align-items: center; gap: 10px; font-weight: 500; color: #0F172A; }
.staff-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #E2E8F0, #CBD5E1);
  color: #475569; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.hq-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hq-action {
  background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  text-align: left;
  color: #0F172A;
  transition: all .12s ease;
}
.hq-action:hover { background: #fff; border-color: #2563EB; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
.hq-action svg { color: #2563EB; flex-shrink: 0; margin-top: 1px; }
.hq-action b { display: block; font-size: 12.5px; font-weight: 600; }
.hq-action span { display: block; font-size: 11px; color: #64748B; margin-top: 2px; }

/* ───────── Responsive ───────── */
@media (max-width: 1400px) {
  .alerts-row { grid-template-columns: repeat(3, 1fr); }
  .lower-grid { grid-template-columns: 1fr 1fr; }
  .lower-grid > :first-child { grid-column: span 2; }
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .alerts-row { grid-template-columns: repeat(2, 1fr); }
  .main-grid, .lower-grid, .bottom-grid { grid-template-columns: 1fr; }
  .lower-grid > :first-child { grid-column: auto; }
  .detail-kpis { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   v2 overrides (folded in)
   ============================================================ */

/* ─── Top bar: 3-column ─────────────────────────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 280px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}
.topbar-mid { display: flex; justify-content: center; }

/* ─── Location selector ─────────────────────────────────────────── */
.loc-selector { position: relative; }
.loc-selector-btn {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px 12px;
  height: 44px; min-width: 280px;
  color: rgba(255,255,255,0.85);
}
.loc-selector-btn:hover { background: rgba(255,255,255,0.1); }
.loc-selector-text { flex: 1; text-align: left; }
.loc-selector-label { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.2; }
.loc-selector-sub   { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.loc-selector-pop {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  min-width: 360px;
  z-index: 20;
  padding: 6px;
  max-height: 520px; overflow-y: auto;
}
.loc-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border: 0; background: transparent;
  border-radius: 8px;
  text-align: left;
  color: #0F172A;
}
.loc-opt:hover { background: #F8FAFC; }
.loc-opt.is-on { background: #EFF6FF; }
.loc-opt-name { font-size: 13px; font-weight: 600; }
.loc-opt-sub  { font-size: 11px; color: #64748B; margin-top: 1px; }
.loc-opt-divider {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: #94A3B8; letter-spacing: 0.06em;
  padding: 10px 10px 4px;
}

/* ─── Type badges (corporate / franchised) ──────────────────────── */
.type-badge {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
}
.type-corporate  { background: #DBEAFE; color: #1E3A8A; }
.type-franchised { background: #F1F5F9; color: #475569; }

/* ─── Pill flag for CASL/PIPEDA ─────────────────────────────────── */
.pill-flag {
  background: #FEE2E2; color: #B91C1C;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 5px;
  letter-spacing: 0.04em;
}

/* ─── KPI grid: 5 columns for 10 tiles (2 rows) ─────────────────── */
.kpi-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1500px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── Hero foot pill ────────────────────────────────────────────── */

/* ─── Alert critical banner ─────────────────────────────────────── */
.alert-card { position: relative; }
.alert-card.is-critical {
  box-shadow: 0 0 0 1px #DC2626, 0 6px 18px rgba(220, 38, 38, 0.12);
}
.alert-card-banner {
  position: absolute; top: -8px; left: 12px;
  background: #DC2626; color: #fff;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ─── Three-column grid for revenue / services / products ────── */
.three-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1.1fr;
  gap: 16px;
  margin: 16px 0 0;
}
@media (max-width: 1400px) { .three-grid { grid-template-columns: 1fr 1fr; } .three-grid > :first-child { grid-column: span 2; } }
@media (max-width: 1100px) { .three-grid { grid-template-columns: 1fr; } .three-grid > :first-child { grid-column: auto; } .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Revenue breakdown ─────────────────────────────────────────── */
.rev-break { display: flex; gap: 18px; align-items: center; }
.rev-break-list { list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rev-break-list li {
  display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid #F1F5F9;
}
.rev-break-list li:last-child { border-bottom: 0; }
.rev-dot { width: 10px; height: 10px; border-radius: 3px; }
.rev-name { font-size: 13px; color: #0F172A; font-weight: 500; }
.rev-val  { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rev-pct  { font-size: 11px; color: #94A3B8; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

/* ─── Stock pill ─────────────────────────────────────────────────── */
.stock-pill {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 1px 6px; border-radius: 4px;
  margin-left: 6px;
}
.stock-low      { background: #FEF3C7; color: #B45309; }
.stock-critical { background: #FEE2E2; color: #B91C1C; }

/* ─── Marketing channel pill ────────────────────────────────────── */
.channel-pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}
.mk-blended {
  display: inline-flex; gap: 6px; align-items: baseline;
  font-size: 11.5px; color: #64748B;
}
.mk-blended b { font-size: 14px; color: #0F172A; font-variant-numeric: tabular-nums; }

/* ─── Field picker ───────────────────────────────────────────────── */
.field-picker { position: relative; }
.ghost-btn.small { padding: 6px 10px; font-size: 12px; height: 32px; gap: 5px; }
.field-picker-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  width: 320px; padding: 12px; z-index: 30;
}
.fp-section + .fp-section { margin-top: 12px; }
.fp-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94A3B8; margin-bottom: 6px; display: flex; justify-content: space-between; }
.fp-hint { font-weight: 500; color: #CBD5E1; text-transform: none; letter-spacing: 0; }
.fp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fp-preset {
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px; font-weight: 500;
  color: #475569;
}
.fp-preset.is-on { background: #2563EB; color: #fff; border-color: #2563EB; }
.fp-fields { display: flex; flex-direction: column; gap: 2px; }
.fp-field {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer;
  color: #475569;
}
.fp-field:hover { background: #F8FAFC; }
.fp-field.is-on { color: #0F172A; }
.fp-field input { margin: 0; accent-color: #2563EB; }

/* ─── Compliance rows (drill-down) ───────────────────────────────── */
.comp-rows { display: flex; flex-direction: column; gap: 0; }
.comp-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #F1F5F9;
}
.comp-row:last-child { border-bottom: 0; }
.comp-row-l { font-size: 12.5px; color: #475569; }
.comp-row-v { font-size: 13px; font-weight: 600; color: #0F172A; font-variant-numeric: tabular-nums; }

/* ─── Hide page-header region tool (no longer used) ──────────────── */
.pageheader-tools { gap: 12px; }

/* Tighter alerts row at smaller widths */
@media (max-width: 1400px) { .alerts-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .alerts-row { grid-template-columns: repeat(2, 1fr); } }

/* ─── Alert card clickable affordance ──────────────────────────── */
.alert-card.is-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.alert-card.is-clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); }
.alert-card.is-critical.is-clickable:hover { box-shadow: 0 0 0 1px #DC2626, 0 10px 28px rgba(220, 38, 38, 0.22); }

/* ─── CASL incident overlay ─────────────────────────────────────── */
.casl-pane {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(1080px, 96vw);
  background: #F8FAFC;
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.2);
  display: flex; flex-direction: column;
  z-index: 60;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.casl-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 28px; background: #fff;
  border-bottom: 1px solid #E5E7EB;
}
.casl-head-left { flex: 1; }
.casl-banner {
  display: inline-block;
  background: #DC2626; color: #fff;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 4px;
  margin-bottom: 6px;
}
.casl-title-row h2 { margin: 4px 0 4px; font-size: 20px; font-weight: 700; color: #0F172A; letter-spacing: -0.01em; }
.casl-sub { font-size: 12.5px; color: #64748B; }

.casl-body {
  flex: 1; overflow-y: auto;
  padding: 20px 28px 40px;
  display: flex; flex-direction: column; gap: 18px;
}

.casl-block {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px 22px;
}
.casl-block h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px;
  font-size: 13.5px; font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.005em;
}
.casl-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: #0F172A; color: #fff;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
}
.casl-block-alert { background: #FEF2F2; border-color: #FCA5A5; }
.casl-block-alert h3 { color: #B91C1C; }

.casl-summary {
  font-size: 13.5px; color: #1E293B; line-height: 1.55;
  margin: 0 0 14px;
}
.casl-impact {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.casl-impact-item {
  background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 8px; padding: 10px 12px;
}
.casl-impact-l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748B; margin-bottom: 4px; }
.casl-impact-v { font-size: 14px; font-weight: 700; color: #0F172A; font-variant-numeric: tabular-nums; }
.casl-impact-bad { color: #DC2626; }

.casl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.casl-table th { text-align: left; padding: 8px 10px; color: #64748B; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #E5E7EB; }
.casl-table td { padding: 9px 10px; border-bottom: 1px solid #F1F5F9; color: #0F172A; }
.casl-table tr:last-child td { border-bottom: 0; }
.casl-table .strong { font-weight: 600; }
.casl-table-link { color: #2563EB; font-weight: 500; font-size: 11.5px; cursor: pointer; }

.casl-rootcause {
  display: flex; gap: 12px; align-items: flex-start;
  background: #FEF3C7; border: 1px solid #FCD34D;
  border-radius: 8px; padding: 12px 14px;
  color: #92400E;
}
.casl-rootcause p { margin: 0; font-size: 13px; line-height: 1.5; }

.casl-actions { display: flex; flex-direction: column; gap: 10px; }
.casl-action {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px;
}
.casl-action-immediate { background: #FEF2F2; border-color: #FCA5A5; }
.casl-action-required  { background: #FFFBEB; border-color: #FCD34D; }
.casl-action-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  background: #fff; border: 1px solid #E2E8F0;
  padding: 4px 8px; border-radius: 5px;
  color: #475569;
  min-width: 90px; text-align: center;
}
.casl-action-immediate .casl-action-tag { color: #B91C1C; border-color: #FCA5A5; }
.casl-action-required  .casl-action-tag { color: #92400E; border-color: #FCD34D; }
.casl-action-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.casl-action-body b { font-size: 13px; color: #0F172A; }
.casl-action-body span { font-size: 12px; color: #64748B; }

.primary-btn {
  background: #DC2626; color: #fff;
  border: 0; border-radius: 8px;
  padding: 8px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.primary-btn:hover { background: #B91C1C; }

.casl-audit { list-style: none; padding: 0; margin: 0; }
.casl-audit li {
  display: grid; grid-template-columns: 150px 200px 1fr; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #F1F5F9;
  font-size: 12.5px;
}
.casl-audit li:last-child { border-bottom: 0; }
.casl-audit-ts { color: #94A3B8; font-variant-numeric: tabular-nums; font-size: 11.5px; }
.casl-audit-actor { color: #475569; font-weight: 500; }
.casl-audit-action { color: #0F172A; }

.casl-priors { margin-top: 10px; }
.casl-prior {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 12px;
  background: #fff; border: 1px solid #FCA5A5; border-radius: 8px;
  margin-top: 8px;
}
.casl-prior-date { font-variant-numeric: tabular-nums; font-size: 12px; color: #B91C1C; font-weight: 600; min-width: 90px; }
.casl-prior-detail { font-size: 12.5px; color: #1E293B; }


/* ─── Detail: flagged shop ───────────────────────────────────────── */
.detail.is-flagged .detail-head { box-shadow: inset 0 -3px 0 #DC2626; }
.detail-shop-mark.is-flagged {
  background: linear-gradient(135deg, #FEE2E2, #FCA5A5);
  color: #7F1D1D;
}
.dk-sub.is-bad { color: #B91C1C; font-weight: 600; }
.dk-sub.is-good { color: #15803D; font-weight: 600; }
.ghost-btn.small { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }

/* ─── Exposure banner ────────────────────────────────────────────── */
.exposure-banner {
  background: linear-gradient(180deg, #FFF1F2 0%, #FFFFFF 100%);
  border: 1px solid #FCA5A5;
  border-radius: 14px;
  padding: 18px 20px 16px;
  margin-bottom: 18px;
  position: relative;
}
.exposure-banner::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #DC2626, #F97316);
  border-radius: 14px 14px 0 0;
}
.exposure-banner-head { margin-bottom: 14px; }
.exposure-banner-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #DC2626; color: #fff;
  padding: 4px 10px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.exposure-banner-title {
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: #0B1430;
  margin-bottom: 4px;
  text-wrap: balance;
}
.exposure-banner-sub { font-size: 12.5px; color: #64748B; }

.exposure-evidence {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.evidence-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.evidence-critical { border-color: #FCA5A5; }
.evidence-high { border-color: #FDBA74; }

.evidence-card-head { display: flex; gap: 6px; align-items: center; }
.evidence-flag {
  background: #0F172A; color: #fff;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
}
.evidence-sev {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px;
}
.evidence-critical .evidence-sev { background: #FEE2E2; color: #B91C1C; }
.evidence-high .evidence-sev { background: #FFEDD5; color: #C2410C; }
.evidence-headline {
  font-size: 14px; font-weight: 600; color: #0F172A; line-height: 1.35;
  text-wrap: balance;
}
.evidence-detail { font-size: 12px; color: #475569; line-height: 1.5; margin: 0; }
.evidence-proof {
  background: #F8FAFC; border-radius: 8px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.evidence-proof-row {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: #64748B;
  font-variant-numeric: tabular-nums;
}
.evidence-proof-row b { color: #0F172A; font-weight: 600; }
.evidence-cta {
  background: transparent; border: 0;
  color: #B91C1C; font-size: 12px; font-weight: 600;
  padding: 0; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
}

/* ─── Exposure strip (CEO-level $) ──────────────────────────────── */
.exposure-strip {
  display: grid; grid-template-columns: auto repeat(4, 1fr);
  gap: 10px;
  align-items: stretch;
  background: #0B1430; border-radius: 10px;
  padding: 12px 14px;
}
.exposure-strip-l {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  align-self: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  text-align: center;
  padding-right: 4px;
  border-right: 1px solid rgba(255,255,255,0.1);
  margin-right: 4px;
}
.exposure-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
}
.exposure-stat-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.exposure-stat-v {
  font-size: 17px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.exposure-stat-l { font-size: 11px; color: rgba(255,255,255,0.78); font-weight: 500; margin-top: 2px; }
.exposure-stat-sub { font-size: 10.5px; color: rgba(255,255,255,0.45); margin-top: 2px; line-height: 1.35; }
.exposure-stat.exposure-red .exposure-stat-v { color: #FCA5A5; }
.exposure-stat.exposure-amber .exposure-stat-v { color: #FCD34D; }

/* ─── Trajectory card ───────────────────────────────────────────── */
.detail-block h3 { display: flex; align-items: center; gap: 8px; }
.traj-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.traj-pill.is-good { background: #DCFCE7; color: #166534; }
.traj-pill.is-mid  { background: #FEF3C7; color: #92400E; }
.traj-pill.is-bad  { background: #FEE2E2; color: #B91C1C; }
.traj-meta { font-size: 11.5px; color: #64748B; margin-bottom: 10px; }
.traj-chart {
  display: grid; grid-template-columns: repeat(10, 1fr);
  gap: 6px; align-items: end;
  margin-bottom: 10px;
}
.traj-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.traj-bar-wrap {
  width: 100%; height: 80px;
  background: #F8FAFC;
  border-radius: 5px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.traj-bar {
  width: 100%;
  background: linear-gradient(180deg, #94A3B8, #64748B);
  border-radius: 5px 5px 0 0;
  transition: height .3s ease;
}
.traj-bar.is-warn { background: linear-gradient(180deg, #FDBA74, #F59E0B); }
.traj-bar.is-bad  { background: linear-gradient(180deg, #FCA5A5, #DC2626); }
.traj-week { font-size: 9.5px; color: #94A3B8; font-weight: 500; }
.traj-callout {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12px; color: #475569; line-height: 1.5;
  background: #F8FAFC; border-radius: 8px;
  padding: 8px 10px;
}
.traj-callout svg { flex-shrink: 0; margin-top: 2px; color: #B91C1C; }

/* ─── Franchisee card ───────────────────────────────────────────── */
.franchisee-row {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.franchisee-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #312E81);
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
  letter-spacing: 0.04em;
}
.franchisee-body { flex: 1; }
.franchisee-name { font-size: 14px; font-weight: 600; color: #0F172A; }
.franchisee-meta { font-size: 11.5px; color: #64748B; margin-top: 2px; }
.franchisee-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.franchisee-stat {
  background: #F8FAFC; border-radius: 8px;
  padding: 8px 10px;
}
.franchisee-stat-wide { grid-column: span 2; }
.franchisee-stat-l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748B; margin-bottom: 3px; }
.franchisee-stat-v { font-size: 12.5px; font-weight: 600; color: #0F172A; font-variant-numeric: tabular-nums; }
.franchisee-stat-v.is-bad { color: #B91C1C; }

/* ─── CEO actions ───────────────────────────────────────────────── */
.ceo-actions-block h3 { justify-content: flex-start; }
.ceo-actions-note { font-size: 11.5px; color: #94A3B8; font-weight: 400; margin-left: 4px; }
.ceo-actions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ceo-action {
  position: relative;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all .15s ease;
}
.ceo-action:hover { border-color: #0B1430; box-shadow: 0 4px 16px rgba(11, 20, 48, 0.08); }
.ceo-action.is-primary { border-color: #FCA5A5; background: linear-gradient(180deg, #FFF8F8 0%, #FFFFFF 100%); }
.ceo-action.is-primary:hover { border-color: #DC2626; box-shadow: 0 4px 16px rgba(220, 38, 38, 0.12); }
.ceo-action.is-terminal { border-color: #FECACA; background: #FEF2F2; }

.ceo-action-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 5px;
}
.ceo-action-title {
  font-size: 13px; font-weight: 600; color: #0F172A;
  line-height: 1.35;
  text-wrap: balance;
}
.ceo-action-why {
  font-size: 11.5px; color: #475569; line-height: 1.5;
  margin: 0;
}
.ceo-action-impact {
  font-size: 10.5px; color: #94A3B8;
  font-style: italic;
  border-top: 1px dashed #E2E8F0;
  padding-top: 6px;
  margin-top: auto;
}
.ceo-action-cta {
  align-self: flex-start;
  background: #0B1430; color: #fff;
  border: 0;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.ceo-action-cta:hover { background: #1E293B; }
.ceo-action-cta.is-primary { background: #DC2626; }
.ceo-action-cta.is-primary:hover { background: #B91C1C; }
.ceo-action-cta.is-terminal { background: #7F1D1D; }

@media (max-width: 1100px) {
  .ceo-actions { grid-template-columns: repeat(2, 1fr); }
  .exposure-strip { grid-template-columns: 1fr 1fr; }
  .exposure-strip-l { display: none; }
}


/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR — tooltip + role badge
   ═════════════════════════════════════════════════════════════════════ */
.sidebar-role {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  margin-top: 6px;
  padding: 2px 6px;
  background: rgba(244, 213, 141, 0.18);
  border-radius: 4px;
}
.sidebar-item { position: relative; }
.sidebar-tip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: #0F172A; color: #fff;
  font-size: 11.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 10;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.sidebar-tip::before {
  content: '';
  position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: #0F172A;
}
.sidebar-item:hover .sidebar-tip {
  opacity: 1; visibility: visible;
  transform: translateY(-50%) translateX(2px);
}

/* ═══════════════════════════════════════════════════════════════════════
   PAGE-LEVEL KPI STRIP (shared by Catalog, Marketing, Franchisees, etc.)
   ═════════════════════════════════════════════════════════════════════ */
.cat-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cat-kpi {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
}
.cat-kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: #CBD5E1;
}
.cat-kpi-warn::before  { background: #F59E0B; }
.cat-kpi-warn          { background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 100%); }
.cat-kpi-urgent::before{ background: #DC2626; }
.cat-kpi-urgent        { background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 100%); }
.cat-kpi-l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #64748B; display: inline-flex; align-items: center; gap: 4px; }
.cat-kpi .info-dot { color: #94A3B8; text-transform: none; letter-spacing: 0; }
.cat-kpi .info-dot:hover, .cat-kpi .info-dot:focus { color: #475569; }
.lb-table .info-dot, .cat-table .info-dot { color: #94A3B8; text-transform: none; letter-spacing: 0; }
.lb-table .info-dot:hover, .cat-table .info-dot:hover { color: #475569; }
.cat-kpi-v { font-size: 22px; font-weight: 700; color: #0F172A; margin: 4px 0; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.cat-kpi-sub { font-size: 11.5px; color: #64748B; display: flex; align-items: center; gap: 4px; }
.cat-kpi-urgent .cat-kpi-sub { color: #B91C1C; font-weight: 500; }
.cat-kpi-warn .cat-kpi-sub { color: #92400E; }

/* ═══════════════════════════════════════════════════════════════════════
   TABS (used by Catalog + Marketing)
   ═════════════════════════════════════════════════════════════════════ */
.cat-tabs {
  display: flex; gap: 4px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 14px;
  width: fit-content;
}
.cat-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: #64748B;
}
.cat-tab:hover { color: #0F172A; background: #F8FAFC; }
.cat-tab.is-on {
  background: #0B1430; color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cat-tab.is-on .cat-tab-count { background: rgba(255,255,255,0.18); color: #fff; }
.cat-tab-count {
  background: #FEE2E2; color: #B91C1C;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px;
  min-width: 20px; text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   CATALOG — services table & meters
   ═════════════════════════════════════════════════════════════════════ */
.cat-table th, .cat-table td { padding: 10px 12px; }
.cat-meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cat-meter-bar { flex: 1; height: 6px; background: #F1F5F9; border-radius: 4px; overflow: hidden; }
.cat-meter-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.cat-meter span { font-size: 11.5px; font-weight: 600; color: #475569; font-variant-numeric: tabular-nums; min-width: 36px; }
.cat-flag { font-size: 10.5px; color: #B91C1C; margin-top: 3px; font-weight: 500; }
.cat-flag-warn { color: #92400E; }
.cat-primary {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  background: #DBEAFE; color: #1E3A8A;
  padding: 2px 6px; border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
.cat-medal { margin-right: 6px; }

/* ═══════════════════════════════════════════════════════════════════════
   PO APPROVAL QUEUE
   ═════════════════════════════════════════════════════════════════════ */
.po-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.po-row {
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  align-items: flex-start;
}
.po-row.is-above { border-left: 3px solid #DC2626; }
.po-row.is-auto  { border-left: 3px solid #94A3B8; background: #F8FAFC; }
.po-row.is-flagged { border-color: #FCA5A5; background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%); }

.po-row-l { display: flex; flex-direction: column; gap: 4px; }
.po-id { font-family: ui-monospace, monospace; font-size: 12px; color: #64748B; font-weight: 600; }
.po-priority { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; padding: 2px 6px; border-radius: 4px; align-self: flex-start; }
.po-priority.po-standard { background: #F1F5F9; color: #475569; }
.po-priority.po-rush     { background: #FEE2E2; color: #B91C1C; }
.po-auto { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: #94A3B8; }

.po-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.po-vendor { font-size: 14px; font-weight: 600; color: #0F172A; }
.po-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: #64748B; }
.po-meta span { display: inline-flex; align-items: center; gap: 4px; }
.po-loc { color: #2563EB; cursor: pointer; font-weight: 500; }
.po-loc:hover { text-decoration: underline; }
.po-flag {
  margin-top: 6px;
  font-size: 11.5px; line-height: 1.4;
  padding: 6px 10px; border-radius: 6px;
  display: inline-flex; align-items: flex-start; gap: 4px;
}
.po-flag-bad  { background: #FEE2E2; color: #B91C1C; }
.po-flag-warn { background: #FEF3C7; color: #92400E; }

.po-row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.po-total { font-size: 18px; font-weight: 700; color: #0F172A; font-variant-numeric: tabular-nums; }
.po-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.po-auto-note { font-size: 11px; color: #94A3B8; font-style: italic; align-self: center; padding-right: 6px; }
.po-action-bad {
  background: #DC2626; color: #fff; border: 0;
  padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.po-action-bad:hover { background: #B91C1C; }
.primary-btn {
  background: #0B1430; color: #fff; border: 0;
  padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.primary-btn:hover { background: #1E293B; }

/* ═══════════════════════════════════════════════════════════════════════
   INVENTORY HEALTH
   ═════════════════════════════════════════════════════════════════════ */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}
.inv-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
}
.inv-card.inv-critical { border-color: #FCA5A5; background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%); }
.inv-card.inv-low      { border-color: #FCD34D; }
.inv-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.inv-card-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.inv-card-sku { font-size: 10.5px; color: #94A3B8; font-family: ui-monospace, monospace; margin-top: 2px; }
.inv-status {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 7px; border-radius: 5px;
}
.inv-status-healthy  { background: #DCFCE7; color: #166534; }
.inv-status-watch    { background: #FEF3C7; color: #92400E; }
.inv-status-low      { background: #FEF3C7; color: #92400E; }
.inv-status-critical { background: #FEE2E2; color: #B91C1C; }

.inv-shop-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #F1F5F9; margin-bottom: 6px; }
.inv-shop-seg { transition: flex .3s ease; }
.inv-seg-stockout { background: #DC2626; }
.inv-seg-low      { background: #F59E0B; }
.inv-seg-healthy  { background: #16A34A; }
.inv-shop-legend { display: flex; gap: 12px; font-size: 11px; color: #64748B; flex-wrap: wrap; }
.inv-shop-legend span { display: inline-flex; align-items: center; gap: 4px; }
.inv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.inv-stats { display: flex; gap: 16px; padding-top: 10px; margin-top: 10px; border-top: 1px solid #F1F5F9; }
.inv-stats div { font-size: 11px; color: #64748B; display: flex; flex-direction: column; }
.inv-stats div b { font-size: 14px; font-weight: 700; color: #0F172A; margin-top: 2px; font-variant-numeric: tabular-nums; }
.inv-stats div b.is-bad { color: #B91C1C; }
.inv-vendor-flag {
  margin-top: 10px;
  background: #FEF3C7; color: #92400E;
  padding: 6px 8px; border-radius: 6px;
  font-size: 11px; line-height: 1.4;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   MARKETING — campaign approval rows
   ═════════════════════════════════════════════════════════════════════ */
.approval-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.approval-row {
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  align-items: flex-start;
}
.approval-row.approval-critical { border-left: 3px solid #DC2626; background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%); }
.approval-row.approval-high     { border-left: 3px solid #F59E0B; }
.approval-row.approval-low      { border-left: 3px solid #FBBF24; }
.approval-row.approval-clean    { border-left: 3px solid #16A34A; }

.approval-row-l { display: flex; flex-direction: column; gap: 6px; }
.approval-risk { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 5px; align-self: flex-start; }
.approval-id { font-family: ui-monospace, monospace; font-size: 11.5px; color: #64748B; font-weight: 600; }
.approval-channel { margin-top: 2px; }

.approval-row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.approval-name { font-size: 14.5px; font-weight: 600; color: #0F172A; }
.approval-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: #64748B; }
.approval-meta span { display: inline-flex; align-items: center; gap: 4px; }
.approval-meta code { background: #F1F5F9; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; color: #475569; }
.approval-loc { color: #2563EB; cursor: pointer; font-weight: 500; }
.approval-loc:hover { text-decoration: underline; }

.approval-recipients {
  display: flex; gap: 16px;
  background: #F8FAFC; border-radius: 8px;
  padding: 8px 12px;
  margin-top: 4px;
}
.approval-rec-stat { display: flex; flex-direction: column; }
.approval-rec-stat span { font-size: 10.5px; color: #64748B; font-weight: 500; }
.approval-rec-stat b { font-size: 14px; font-weight: 700; color: #0F172A; margin-top: 2px; font-variant-numeric: tabular-nums; }
.approval-rec-stat b.is-good { color: #15803D; }
.approval-rec-stat b.is-bad  { color: #B91C1C; }

.approval-risks { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.approval-risk-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; line-height: 1.4;
  padding: 6px 10px; border-radius: 6px;
}
.approval-risk-critical { background: #FEE2E2; color: #B91C1C; }
.approval-risk-high     { background: #FFEDD5; color: #C2410C; }
.approval-risk-low      { background: #FEF3C7; color: #92400E; }
.approval-risk-code { font-weight: 700; font-size: 10px; letter-spacing: 0.08em; background: rgba(255,255,255,0.6); padding: 2px 6px; border-radius: 4px; }

.approval-row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.channel-email    { background: #DBEAFE; color: #1E40AF; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-sms      { background: #DCFCE7; color: #166534; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-inapp    { background: #F3E8FF; color: #6B21A8; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-whatsapp { background: #D1FAE5; color: #065F46; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-instore  { background: #FEF3C7; color: #92400E; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-referral { background: #FFEDD5; color: #C2410C; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-loyalty  { background: #FCE7F3; color: #9D174D; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.channel-reward   { background: #FEF3C7; color: #92400E; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   MARKETING — templates grid
   ═════════════════════════════════════════════════════════════════════ */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}
.tpl-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  display: flex; gap: 14px;
  transition: all .15s ease;
}
.tpl-card:hover { border-color: #0B1430; box-shadow: 0 4px 14px rgba(11,20,48,0.08); }
.tpl-card.is-draft { background: #F8FAFC; opacity: 0.85; }
.tpl-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  border: 2px solid;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tpl-body { flex: 1; min-width: 0; }
.tpl-name { font-size: 14px; font-weight: 600; color: #0F172A; margin-bottom: 4px; text-wrap: balance; }
.tpl-meta { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.tpl-adoption { margin-bottom: 10px; }
.tpl-adoption-l { font-size: 10.5px; color: #64748B; font-weight: 500; margin-bottom: 4px; }
.tpl-adoption-bar { display: flex; align-items: center; gap: 8px; }
.tpl-stats { display: flex; gap: 14px; padding-top: 8px; border-top: 1px solid #F1F5F9; }
.tpl-stats div { font-size: 10.5px; color: #64748B; display: flex; flex-direction: column; }
.tpl-stats div b { font-size: 13px; font-weight: 700; color: #0F172A; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tpl-empty { font-size: 12px; color: #94A3B8; font-style: italic; padding: 16px 0; }

/* ═══════════════════════════════════════════════════════════════════════
   REPUTATION cards
   ═════════════════════════════════════════════════════════════════════ */
.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
}
.rep-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .15s ease;
}
.rep-card:hover { border-color: #0B1430; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.rep-bad { border-color: #FCA5A5; background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%); }
.rep-mid { border-color: #FCD34D; }
.rep-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rep-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.rep-rating { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rep-rating span { font-size: 12px; }
.rep-rating-good { color: #15803D; }
.rep-rating-mid  { color: #B45309; }
.rep-rating-bad  { color: #B91C1C; }
.rep-stats { display: flex; flex-direction: column; gap: 4px; }
.rep-stats div { display: flex; justify-content: space-between; font-size: 11.5px; color: #64748B; }
.rep-stats div b { color: #0F172A; font-weight: 600; }
.rep-stats div b.is-bad { color: #B91C1C; }
.rep-stats .is-positive { color: #15803D; }
.rep-stats .is-mixed    { color: #B45309; }
.rep-stats .is-negative { color: #B91C1C; }
.rep-alert {
  margin-top: 10px;
  background: #FEE2E2; color: #B91C1C;
  padding: 6px 8px; border-radius: 6px;
  font-size: 11px; line-height: 1.4;
  display: inline-flex; align-items: flex-start; gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FRANCHISEE HUB
   ═════════════════════════════════════════════════════════════════════ */
.franchisee-grid-wrap {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.thread-list { list-style: none; padding: 0; margin: 0; }
.thread-row {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  position: relative;
  transition: background .12s ease;
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: #F8FAFC; }
.thread-row.is-unread { background: #FAFCFF; }
.thread-row.is-unread:hover { background: #F4F8FE; }
.thread-row.thread-critical { background: linear-gradient(90deg, #FFFBFB, #FFFFFF); }
.thread-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #312E81);
  color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.thread-body { flex: 1; min-width: 0; }
.thread-head-row { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: #64748B; margin-bottom: 3px; }
.thread-operator { font-weight: 600; color: #0F172A; }
.thread-loc { color: #94A3B8; }
.thread-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; }
.thread-tag-critical { background: #FEE2E2; color: #B91C1C; }
.thread-tag-high     { background: #FFEDD5; color: #C2410C; }
.thread-when { margin-left: auto; color: #94A3B8; }
.thread-subject { font-size: 13px; font-weight: 500; color: #0F172A; margin-bottom: 3px; }
.thread-preview { font-size: 12px; color: #64748B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-unread {
  position: absolute; right: 16px; top: 18px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #2563EB;
}

.broadcast-list { list-style: none; padding: 0; margin: 0; }
.broadcast-row {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
}
.broadcast-row:last-child { border-bottom: 0; }
.broadcast-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 7px; border-radius: 5px;
  align-self: flex-start;
  flex-shrink: 0;
}
.broadcast-mandatory .broadcast-tag  { background: #FEE2E2; color: #B91C1C; }
.broadcast-compliance .broadcast-tag { background: #FEF3C7; color: #92400E; }
.broadcast-standard .broadcast-tag   { background: #DBEAFE; color: #1E40AF; }
.broadcast-body { flex: 1; min-width: 0; }
.broadcast-title { font-size: 13px; font-weight: 600; color: #0F172A; }
.broadcast-meta { font-size: 11px; color: #64748B; margin: 2px 0 6px; }
.broadcast-stats { display: flex; gap: 14px; }
.broadcast-stat { font-size: 10.5px; color: #64748B; display: flex; flex-direction: column; }
.broadcast-stat b { font-size: 12px; font-weight: 700; color: #0F172A; margin-top: 2px; }
.broadcast-stat b.is-bad  { color: #B91C1C; }
.broadcast-stat b.is-good { color: #166534; }

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER INTELLIGENCE — segments, loyalty
   ═════════════════════════════════════════════════════════════════════ */
.stub-segments, .stub-loyalty {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 16px 16px;
}
.seg-card, .loyalty-stat {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 10px 12px;
}
.seg-card-l, .loyalty-stat div:first-child { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #64748B; }
.seg-card-v { font-size: 18px; font-weight: 700; color: #0F172A; margin: 2px 0; font-variant-numeric: tabular-nums; }
.seg-card-sub { font-size: 11.5px; color: #64748B; }
.loyalty-stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.loyalty-stat div:first-child { text-transform: none; letter-spacing: 0; font-weight: 500; }
.loyalty-stat b { font-size: 13.5px; font-weight: 600; color: #0F172A; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════
   REPORTS — report card grid
   ═════════════════════════════════════════════════════════════════════ */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.report-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
  display: flex; gap: 14px;
  transition: all .15s ease;
}
.report-card:hover { border-color: #0B1430; box-shadow: 0 4px 14px rgba(11,20,48,0.08); transform: translateY(-1px); }
.report-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FBF6E4, #F1E1A8);
  color: #1B1809;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.report-card-body { flex: 1; }
.report-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.report-card-title { font-size: 14px; font-weight: 600; color: #0F172A; }
.report-card-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; color: #94A3B8; }
.report-card-desc { font-size: 12px; color: #64748B; line-height: 1.5; margin: 0 0 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   TEAM (stub lists)
   ═════════════════════════════════════════════════════════════════════ */
.stub-card .stub-list { list-style: none; padding: 8px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.stub-list li {
  background: #F8FAFC; border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px; color: #475569;
  line-height: 1.45;
}
.stub-list li b { color: #0F172A; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   AI INSIGHTS cards
   ═════════════════════════════════════════════════════════════════════ */
.ai-insights {
  display: flex; flex-direction: column;
  gap: 12px;
}
.ai-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 18px 20px;
}
.ai-card.ai-red    { border-color: #FCA5A5; background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%); }
.ai-card.ai-amber  { border-color: #FCD34D; background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 100%); }
.ai-card.ai-green  { border-color: #86EFAC; background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%); }
.ai-card.ai-blue   { border-color: #93C5FD; background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%); }
.ai-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}
.ai-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  display: grid; place-items: center;
}
.ai-card-kind { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; color: #64748B; }
.ai-card-title { font-size: 15px; font-weight: 700; color: #0F172A; letter-spacing: -0.005em; text-wrap: balance; line-height: 1.3; }
.ai-card-conf { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 120px; }
.ai-conf-bar { width: 100px; height: 4px; background: #E5E7EB; border-radius: 4px; overflow: hidden; }
.ai-conf-fill { height: 100%; background: linear-gradient(90deg, #94A3B8, #0F172A); border-radius: 4px; }
.ai-card-conf span { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: #94A3B8; text-transform: uppercase; }
.ai-card-detail { font-size: 13px; color: #475569; line-height: 1.55; margin: 0 0 12px; max-width: 920px; }
.ai-card-foot { display: flex; gap: 8px; align-items: center; }

/* ═══════════════════════════════════════════════════════════════════════
   SETTINGS grid
   ═════════════════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}
.settings-card { padding-bottom: 8px; }
.settings-list { list-style: none; padding: 8px 16px 12px; margin: 0; display: flex; flex-direction: column; }
.settings-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 12.5px;
}
.settings-list li:last-child { border-bottom: 0; }
.settings-list li span { color: #64748B; }
.settings-list li b { color: #0F172A; font-weight: 600; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════
   REPORTS & INSIGHTS — operator-style tabs + KPI cards
   ═════════════════════════════════════════════════════════════════════ */
.report-tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 16px;
  width: fit-content;
  flex-wrap: wrap;
}
.report-tab {
  background: transparent; border: 0;
  padding: 8px 18px;
  font-size: 13px; font-weight: 500;
  color: #64748B;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: color .15s ease, background .15s ease;
}
.report-tab:hover { color: #0F172A; background: #F8FAFC; }
.report-tab.is-on {
  color: #0F172A;
  font-weight: 600;
  background: #FBF6E4;
  box-shadow: inset 0 -2px 0 #EAB308;
}

.r-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  width: 240px;
  color: #94A3B8;
}
.r-search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font: inherit; font-size: 13px;
  color: #0F172A;
}
.r-search input::placeholder { color: #94A3B8; }

/* KPI grid (4-col) for the reports page */
.r-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .r-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.r-kpi {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 108px;
}
.r-kpi-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.r-kpi-label {
  font-size: 12.5px; color: #64748B; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.r-kpi-ai {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  color: #15803D;
  background: #DCFCE7;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.r-kpi-value {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.r-kpi-delta {
  font-size: 11.5px; font-weight: 500;
  color: #64748B;
}
.r-kpi-delta.is-up   { color: #16A34A; }
.r-kpi-delta.is-down { color: #DC2626; }

/* Two-column row used throughout the reports page */
.r-two {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .r-two { grid-template-columns: 1fr; } }

/* Sales chart foot stats */
.r-chart-foot {
  display: flex; gap: 24px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid #F1F5F9;
}
.r-chart-stat span { display: block; font-size: 11px; color: #94A3B8; }
.r-chart-stat b { display: block; font-size: 16px; font-weight: 700; color: #0F172A; font-variant-numeric: tabular-nums; margin-top: 2px; }

.r-foot {
  display: flex; gap: 24px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #F1F5F9;
}
.r-foot-stat span { display: block; font-size: 11px; color: #94A3B8; }
.r-foot-stat b { display: block; font-size: 16px; font-weight: 700; color: #0F172A; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Next Best Actions list */
.nba-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.nba-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
}
.nba-row:last-child { border-bottom: 0; padding-bottom: 0; }
.nba-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #FBF6E4;
  color: #B45309;
  display: grid; place-items: center;
}
.nba-title { font-size: 13.5px; font-weight: 600; color: #0F172A; line-height: 1.35; text-wrap: balance; }
.nba-sub { font-size: 11.5px; color: #64748B; margin-top: 4px; }
.nba-cta {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0;
  color: #2563EB; font-size: 12.5px; font-weight: 600;
  padding: 6px 0 0;
  cursor: pointer;
}
.nba-cta:hover { color: #1E40AF; }

/* Peak demand heatmap */
.heatmap {
  display: grid;
  grid-template-columns: 44px repeat(10, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.heat-corner { background: transparent; }
.heat-col-label {
  font-size: 10.5px; font-weight: 600;
  color: #64748B;
  text-align: center;
  padding-bottom: 4px;
}
.heat-row-label {
  font-size: 11px; font-weight: 600;
  color: #475569;
  display: grid; place-items: center;
  padding-right: 4px;
}
.heat-cell {
  border-radius: 6px;
  padding: 10px 4px;
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: transform .12s ease;
}
.heat-cell:hover { transform: scale(1.04); }
.heat-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 14px;
  font-size: 11.5px; color: #64748B;
}
.heat-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.heat-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* Network capacity calendar */
.cap-cal-wrap { overflow-x: auto; }
.cap-cal { width: 100%; border-collapse: separate; border-spacing: 4px; }
.cap-cal th {
  font-size: 10.5px; font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: left; padding: 8px 6px;
}
.cap-day-head { text-align: center !important; }
.cap-cal td {
  padding: 0; vertical-align: middle;
}
.cap-cal tbody tr td:first-child { padding: 8px 8px 8px 0; }
.cap-cal .num { text-align: right; padding-right: 6px; }
.cap-cell {
  border-radius: 8px;
  padding: 8px 6px;
  min-width: 64px;
  text-align: center;
  background: #F1F5F9;
  position: relative;
}
.cap-cell-v {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0F172A;
}
.cap-cell-sub {
  font-size: 10px; color: #64748B; margin-top: 2px;
}
.cap-cell-tag {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #B45309;
  margin-top: 3px;
}
.cap-cell-tag-peak { color: #047857; }
.cap-cell.cap-peak  { background: #DCFCE7; }
.cap-cell.cap-peak  .cap-cell-v { color: #065F46; }
.cap-cell.cap-good  { background: #ECFCCB; }
.cap-cell.cap-mid   { background: #FEF9C3; }
.cap-cell.cap-low   { background: #FED7AA; }
.cap-cell.cap-low   .cap-cell-v { color: #9A3412; }
.cap-cell.cap-empty { background: #FEE2E2; }
.cap-cell.cap-empty .cap-cell-v { color: #991B1B; }

/* Retention grid (cohort table) */
.r-retention-grid { display: flex; flex-direction: column; gap: 4px; }
.r-retention-row {
  display: grid;
  grid-template-columns: 100px repeat(12, 1fr);
  gap: 4px;
  align-items: center;
}
.r-retention-head { padding-bottom: 4px; border-bottom: 1px solid #F1F5F9; padding-bottom: 8px; margin-bottom: 4px; }
.r-retention-head > div { font-size: 10.5px; font-weight: 600; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.05em; }
.r-ret-month { text-align: center; }
.r-ret-label { font-size: 12px; font-weight: 600; color: #475569; }
.r-ret-cell {
  border-radius: 6px;
  padding: 8px 0;
  text-align: center;
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.r-ret-cell.r-ret-empty { background: #F8FAFC; }
.muted { color: #94A3B8; }

/* ═══════════════════════════════════════════════════════════════════════
   LOCATION HEALTH SCORE (gap #2)
   ═════════════════════════════════════════════════════════════════════ */
.health-grid { display: flex; flex-direction: column; gap: 8px; }
.health-row {
  display: grid;
  grid-template-columns: 220px 1fr 50px 130px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F1F5F9;
}
.health-row:last-child { border-bottom: 0; }
.health-row-l { display: flex; flex-direction: column; gap: 1px; }
.health-name { font-size: 12.5px; font-weight: 600; color: #0F172A; display: inline-flex; align-items: center; gap: 4px; }
.health-weight { font-size: 10.5px; color: #94A3B8; font-weight: 500; letter-spacing: 0.03em; }
.health-bar {
  height: 6px; background: #F1F5F9; border-radius: 999px; overflow: hidden;
}
.health-fill { height: 100%; border-radius: 999px; }
.health-fill-good { background: #16A34A; }
.health-fill-mid  { background: #F59E0B; }
.health-fill-bad  { background: #DC2626; }
.health-score { font-size: 14px; font-weight: 700; color: #0F172A; font-variant-numeric: tabular-nums; text-align: right; }
.health-contrib { font-size: 10.5px; color: #94A3B8; text-align: right; }
.health-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #F1F5F9;
  font-size: 11.5px; color: #64748B;
}

/* ═══════════════════════════════════════════════════════════════════════
   AI INSIGHT — evidence / basis / legal safeguards (gap #10)
   ═════════════════════════════════════════════════════════════════════ */
.ai-human-pill {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  background: #FEE2E2; color: #B91C1C;
  padding: 2px 7px; border-radius: 4px;
}
.ai-evidence {
  margin-top: 10px;
  padding: 10px 12px;
  background: #F8FAFC;
  border-radius: 8px;
}
.ai-evidence-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ai-evidence ul {
  margin: 0; padding-left: 18px;
  font-size: 12px; color: #1E293B; line-height: 1.55;
}
.ai-evidence li { margin-bottom: 2px; }
.ai-basis {
  margin-top: 8px;
  font-size: 11.5px; color: #64748B; line-height: 1.5;
  display: flex; flex-direction: column; gap: 2px;
}
.ai-basis-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: #94A3B8; text-transform: uppercase;
}
.ai-legal {
  margin-top: 10px;
  padding: 8px 12px;
  background: #FFFBEB; border: 1px solid #FCD34D;
  border-radius: 8px;
  font-size: 11.5px; color: #92400E; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 6px;
}
.ai-legal svg { flex-shrink: 0; margin-top: 2px; color: #92400E; }

/* ═══════════════════════════════════════════════════════════════════════
   DOCUMENT VAULT (gap #6)
   ═════════════════════════════════════════════════════════════════════ */
.vault-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
@media (max-width: 1100px) { .vault-grid { grid-template-columns: 1fr; } }
.vault-sidebar {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  align-self: start;
}
.vault-shop {
  display: flex; gap: 10px; align-items: center;
  width: 100%; padding: 10px 10px;
  border: 0; background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}
.vault-shop:hover { background: #F8FAFC; }
.vault-shop.is-on { background: #FBF6E4; }
.vault-shop-id {
  background: #0B1430; color: #fff;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 6px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.vault-shop-name { font-size: 13px; font-weight: 600; color: #0F172A; }
.vault-shop-meta { font-size: 11px; color: #64748B; margin-top: 2px; }
.vault-main { padding: 18px; }

/* ═══════════════════════════════════════════════════════════════════════
   GROWTH PIPELINE (gap #7)
   ═════════════════════════════════════════════════════════════════════ */
.growth-stage { display: flex; flex-direction: column; gap: 4px; }
.growth-stage > span { font-size: 12.5px; font-weight: 600; color: #0F172A; }
.growth-stage-bar { display: flex; gap: 3px; }
.growth-stage-dot {
  flex: 1; height: 4px;
  background: #E2E8F0;
  border-radius: 999px;
}
.growth-stage-dot.is-on { background: #16A34A; }
.growth-stage-notes { font-size: 11px; color: #64748B; }

/* ═══════════════════════════════════════════════════════════════════════
   HQ ACTION CENTER (gap #3)
   ═════════════════════════════════════════════════════════════════════ */
.action-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .franchisee-grid-wrap { grid-template-columns: 1fr; }
  .po-row, .approval-row { grid-template-columns: 1fr; }
  .po-row-r, .approval-row-r { align-items: flex-start; }
  .ai-card-head { grid-template-columns: auto 1fr; }
  .ai-card-conf { grid-column: 2; align-items: flex-start; }
}

/* ───────── Demo interactivity: toasts, notifications, search, modals ───────── */
#hb-toasts { position: fixed; right: 20px; top: 76px; z-index: 999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.hb-toast { display: flex; gap: 10px; align-items: flex-start; background: #0B1430; color: #fff; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 10px 14px; min-width: 240px; max-width: 340px; box-shadow: 0 12px 30px rgba(2,6,23,0.35); opacity: 0; transform: translateY(-6px); transition: all .25s ease; }
.hb-toast.is-in { opacity: 1; transform: none; }
.hb-toast-check { width: 18px; height: 18px; border-radius: 50%; background: #16A34A; color: #fff; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.hb-toast-body { display: flex; flex-direction: column; gap: 2px; }
.hb-toast-body b { font-size: 12.5px; }
.hb-toast-body span { font-size: 11px; color: rgba(255,255,255,0.65); }

.notif-wrap { position: relative; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 370px; background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(2,6,23,0.25); border: 1px solid #E2E8F0; z-index: 60; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #F1F5F9; font-size: 13px; color: #0F172A; }
.notif-head span { color: #94A3B8; font-size: 11.5px; }
.notif-item { display: flex; gap: 10px; width: 100%; text-align: left; background: #fff; border: 0; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #F8FAFC; }
.notif-item:hover { background: #F8FAFC; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; gap: 2px; }
.notif-body b { font-size: 12.5px; color: #0F172A; }
.notif-body span { font-size: 11.5px; color: #64748B; line-height: 1.4; }
.notif-foot { width: 100%; border: 0; background: #F8FAFC; padding: 10px; font-size: 12px; font-weight: 600; color: #1E3A8A; cursor: pointer; }
.notif-foot:hover { background: #F1F5F9; }

.gsearch-wrap { position: relative; }
.gsearch-pop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(2,6,23,0.25); border: 1px solid #E2E8F0; z-index: 60; overflow: hidden; padding-bottom: 4px; }
.gsearch-sect { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #94A3B8; padding: 10px 14px 4px; text-transform: uppercase; }
.gsearch-item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: #fff; border: 0; padding: 8px 14px; cursor: pointer; color: #334155; }
.gsearch-item:hover { background: #F8FAFC; }
.gsearch-item b { font-size: 12.5px; color: #0F172A; }
.gsearch-item span { font-size: 11.5px; color: #94A3B8; margin-left: auto; }
.gsearch-empty { padding: 14px; font-size: 12.5px; color: #94A3B8; }

.hb-modal-overlay { display: flex; align-items: center; justify-content: center; }
.hb-modal { width: 540px; max-width: calc(100vw - 40px); max-height: calc(100vh - 80px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(2,6,23,0.35); }
.hb-modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid #F1F5F9; }
.hb-modal-head h3 { margin: 0; font-size: 16px; color: #0F172A; }
.hb-modal-head p { margin: 4px 0 0; font-size: 12px; color: #64748B; }
.hb-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.hb-modal-foot { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #F1F5F9; }
.hb-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #475569; font-weight: 600; }
.hb-field input, .hb-field select, .hb-field textarea { height: 36px; padding: 0 10px; border: 1px solid #E2E8F0; border-radius: 8px; font: inherit; font-weight: 400; font-size: 13px; color: #0F172A; outline: none; background: #fff; }
.hb-field textarea { height: 76px; padding: 8px 10px; resize: vertical; }
.hb-field input:focus, .hb-field select:focus, .hb-field textarea:focus { border-color: #94A3B8; }
.hb-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
