/* ===== APP SHELL (business owner) ===== */
.b2b {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  /* Paint the sidebar column the full page height; the sidebar itself is a
     sticky 100vh box, so on long pages the area below it would show the page
     background. */
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), var(--bg) var(--sidebar-w));
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
}
.sidebar-top { padding: 18px 16px 12px; }
.sidebar .logo { padding: 0 6px; }
.biz-switch {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.biz-switch .name { font-weight: 600; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-switch .meta { font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-switch > div { min-width: 0; }

.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item .ico { color: var(--faint); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active .ico { color: var(--brand); }
/* Active indicator: the icon sits on a small yellow tile (surface + dark
   icon, never a thin yellow line). Negative margin keeps the row height. */
.nav-item.active .ico {
  box-sizing: content-box; padding: 3px; margin: -3px;
  border-radius: 6px; background: var(--accent); color: var(--accent-text);
}
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-size: 11.5px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center;
}

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who .n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who .e { font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; padding: 32px 40px 80px; }
.main-inner { max-width: 1080px; margin: 0 auto; }

.topbar { display: none; }
.scrim { display: none; }

/* ===== PAGE HEADER ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.page-sub { color: var(--mute); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > .card + .card, .stack > .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ===== ONBOARDING ===== */
.setup { margin-bottom: 20px; }
.setup-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.setup-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  cursor: pointer;
}
.setup-step:last-child { border-right: none; }
.setup-step:hover { background: var(--surface-2); }
.setup-step .dot {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line-strong); color: var(--faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.setup-step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.setup-step .t { font-weight: 600; font-size: 13.5px; }
.setup-step .d { font-size: 12.5px; color: var(--mute); }
.setup-step.done .t { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--faint); }
.progress { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; width: 120px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ===== AGENDA / RESERVATIONS ===== */
.when {
  width: 62px; flex-shrink: 0;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}
.when .t { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }
.when .d { font-size: 12px; color: var(--mute); }
.res-row.is-cancelled .list-title, .res-row.is-cancelled .when .t { color: var(--faint); text-decoration: line-through; }

.day-group + .day-group { margin-top: 20px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.day-head h3 { font-size: 14px; }
.day-head .count { font-size: 12.5px; color: var(--mute); }
.day-head.today h3 { background: var(--accent); color: var(--accent-text); padding: 2px 8px; border-radius: 999px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.reschedule-form, .inline-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 20px 16px 96px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.reschedule-form input, .inline-form input { width: auto; }

/* ===== SERVICES ===== */
.svc-row .price { font-weight: 650; font-variant-numeric: tabular-nums; }
.svc-edit { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }

/* ===== SETTINGS ===== */
.settings-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings-section:first-of-type { border-top: none; padding-top: 0; }
.settings-section h2 { font-size: 15px; }
.settings-section .desc { color: var(--mute); font-size: 13px; margin-top: 4px; }

.hours-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.hours-row:last-of-type { border-bottom: none; }
.hours-day { width: 84px; font-weight: 600; }
.hours-intervals { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.hours-intervals input { width: 84px; }
.hours-intervals .dash { color: var(--faint); }
.hours-break { font-size: 12px; color: var(--mute); margin: 0 6px; }
.hours-closed { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.hours-row.closed .hours-intervals { opacity: .4; pointer-events: none; }

.manual-form { margin-bottom: 16px; }

/* ---------------------------------------------------------------- revenue */
/* Earned / planned: one hue, two steps (validated: CVD dE 17.9). The lighter
   step is below 3:1 on white, so every value is also in the table below. */
:root { --rev-earned: #0048E8; --rev-planned: #8FB0F5; }

.rev-chart { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 240px; }
.rev-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: 11.5px; color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
.rev-y span { transform: translateY(-50%); }
.rev-y span:last-child { transform: translateY(0); }
.rev-plot { position: relative; min-width: 0; }
.rev-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.rev-grid span { border-top: 1px solid var(--line); }
.rev-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.rev-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; outline: none; }
.rev-stack { flex: 1; width: 100%; max-width: 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.rev-seg { display: block; width: 100%; min-height: 2px; }
.rev-seg.earned { background: var(--rev-earned); }
.rev-seg.planned { background: var(--rev-planned); }
.rev-stack .rev-seg:first-child { border-radius: 4px 4px 0 0; }
.rev-x { height: 22px; line-height: 22px; font-size: 11px; color: var(--mute); white-space: nowrap; }
.rev-col.now .rev-x { color: var(--text); font-weight: 650; }
.rev-col:hover .rev-stack, .rev-col:focus .rev-stack { filter: brightness(.92); }
.rev-col::before { content: ''; position: absolute; inset: 0 -1px 22px; border-radius: 4px; }
.rev-col:hover::before, .rev-col:focus::before { background: rgba(15, 23, 42, .04); }
.rev-col:hover::after, .rev-col:focus::after {
  content: attr(data-tip); white-space: pre; z-index: 5;
  position: absolute; bottom: calc(100% - 14px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 12px; line-height: 1.5;
  padding: 8px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); pointer-events: none;
}
.rev-col:first-child:hover::after, .rev-col:nth-child(2):hover::after { left: 0; transform: none; }
.rev-col:last-child:hover::after, .rev-col:nth-last-child(2):hover::after { left: auto; right: 0; transform: none; }
.rev-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.rev-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rev-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rev-legend .sw.earned { background: var(--rev-earned); }
.rev-legend .sw.planned { background: var(--rev-planned); }

.rev-bars { display: flex; flex-direction: column; gap: 14px; }
.rev-bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.rev-bar-head .n { font-weight: 550; }
.rev-bar-head .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.rev-bar { height: 8px; background: var(--surface-2); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.rev-bar span { display: block; height: 100%; background: var(--rev-earned); border-radius: 0 4px 4px 0; }
.rev-bar-sub { font-size: 12px; color: var(--mute); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 11px 20px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== PLANS ===== */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-card.current { background: var(--brand-soft); }
.plan-flag { position: absolute; top: -10px; left: 16px; background: var(--accent); color: var(--accent-text); font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; }
.plan-name { font-weight: 700; font-size: 16px; }
.plan-price { color: var(--mute); font-size: 13px; }
.plan-price strong { color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; font-size: 13.5px; color: var(--text-2); }
.plan-card li { display: flex; gap: 6px; align-items: flex-start; }
.plan-card li .ico { color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.plan-card .btn { text-decoration: none; }
.plan-current { cursor: default; }
.plan-banner { align-items: center; margin-bottom: 20px; }
.plan-banner span { flex: 1; }

/* ===== CALENDAR FEED ===== */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }

/* ===== SLUG FIELD ===== */
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.slug-input span { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); color: var(--mute); font-size: 13.5px; border-right: 1px solid var(--line); white-space: nowrap; }
.slug-input input { border: none; border-radius: 0; min-width: 0; flex: 1; }
.slug-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.slug-input input:focus { box-shadow: none; }

/* ===== SERVICE UNIT PICK ===== */
.unit-pick { flex-wrap: wrap; }
.unit-pick label { position: relative; display: inline-flex; cursor: pointer; }
.unit-pick input { position: absolute; opacity: 0; pointer-events: none; }
.unit-pick span { padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 550; font-size: 13px; color: var(--mute); }
.unit-pick input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.unit-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
