:root {
  --yellow: #ffcb08;
  --yellow-dark: #e0ac00;
  --brown-dark: #38190c;
  --brown: #a56a42;
  --cream: #fff7e6;
  --tan: #fff3c5;
  --sage: #99c4b0;
  --sage-dark: #5f8a73;
  --lime: #bed530;
  --red: #b3453d;
  --gray: #777777;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(56, 25, 12, 0.09);
  --focus-ring: 0 0 0 3px rgba(255, 203, 8, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--brown-dark);
}

.topbar {
  background: var(--brown-dark);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--yellow);
}

.topbar .brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .brand span {
  color: var(--brown-dark);
  background: var(--yellow);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.topbar button {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}
.topbar button:hover { background: rgba(255,255,255,0.14); }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  border-top: 3px solid var(--yellow);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  color: var(--brown-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.section {
  background: var(--cream);
  border: 1px solid var(--tan);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 14px 0;
}
.section h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brown);
}
/* Recap steps number themselves; hidden sections are skipped. */
#recapForm { counter-reset: recap-step; }
.section.numbered { counter-increment: recap-step; }
.section.numbered h3::before { content: counter(recap-step) " · "; }
.req { color: var(--red); }
.section .section-sub { font-size: 0.78rem; color: var(--gray); margin: 0 0 10px; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brown);
  margin: 10px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--tan);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--white);
  font-family: inherit;
  color: var(--brown-dark);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow-dark); box-shadow: var(--focus-ring); }

input[type="checkbox"] { width: auto; }

input[type="file"] {
  padding: 8px;
  background: var(--cream);
  border: 1.5px dashed var(--brown);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--brown-dark);
  color: var(--white);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: 10px;
  cursor: pointer;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

.btn {
  display: inline-block;
  background: var(--yellow);
  color: var(--brown-dark);
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}
.btn:hover { background: var(--yellow-dark); }
.btn:disabled { background: var(--tan); color: var(--gray); cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--brown-dark); border: 1.5px solid var(--brown-dark); }
.btn.secondary:hover { background: var(--cream); }
.btn.danger { background: var(--red); color: var(--white); }
.btn.full { display: block; width: 100%; text-align: center; font-size: 1.05rem; padding: 15px 20px; }

.cta-banner {
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0 14px;
  font-weight: 600;
  font-size: 0.94rem;
}
.cta-banner.scheduled { background: var(--tan); color: var(--brown-dark); border: 1.5px solid var(--yellow-dark); }
.cta-banner.active { background: #eaf2ea; color: var(--sage-dark); border: 1.5px solid var(--sage-dark); }
.cta-banner.done { background: #f1ede6; color: var(--gray); border: 1.5px solid var(--tan); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--tan); }
th { color: var(--brown); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.scheduled { background: #f1ede6; color: var(--gray); }
.badge.active { background: #fdf0c2; color: #8a6300; }
.badge.completed { background: #e3edE6; color: var(--sage-dark); }
.badge.cancelled, .badge.no_show { background: #f5e2e0; color: var(--red); }
.badge.yes { background: #eaf2ea; color: var(--sage-dark); }
.badge.no { background: #f5e2e0; color: var(--red); }
.badge.pending { background: #fdf0c2; color: #8a6300; }
.badge.approved, .badge.paid { background: #eaf2ea; color: var(--sage-dark); }
.badge.flagged, .badge.withheld, .badge.denied { background: #f5e2e0; color: var(--red); }
.badge.exported { background: #f1ede6; color: var(--gray); }
.badge.insert { background: #eaf2ea; color: var(--sage-dark); }
.badge.update { background: #fdf0c2; color: #8a6300; }
.badge.delete { background: #f5e2e0; color: var(--red); }
.badge.inactive { background: #f5e2e0; color: var(--red); }

.empty { color: var(--gray); font-size: 0.88rem; padding: 8px 0; }
.muted { color: var(--gray); font-size: 0.82rem; }
.error { color: var(--red); font-size: 0.85rem; margin-top: 8px; font-weight: 600; }
.success { color: var(--sage-dark); font-size: 0.85rem; margin-top: 8px; font-weight: 600; }

/* ---------- Login / sign-up (index.html) ---------- */
body.auth-body { background: var(--brown-dark); }
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}
.auth-hero { text-align: center; padding: calc(44px + env(safe-area-inset-top)) 0 26px; }
.auth-hero img { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.auth-hero h1 { margin: 14px 0 2px; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); }
.auth-hero p { margin: 0; color: #e8d9c3; font-size: 0.92rem; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--white); border-radius: 18px;
  padding: 22px 22px 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.auth-card h2 { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; }
.auth-sub { color: var(--gray); font-size: 0.88rem; margin: 0 0 12px; line-height: 1.4; }
.auth-card label { font-size: 0.85rem; margin-top: 14px; }
.auth-card input { padding: 13px 14px; font-size: 16px; border: 1.5px solid #e8d9b8; border-radius: 10px; }
.auth-card .btn.big { margin-top: 20px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--brown); font-weight: 700; font-size: 0.82rem;
  padding: 8px 10px; cursor: pointer; border-radius: 8px;
}
.pw-toggle:hover { background: var(--cream); }
.auth-links { display: flex; justify-content: center; margin-top: 16px; }
.link-btn { background: none; border: none; padding: 6px; cursor: pointer; color: var(--brown); font: inherit; font-size: 0.9rem; font-weight: 600; }
.link-btn:hover { color: var(--brown-dark); text-decoration: underline; }
.auth-foot { width: 100%; max-width: 400px; margin-top: 16px; }
.install-tip {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255, 255, 255, 0.08); color: #f3e7d3; border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px; padding: 12px 14px; font-size: 0.86rem; line-height: 1.4;
}
.get-app-link {
  display: block; text-align: center; margin: 14px auto 0; padding: 10px 16px;
  color: var(--yellow); font-weight: 700; font-size: 0.95rem; text-decoration: none;
  border: 1.5px solid rgba(255, 203, 8, 0.45); border-radius: 999px; width: fit-content;
}
.get-app-link:hover, .get-app-link:focus-visible { background: rgba(255, 203, 8, 0.12); }
.install-tip button { margin-left: auto; background: none; border: none; color: #f3e7d3; font-size: 1rem; cursor: pointer; padding: 0 4px; }
.tabs { display: flex; margin-bottom: 6px; background: var(--cream); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs button {
  flex: 1; background: none; border: none; padding: 11px 0; font-size: 0.88rem;
  font-weight: 700; color: var(--brown); cursor: pointer; border-radius: 9px;
}
.tabs button.active { color: var(--brown-dark); background: var(--yellow); box-shadow: 0 1px 3px rgba(56, 25, 12, 0.15); }

/* iPhone zooms in on any text box under 16px; keep them at 16px on phones. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
}

.grid-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  flex: 1; min-width: 120px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; text-align: center; border-top: 3px solid var(--yellow);
}
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--brown-dark); }
.stat .label { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.03em; }

.tabnav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabnav button {
  background: var(--white); border: 1.5px solid var(--tan); padding: 8px 16px;
  border-radius: 20px; font-size: 0.85rem; font-weight: 700; color: var(--brown-dark); cursor: pointer;
}
.tabnav button.active { background: var(--brown-dark); color: var(--yellow); border-color: var(--brown-dark); }

/* Admin nav: pages grouped into dropdown menus */
.navgroup { position: relative; }
.navgroup.active > .navgroup-btn { background: var(--brown-dark); color: var(--yellow); border-color: var(--brown-dark); }
.navgroup.open > .navgroup-btn { border-color: var(--brown-dark); }
.navgroup:has(.alert-count:not(.hidden)) > .navgroup-btn::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px;
  border-radius: 50%; background: var(--red); vertical-align: middle;
}
.navmenu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 220px; padding: 6px; background: var(--white);
  border: 1px solid #eadcc4; border-radius: 12px; box-shadow: 0 8px 24px rgba(56, 25, 12, 0.16);
}
.navgroup.open .navmenu { display: block; }
.tabnav .navmenu button {
  display: block; width: 100%; text-align: left; border: none; border-radius: 8px;
  background: none; padding: 10px 12px; font-weight: 600;
}
.tabnav .navmenu button:hover { background: var(--cream); }
.tabnav .navmenu button.active { background: var(--tan); color: var(--brown-dark); }
.report-filters { padding-top: 12px; padding-bottom: 12px; }
.report-filters label { margin-top: 0; }
.alert-count {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 0.72rem; font-weight: 700; line-height: 1.4; text-align: center;
}
/* Row "Manage ▾" menus (actionMenu() in shared.js), styled like the nav menus. */
.action-menu { display: inline-block; }
.action-menu-btn {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
  background: var(--white); color: var(--brown-dark); border: 1.5px solid #e8d9b8; border-radius: 8px;
  padding: 6px 10px 6px 12px; font: inherit; font-size: 0.82rem; font-weight: 700;
}
.action-menu-btn:hover, .action-menu.open .action-menu-btn { border-color: var(--brown-dark); background: var(--cream); }
.action-menu-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.action-menu-btn .caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: 0.7;
}
.action-menu-list {
  display: none; position: fixed; z-index: 75; min-width: 190px; padding: 6px;
  background: var(--white); border: 1px solid #eadcc4; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(56, 25, 12, 0.16);
}
.action-menu.open .action-menu-list { display: block; }
.action-menu-list button {
  display: block; width: 100%; text-align: left; white-space: nowrap; cursor: pointer;
  background: none; border: none; border-radius: 8px; padding: 9px 12px;
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--brown-dark);
}
.action-menu-list button:hover, .action-menu-list button:focus { outline: none; background: var(--cream); }
.action-menu-list button.danger { color: var(--red); }
.action-menu-list button.danger:hover, .action-menu-list button.danger:focus { background: #f9e9e7; }
.hidden { display: none !important; }
/* Admin > Stores: the searchable Store List comes before the Add a Store form. */
#tab-stores { display: flex; flex-direction: column; }
small.hint { display:block; color: var(--gray); margin-top: 4px; font-size: 0.76rem; }
/* Admin > Calendar (week / month of shifts). */
.cal-wrap { overflow-x: auto; }
[data-calview].active { background: var(--yellow); border-color: var(--yellow-dark); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 700px; }
.cal-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--brown); padding: 2px 4px; }
.cal-day { background: var(--white); border: 1px solid var(--tan); border-radius: 8px; min-height: 92px; padding: 4px; font-size: 0.74rem; }
.cal-grid.week .cal-day { min-height: 220px; }
.cal-day.other { opacity: 0.45; }
.cal-day.today { border: 2px solid var(--yellow-dark); }
.cal-day.blackout { background: #f6eeee; }
.cal-day .cal-date { font-weight: 700; display: flex; justify-content: space-between; gap: 4px; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--sage-dark); border-radius: 5px; padding: 3px 5px; margin-top: 3px;
  background: var(--cream); color: var(--brown-dark); font: inherit; cursor: pointer; line-height: 1.25; overflow: hidden; }
.cal-grid.month .cal-chip { white-space: nowrap; text-overflow: ellipsis; }
.cal-chip:hover, .cal-chip:focus { background: var(--tan); }
.cal-chip.unconfirmed { border-left-color: var(--yellow-dark); }
.cal-chip.open { background: transparent; border: 1px dashed var(--brown); }
.cal-chip.cancelled { text-decoration: line-through; opacity: 0.55; border-left-color: var(--gray); }
.cal-chip.done { border-left-color: var(--gray); opacity: 0.8; }
.cal-chip.drop { border-left-color: var(--red); }
.cal-day { cursor: default; user-select: none; }
.cal-date-btn { background: none; border: 0; padding: 0 4px; border-radius: 5px; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.cal-date-btn:hover, .cal-date-btn:focus-visible { background: var(--tan); outline: none; }
.cal-more { display: block; width: 100%; margin-top: 3px; padding: 2px 5px; border: 0; background: none; text-align: left;
  font: inherit; font-weight: 700; color: var(--brown); cursor: pointer; text-decoration: underline; }
/* Day view and the day popup: one full-detail row per shift. */
.cal-daylist { display: flex; flex-direction: column; gap: 6px; }
.cal-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  background: var(--cream); color: var(--brown-dark); border: 0; border-left: 4px solid var(--sage-dark); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 0.88rem; line-height: 1.35; }
.cal-item:hover, .cal-item:focus-visible { background: var(--tan); outline: none; }
.cal-item-time { flex: 0 0 auto; min-width: 128px; font-weight: 700; white-space: nowrap; }
.cal-item-main { flex: 1; min-width: 0; }
.cal-item-state { flex: 0 0 auto; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.cal-item.unconfirmed { border-left-color: var(--yellow-dark); }
.cal-item.open { background: transparent; border: 1px dashed var(--brown); }
.cal-item.cancelled { opacity: 0.55; border-left-color: var(--gray); }
.cal-item.cancelled .cal-item-main strong { text-decoration: line-through; }
.cal-item.done { border-left-color: var(--gray); }
.cal-item.drop { border-left-color: var(--red); }
@media (max-width: 640px) {
  .cal-item { flex-wrap: wrap; gap: 4px 10px; }
  .cal-item-time { min-width: 0; }
  .cal-item-main { flex-basis: 100%; order: 3; }
}
.ui-dialog.wide { width: min(720px, calc(100% - 32px)); }
.ui-dialog.wide form { max-height: calc(100vh - 64px); overflow-y: auto; }
/* Admin > Schedule a Shift: type-to-search store picker. */
.store-combo { position: relative; }
.store-combo-list {
  position: absolute; left: 0; right: 0; z-index: 20; max-height: 280px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--brown); border-radius: var(--radius); box-shadow: var(--shadow);
}
.store-combo-list button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none;
  font: inherit; color: var(--brown-dark); cursor: pointer;
}
.store-combo-list button small { color: var(--gray); }
.store-combo-list button:hover, .store-combo-list button.active { background: var(--tan); }
.store-combo-list .empty { padding: 10px 12px; }

/* ---------- BA app (phone-first) ---------- */
body.ba-app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.ba-app .container { max-width: 620px; padding-top: 16px; }
body.sheet-open { overflow: hidden; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center;
  background: var(--white); border-top: 1px solid #eadcc4;
  box-shadow: 0 -2px 12px rgba(56, 25, 12, 0.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bnav button {
  flex: 1; max-width: 130px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 10px;
  font-size: 0.68rem; font-weight: 700; color: var(--gray);
}
.bnav button .ico { font-size: 1.3rem; line-height: 1; filter: grayscale(0.7); opacity: 0.75; }
.bnav button.active { color: var(--brown-dark); background: var(--tan); }
.bnav button.active .ico { filter: none; opacity: 1; }

/* Me tab: a valid certificate drops below the stats and shrinks. */
#batab-me { display: flex; flex-direction: column; }
#batab-me > * { order: 0; }
#batab-me.cert-ok #certCard { order: 1; }
#batab-me .account-card { order: 2; }
#batab-me.cert-ok #certCard h2 { margin-bottom: 8px; }
#batab-me.cert-ok #certCard .thumb { width: 48px; height: 48px; }

.media-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.thumb { display: block; width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--tan); }
.thumb.sm { width: 72px; height: 72px; }
.msg-with-action { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.announce + .announce, .announce-older .announce { border-top: 1px solid var(--tan); padding-top: 12px; margin-top: 12px; }
.announce-title { font-weight: 700; }
.announce-meta { margin-bottom: 6px; }
.announce-body { white-space: pre-wrap; }
.announce-older { margin-top: 10px; }
.announce-older > summary { cursor: pointer; font-weight: 600; color: var(--gray); font-size: 0.85rem; }
.account-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top-color: var(--tan); }
.account-card .muted { word-break: break-all; }
.greeting { font-size: 1.35rem; font-weight: 800; margin: 4px 0 2px; }
.greeting-sub { color: var(--gray); font-size: 0.88rem; margin-bottom: 16px; }

.hero { padding: 4px 0; }
.hero + .hero { border-top: 1px solid var(--tan); margin-top: 14px; padding-top: 18px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-store { font-size: 1.2rem; font-weight: 800; }
.hero-time { margin-top: 6px; font-size: 0.95rem; }
.hero-when { font-weight: 700; color: var(--brown); }
.maps-link { display: inline-block; margin-top: 4px; color: var(--brown); font-size: 0.86rem; text-decoration: none; }
.maps-link:hover, .maps-link:focus { text-decoration: underline; }
.hero-addr { margin-top: 2px; color: var(--gray); font-size: 0.86rem; }
.store-btns { display: flex; gap: 8px; margin-top: 12px; }
.store-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 12px; border-radius: 10px;
  background: var(--white); border: 1.5px solid #e8d9b8; color: var(--brown-dark);
  font-weight: 700; font-size: 0.95rem; text-decoration: none; touch-action: manipulation;
}
.store-btn:hover, .store-btn:focus-visible { border-color: var(--brown-dark); background: var(--cream); outline: none; }
.store-btn:active { background: var(--tan); }
.store-btns.compact { margin-top: 8px; }
.store-btns.compact .store-btn { flex: 0 1 auto; min-height: 38px; padding: 7px 12px; font-size: 0.84rem; }
.note-pill { margin-top: 8px; background: var(--cream); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem; }

.steps { display: flex; gap: 4px; margin: 16px 0 4px; }
.steps .step { flex: 1; text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--gray); }
.steps .step .bar { height: 5px; border-radius: 3px; background: #efe6d4; margin-bottom: 5px; }
.steps .step.done .bar { background: var(--sage); }
.steps .step.done { color: var(--sage-dark); }
.steps .step.current .bar { background: var(--yellow); }
.steps .step.current { color: var(--brown-dark); }

.btn.big { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font-size: 1.1rem; padding: 17px 20px; border-radius: 12px; }
.btn.link { background: none; border: none; color: var(--brown); padding: 8px 0; font-weight: 600; text-decoration: underline; margin-top: 6px; }
.btn.link:hover { background: none; color: var(--brown-dark); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(56, 25, 12, 0.25); border-top-color: var(--brown-dark);
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-msg { border-radius: 10px; padding: 12px 14px; margin-top: 12px; font-size: 0.9rem; white-space: pre-line; }
.inline-msg.error { background: #f9e9e7; color: var(--red); border: 1.5px solid #e9c2bd; font-weight: 600; }
.inline-msg.success { background: #eaf2ea; color: var(--sage-dark); border: 1.5px solid #c5dccb; font-weight: 600; }
.inline-msg.info { background: var(--tan); color: var(--brown-dark); border: 1.5px solid var(--yellow-dark); }

.check-row {
  display: flex !important; align-items: center; gap: 12px;
  background: var(--white); border: 1.5px solid var(--tan); border-radius: 10px;
  padding: 12px 14px; margin: 8px 0 !important; cursor: pointer;
  font-size: 0.95rem !important; font-weight: 600 !important; color: var(--brown-dark) !important;
}
.check-row input { width: 22px !important; height: 22px; accent-color: var(--sage-dark); flex-shrink: 0; }
.check-row:has(input:checked) { border-color: var(--sage); background: #f2f8f3; }

.photo-tile {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 130px; margin: 8px 0 0 !important; padding: 14px !important;
  border: 2px dashed var(--brown); border-radius: 12px; background: var(--white);
  cursor: pointer; text-align: center; color: var(--brown) !important; font-size: 0.95rem !important;
}
.photo-tile .big-ico { font-size: 2rem; }
.photo-tile img { max-width: 100%; max-height: 220px; border-radius: 8px; object-fit: cover; }
.photo-tile.has-photo { border-style: solid; border-color: var(--sage); }
.photo-tile .retake { font-size: 0.8rem; color: var(--gray); font-weight: 600; }

.stepper { display: flex; align-items: stretch; border: 1.5px solid #e8d9b8; border-radius: 10px; overflow: hidden; background: var(--white); }
.stepper button {
  width: 36px; flex-shrink: 0; border: none; background: var(--cream); color: var(--brown-dark);
  font-size: 1.3rem; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.stepper button:active { background: var(--tan); }
.stepper input { border: none; border-radius: 0; text-align: center; font-size: 1.05rem; font-weight: 700; padding: 10px 2px; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--yellow-dark); box-shadow: var(--focus-ring); }

.prod-row { background: var(--white); border: 1px solid var(--tan); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.prod-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
.prod-qty { display: grid; grid-template-columns: 1fr 1fr 48px; gap: 8px; align-items: end; }
.mini { display: block; font-size: 0.7rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 3px; }
.sold-cell { text-align: center; }
.sold-cell strong { display: block; font-size: 1.25rem; padding: 8px 0; }
.sold-cell.bad strong { color: var(--red); }
/* Recap: Starting Units and Ending Units are separate questions. */
.prod-row.count-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 10px; }
.prod-row.count-row .prod-name { margin-bottom: 0; }
.prod-qty.end-qty { grid-template-columns: 1fr 64px; }
.prod-row.end-row.not-started { opacity: 0.55; }
.start-echo { font-weight: 600; font-size: 0.8rem; }
@media (max-width: 360px) { .prod-row.count-row { grid-template-columns: 1fr 128px; } }
/* Admin > Edit recap: compact unit boxes. */
.recap-edit-units input { width: 90px; padding: 6px 8px; margin: 0; }
.recap-edit-units td, .recap-edit-units th { padding: 4px 8px; }
/* BA recap: several receipt photos. */
.receipt-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.receipt-list:empty { display: none; }
.receipt-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--tan); }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(56, 25, 12, 0.75); color: #fff; font-size: 0.8rem; cursor: pointer; }
/* Payroll > Pay Cycle Summary. */
.pay-cycle .pc-ba:hover td { background: var(--cream); }
.pay-cycle .pc-total td { border-top: 2px solid var(--brown-dark); }
/* Admin: red banner when alerts aren't reaching anyone (migration 055). */
.alert-banner { background: #fbe9e7; border: 2px solid var(--red); color: #7a1d12; border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; font-size: 0.92rem; }
.alert-banner ul { margin: 6px 0 8px; padding-left: 20px; }
.alert-banner .btn { margin: 0; }
.quick-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-range .btn { margin: 0; }

/* Admin on a phone held upright: tighter spacing, menus that fit the screen,
   wide tables scroll sideways inside their card instead of stretching the page. */
@media (max-width: 640px) {
  body.admin-app .container { padding: 12px 10px 60px; }
  body.admin-app .card { padding: 14px 12px; margin-bottom: 14px; }
  body.admin-app .grid-stats { gap: 8px; margin-bottom: 14px; }
  body.admin-app .stat { min-width: calc(50% - 4px); padding: 10px 8px; }
  body.admin-app .stat .num { font-size: 1.3rem; }
  body.admin-app .tabnav { gap: 6px; margin-bottom: 14px; }
  body.admin-app .tabnav > button, body.admin-app .navgroup-btn { padding: 7px 11px; font-size: 0.8rem; }
  body.admin-app .navgroup-btn .ng-current { display: none; }
  body.admin-app .navgroup { position: static; }
  body.admin-app .tabnav { position: relative; }
  body.admin-app .navmenu { left: 0; right: 0; min-width: 0; }
  body.admin-app .tabnav .navmenu button { padding: 12px; }
  body.admin-app .row > * { min-width: 100%; }
  body.admin-app .toolbar { padding: 10px; }
  body.admin-app .toolbar select { min-width: 0; width: 100%; }
  body.admin-app .toolbar label { width: 100%; margin-left: 0 !important; }
  body.admin-app table { font-size: 0.8rem; }
  body.admin-app th, body.admin-app td { padding: 6px 7px; }
  body.admin-app .card h2 { font-size: 0.98rem; flex-wrap: wrap; }
  #calLabel { min-width: 0 !important; font-size: 0.9rem; }
  .ui-dialog.wide { width: calc(100% - 16px); }
  .ui-dialog.wide form { padding: 16px 12px; }
  .recap-edit-units input { width: 64px; }
}
/* Phone turned sideways: keep the top compact so more of the page fits. */
@media (orientation: landscape) and (max-height: 500px) {
  body.admin-app .container { padding-top: 10px; }
  body.admin-app .stat { padding: 8px; }
}
.total-bar { display: flex; justify-content: space-between; align-items: center; background: var(--brown-dark); color: var(--yellow); border-radius: 10px; padding: 12px 14px; font-weight: 800; }

.seg { display: flex; gap: 8px; }
.seg label {
  flex: 1; margin: 0 !important; text-align: center; cursor: pointer;
  border: 1.5px solid #e8d9b8; border-radius: 10px; background: var(--white);
  padding: 12px 6px; font-size: 0.95rem !important; font-weight: 700 !important; color: var(--brown-dark) !important;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--brown-dark); color: var(--yellow) !important; border-color: var(--brown-dark); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus-ring); }

.field-error { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 10px; }

details.more { margin: 14px 0; background: var(--cream); border: 1px solid var(--tan); border-radius: 8px; padding: 0 16px; }
details.more summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--brown); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "＋"; float: right; }
details.more[open] summary::after { content: "－"; }
details.more[open] { padding-bottom: 14px; }

.sheet { position: fixed; inset: 0; z-index: 60; background: var(--cream); display: flex; flex-direction: column; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brown-dark); color: var(--white); padding: 12px 16px; border-bottom: 3px solid var(--yellow);
}
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-head .muted { color: #e8d9c3; }
.sheet-head button { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 0.85rem; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px 24px; }
.sheet-body > form, .sheet-foot > div { max-width: 620px; margin: 0 auto; }
.sheet-foot { background: var(--white); border-top: 1px solid #eadcc4; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.sheet-foot .btn { margin-top: 0; }
.sheet-foot .inline-msg { margin: 0 0 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 80; max-width: calc(100% - 32px); width: max-content;
  background: var(--brown-dark); color: var(--white); padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25); font-weight: 600; font-size: 0.92rem;
  animation: toastIn 0.2s ease-out;
}
.toast.error { background: var(--red); }
body:not(.ba-app) .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

.ui-dialog {
  border: none; border-radius: 16px; padding: 0; color: var(--brown-dark);
  width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.ui-dialog::backdrop { background: rgba(56, 25, 12, 0.45); }
.ui-dialog form { padding: 20px 20px 18px; }
.ui-dialog h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 800; }
.ui-dialog p { margin: 0 0 6px; white-space: pre-line; line-height: 1.45; color: #5a4332; font-size: 0.93rem; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ui-dialog-actions .btn { margin-top: 0; }
.ui-dialog .inline-msg { margin-top: 10px; }

.topbar .brand img { width: 30px; height: 30px; border-radius: 8px; }
body.admin-app .card { overflow-x: auto; }
/* Admin tables need the room; the BA app keeps its narrow phone column. */
body.admin-app .container { max-width: 1280px; }
.topbar > div:last-child { display: flex; align-items: center; gap: 12px; }
.topbar #whoami { color: var(--yellow); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
@media (max-width: 520px) { .topbar #whoami { display: none; } }

/* Small buttons in table rows and toolbars. */
.btn.sm { margin-top: 0; padding: 6px 11px; font-size: 0.8rem; border-radius: 7px; white-space: nowrap; }
.btn.danger.sm { background: var(--white); color: var(--red); border: 1.5px solid var(--red); }
.btn.danger.sm:hover { background: #f9e9e7; }
td .btn, td .btn.sm { vertical-align: middle; margin: 2px 4px 2px 0; }
td .btn:last-child { margin-right: 0; }
td { vertical-align: middle; }
.nowrap { white-space: nowrap; }

/* Compact filter strip above a table (instead of a full card). */
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px; margin-bottom: 16px;
}
.toolbar label { margin: 0; font-size: 0.85rem; }
.toolbar select { width: auto; min-width: 220px; }

.navgroup-btn .ng-current { font-weight: 600; opacity: 0.85; }
.navgroup-btn .ng-current:not(:empty)::before { content: " · "; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.shift-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--tan); }
.shift-row:last-child { border-bottom: none; }
.date-block { width: 54px; flex-shrink: 0; text-align: center; background: var(--cream); border-radius: 10px; padding: 6px 0; border: 1px solid var(--tan); }
.date-block .dow { font-size: 0.66rem; font-weight: 800; color: var(--brown); text-transform: uppercase; }
.date-block .day { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.date-block .mon { font-size: 0.66rem; font-weight: 700; color: var(--gray); text-transform: uppercase; }
.shift-row .info { flex: 1; min-width: 0; }
.shift-row .info strong { display: block; }

.week-label { font-size: 0.75rem; font-weight: 800; color: var(--brown); text-transform: uppercase; letter-spacing: 0.04em; margin: 16px 0 6px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.day-tile {
  border: 1.5px solid #e8d9b8; background: var(--white); border-radius: 12px; padding: 10px 4px;
  cursor: pointer; text-align: center; color: var(--brown-dark); font-family: inherit; touch-action: manipulation;
}
.day-tile .dow { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--brown); }
.day-tile .num { font-size: 1.05rem; font-weight: 800; }
.day-tile .state { font-size: 0.7rem; font-weight: 700; color: var(--gray); margin-top: 2px; }
.day-tile.on { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }
.day-tile.on .dow, .day-tile.on .state { color: #e4f0e8; }
.day-tile .special { display: block; font-size: 0.62rem; font-weight: 700; margin-top: 3px; color: #8a6300; }
.day-tile.part { background: #e6f1ea; border-color: var(--sage); }
.day-tile.part .state { color: var(--sage-dark); }

.slot-menu {
  position: fixed; z-index: 70; width: 270px; max-width: calc(100vw - 24px);
  background: var(--white); border: 1px solid #eadcc4; border-radius: 14px;
  box-shadow: 0 12px 36px rgba(56, 25, 12, 0.25); padding: 14px 14px 12px;
}
.slot-menu-title { font-weight: 800; font-size: 1rem; }
.slot-menu-sub { color: var(--gray); font-size: 0.84rem; margin-bottom: 4px; }
.slot-menu .check-row { padding: 10px 12px; }
.slot-menu-actions { display: flex; gap: 8px; margin-top: 10px; }
.slot-menu-actions .btn { flex: 1; margin-top: 0; padding: 10px 12px; }
.day-tile.on .special { color: var(--yellow); }
.save-bar {
  position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brown-dark); color: var(--white); border-radius: 12px; padding: 10px 12px 10px 16px; margin-top: 16px;
  box-shadow: 0 4px 16px rgba(56, 25, 12, 0.25);
}
.save-bar .btn { margin-top: 0; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.quick-actions .btn { margin-top: 0; padding: 8px 14px; font-size: 0.82rem; }

.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--tan); }
.pay-row:last-child { border-bottom: none; }
.pay-row .amt { font-size: 1.1rem; font-weight: 800; text-align: right; }
.pay-row > div:last-child { text-align: right; }

/* BA Pay tab: each shift opens to show how its pay adds up. */
.pay-item { border-bottom: 1px solid var(--tan); }
.pay-item:last-child { border-bottom: none; }
.pay-item > summary { list-style: none; cursor: pointer; border-bottom: none; }
.pay-item > summary::-webkit-details-marker { display: none; }
.pay-item > summary strong::after { content: "›"; display: inline-block; margin-left: 6px; color: var(--gray); transition: transform 0.15s; }
.pay-item[open] > summary strong::after { transform: rotate(90deg); }
.pay-break { background: var(--cream); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.pay-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 6px 0; font-size: 0.9rem; }
.pay-line + .pay-line { border-top: 1px dashed #eadcc4; }
.pay-line .hint { margin-top: 1px; }
.pay-line > span:last-child { font-weight: 700; white-space: nowrap; }
.pay-line.total { font-weight: 800; border-top: 1.5px solid var(--tan) !important; }
.pay-break .inline-msg { margin: 8px 0 4px; }
.pay-help { margin: 12px 0 6px; }
.pay-legend { margin: 0; font-size: 0.82rem; color: var(--gray); display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; }
.pay-legend dt { font-weight: 700; color: var(--brown-dark); }
.pay-legend dd { margin: 0; }

/* Retailer chart on the BA Me tab: retailers down the left, units/hour across. */
.rc { position: relative; padding-top: 20px; }
.rc-row { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; padding: 5px 0; border-radius: 6px; cursor: default; }
.rc-row:focus-visible { outline: 2px solid var(--yellow-dark); outline-offset: 2px; }
.rc-name { font-size: 0.84rem; font-weight: 700; color: var(--brown-dark); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-track { position: relative; height: 22px; margin-right: 34px; }
.rc-bar { height: 100%; min-width: 2px; background: var(--brown); border-radius: 0 4px 4px 0; }
.rc-row:hover .rc-bar, .rc-row:focus .rc-bar { background: var(--brown-dark); }
.rc-val { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 6px; font-size: 0.8rem; font-weight: 700; color: var(--brown-dark); }
.rc-lines { position: absolute; top: 14px; bottom: 0; left: 122px; right: 34px; pointer-events: none; }
.rc-team { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--brown-dark); }
.rc-team span { position: absolute; top: -14px; left: 4px; font-size: 0.7rem; font-weight: 700; color: var(--gray); white-space: nowrap; }
.rc-axis { display: flex; justify-content: space-between; margin: 4px 34px 0 122px; padding-top: 3px; border-top: 1px solid var(--tan); font-size: 0.7rem; color: var(--gray); }
.rc-tip { position: absolute; z-index: 5; pointer-events: none; white-space: nowrap; background: var(--brown-dark); color: var(--white); font-size: 0.78rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow); }

.grid-stats.compact .stat { padding: 12px 8px; min-width: 90px; }
.grid-stats.compact .stat .num { font-size: 1.25rem; }

/* ============================================================
   Admin visual refresh (Nov 3). Kokada brand colors, admin pages only
   (body.admin-app), so the BA app looks the same.
   ============================================================ */
body.admin-app {
  --k-yellow: #FFCB08; --k-husk: #A56A42; --k-shell: #722113; --k-treacle: #391A0C; --k-palm: #BFD730;
  --k-teal: #209E8C; --k-red: #EA4128; --k-deep-teal: #2C6B6C; --k-mint: #9AC5B0; --k-orange: #F6861F;
  --k-cream: #FFF7E7; --k-butter: #FFF2C4; --k-sea: #D9EAE8; --k-lime-bg: #F4F7DB;
  --brown-dark: var(--k-treacle); --brown: var(--k-husk); --cream: var(--k-cream); --tan: var(--k-butter);
  --red: var(--k-red); --gray: var(--k-husk);
  --shadow: 0 1px 3px rgba(57, 26, 12, 0.06), 0 6px 18px rgba(57, 26, 12, 0.07);
  color: var(--k-treacle);
}
body.admin-app .card { border-top: none; box-shadow: var(--shadow); }
body.admin-app h1, body.admin-app h2, body.admin-app h3 { color: var(--k-treacle); }
body.admin-app small.hint, body.admin-app .muted { color: var(--k-husk); }
body.admin-app small.hint { font-size: 0.82rem; }
body.admin-app .muted { font-size: 0.86rem; }
body.admin-app th { color: var(--k-husk); }
body.admin-app .ico { flex: 0 0 auto; vertical-align: -3px; color: var(--k-husk); }
body.admin-app .card h2 .ico { color: var(--k-husk); width: 20px; height: 20px; }
body.admin-app .tabnav .ico { margin-right: 2px; }
body.admin-app .navgroup.active .ico, body.admin-app .tabnav > button.active .ico { color: var(--k-yellow); }
/* Error text stays dark enough to read (Shell) with a Brownie red edge. */
body.admin-app .error, body.admin-app .inline-msg.error { color: var(--k-shell); }

/* Logo */
.brand .wordmark, .topbar .brand img.wordmark { height: 26px; width: auto; display: block; border-radius: 0; }
.brand.no-wordmark .wordmark, .auth-hero.no-wordmark .wordmark { display: none; }
.brand:not(.no-wordmark) .brand-fallback, .auth-hero:not(.no-wordmark) .brand-fallback { display: none; }
.brand .brand-fallback { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.auth-hero img.wordmark { width: auto; height: 64px; max-width: 80%; border-radius: 0; box-shadow: none; margin: 0 auto 6px; }

/* 1. One status chip per shift. Each Kokada color is the accent; text uses a darker
   Kokada shade where the bright one wouldn't be readable on its background. */
.s-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem;
  font-weight: 700; white-space: nowrap; border: 1.5px solid transparent; line-height: 1.35; }
.s-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.s-chip.unconfirmed { background: #FFF2C4; color: #722113; border-color: #F6861F; }
.s-chip.unconfirmed::before { background: #F6861F; }
.s-chip.confirmed { background: #D9EAE8; color: #2C6B6C; border-color: #209E8C; }
.s-chip.confirmed::before { background: #209E8C; }
.s-chip.live { background: #F4F7DB; color: #391A0C; border-color: #BFD730; }
.s-chip.live::before { background: #BFD730; box-shadow: 0 0 0 2px rgba(191, 215, 48, 0.35); }
.s-chip.done { background: #F3ECE6; color: #6E4628; border-color: #E2D3C6; }
.s-chip.done::before { background: #A56A42; }
.s-chip.off { background: #FDE6E1; color: #722113; border-color: #EA4128; }
.s-chip.off::before { background: #EA4128; }
.s-chip.drop { background: #fff; color: #722113; border-color: #EA4128; border-style: dashed; }
.s-chip.drop::before { background: #EA4128; }
.s-chip + .s-sub { display: block; margin-top: 3px; }

/* 2. Stat tiles you act on */
body.admin-app .grid-stats .stat { border-top: none; cursor: pointer; text-align: left; border: 1.5px solid transparent;
  transition: border-color .15s, transform .15s; display: flex; gap: 12px; align-items: center; font: inherit; color: inherit; }
body.admin-app .grid-stats .stat:hover, body.admin-app .grid-stats .stat:focus-visible { border-color: var(--k-husk); outline: none; transform: translateY(-1px); }
body.admin-app .stat .stat-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--k-cream); color: var(--k-husk); flex: 0 0 auto; }
body.admin-app .stat .stat-ico .ico { width: 20px; height: 20px; color: inherit; }
body.admin-app .stat .num { font-size: 1.5rem; line-height: 1.1; }
body.admin-app .stat .label { color: var(--k-husk); text-transform: none; letter-spacing: 0; font-size: 0.82rem; font-weight: 600; }
body.admin-app .stat.attn { border-color: var(--k-orange); background: linear-gradient(0deg, #fff, #fff) padding-box; box-shadow: inset 4px 0 0 var(--k-orange), var(--shadow); }
body.admin-app .stat.attn .stat-ico { background: var(--k-butter); color: var(--k-shell); }

/* 3. Live board: every section fills the card, and the first four columns (BA, Store,
   Scheduled, Status) have the same widths in every section, so they line up. The scheduled
   time stays on one line. Narrower screens get a fixed 1040px table that scrolls. */
table.board-table { table-layout: fixed; width: 100%; }
table.board-table col.c-ba { width: 12%; } table.board-table col.c-store { width: 17%; }
table.board-table col.c-when { width: 20%; } table.board-table col.c-status { width: 13%; }
table.board-table col.c-in, table.board-table col.c-out { width: 9%; } table.board-table col.c-recap { width: 7%; }
table.board-table col.c-menu { width: 13%; } table.board-table.compact col.c-menu { width: 38%; }
table.board-table col.c-todo { width: 17%; } table.board-table col.c-actions { width: 17%; }
table.board-table td { overflow-wrap: anywhere; }
table.board-table td:nth-child(3) { overflow-wrap: normal; }
table.board-table .s-chip, table.board-table .badge { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 1100px) {
  table.board-table, table.board-table.compact { width: 1040px; }
}

/* 4. Calendar: retailer color on the left edge, unconfirmed dashed amber, skeleton while loading */
.cal-chip, .cal-item { border-left-color: var(--rc, #A56A42) !important; }
.cal-chip.unconfirmed, .cal-item.unconfirmed { outline: 1.5px dashed #F6861F; outline-offset: -1.5px; }
.cal-chip.done, .cal-item.done { opacity: 0.75; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.8rem; color: var(--k-husk, #A56A42); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--rc); display: inline-block; }
.cal-legend .lg-unconf i { background: #FFF2C4; outline: 1.5px dashed #F6861F; outline-offset: -1.5px; }
.cal-grid.weekends { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.cal-skel { background: linear-gradient(90deg, #FFF2C4 0%, #FFF7E7 50%, #FFF2C4 100%); background-size: 200% 100%; animation: calSkel 1.2s ease-in-out infinite; border-radius: 6px; }
.cal-day .cal-skel { height: 18px; margin-top: 6px; }
@keyframes calSkel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.cal-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin: 8px 0 0 !important; }

/* 9. Phone: wide tables scroll inside their card with the first column frozen; bigger tap targets */
@media (max-width: 640px) {
  body.admin-app .card table th:first-child, body.admin-app .card table td:first-child {
    position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--k-butter); }
  body.admin-app .card table tr.pc-detail td:first-child, body.admin-app .card table table td:first-child { position: static; box-shadow: none; }
  body.admin-app .card table th:first-child { background: #fff; }
  body.admin-app .tabnav .navmenu button { padding: 14px 14px; font-size: 0.95rem; }
  body.admin-app .tabnav > button, body.admin-app .navgroup-btn { padding: 9px 12px; }
  body.admin-app .grid-stats .stat { min-width: calc(50% - 4px); padding: 10px; gap: 8px; }
  body.admin-app .stat .stat-ico { width: 30px; height: 30px; }
  body.admin-app .stat .num { font-size: 1.25rem; }
}/* Existing small badges in Kokada colors, dark enough to read. */
body.admin-app .badge.no, body.admin-app .badge.cancelled, body.admin-app .badge.no_show, body.admin-app .badge.flagged,
body.admin-app .badge.withheld, body.admin-app .badge.denied, body.admin-app .badge.delete, body.admin-app .badge.inactive { background: #FDE6E1; color: #722113; }
body.admin-app .badge.yes, body.admin-app .badge.approved, body.admin-app .badge.paid, body.admin-app .badge.completed, body.admin-app .badge.insert { background: #D9EAE8; color: #2C6B6C; }
body.admin-app .badge.pending, body.admin-app .badge.active, body.admin-app .badge.update { background: #FFF2C4; color: #722113; }
body.admin-app .badge.scheduled, body.admin-app .badge.exported { background: #F3ECE6; color: #6E4628; }/* Wide tables scroll inside their own box; on phones the card itself stays still. */
.tbl-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  body.admin-app .card { overflow-x: visible; }
  body.admin-app .inline-msg table td:first-child { position: static; background: transparent; box-shadow: none; }
}@media (max-width: 640px) {
  #payCycleCard > div:first-child > div { width: 100%; }
  #payCycleSel { min-width: 0 !important; width: 100% !important; }
}/* Icons inside buttons take the button's text color. */
body.admin-app .btn .ico, body.admin-app button .ico { color: currentColor; }
/* Mark-paid (and any main button) clearly grayed out when there's nothing to do. */
body.admin-app .btn:disabled { background: #EDE6DF; color: #9C8A7C; border-color: transparent; cursor: not-allowed; box-shadow: none; }
/* Raw Data: names, dates and times on one line; other columns get room before wrapping. */
table.raw-data td { min-width: 90px; }
/* One line per row (Nov 18): long text is cut in the preview (hover to read it all); the CSV keeps everything. */
table.raw-data td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
table.raw-data th.nowrap, table.raw-data td.nowrap { white-space: nowrap; }/* Admin top bar: the logo is a "home" link; "My demos" for Admins who do demos (Nov 4). */
.topbar a.brand { color: inherit; text-decoration: none; cursor: pointer; }
.topbar a.brand:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; border-radius: 6px; }
.topbar .topbar-link { color: var(--white); text-decoration: none; border: 1px solid rgba(255,255,255,0.4); padding: 6px 14px; border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; }
.topbar .topbar-link:hover { background: rgba(255,255,255,0.14); }
/* BA app opened by an Admin doing demos: no certificate, pay, availability or open shift sections. */
body.admin-demo #certCard, body.admin-demo #certBanner, body.admin-demo [data-tab="pay"], body.admin-demo [data-tab="avail"],
body.admin-demo #openShiftsCard, body.admin-demo #certStat { display: none !important; }
.admin-demo-bar { background: var(--yellow); color: var(--brown-dark); text-align: center; font-size: 0.85rem; font-weight: 700; padding: 6px 12px; }
.admin-demo-bar a { color: var(--brown-dark); }/* Team & Stores > Store Map (Nov 4). */
.sm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; margin-top: 10px; }
.store-map { height: 620px; border-radius: 10px; border: 1px solid var(--tan); overflow: hidden; background: #E8EEF0; z-index: 0; }
.sm-side { display: flex; flex-direction: column; min-height: 0; }
.sm-list { max-height: 590px; overflow-y: auto; border: 1px solid var(--tan); border-radius: 10px; background: #fff; }
.sm-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--tan); padding: 8px 10px; font: inherit; font-size: 0.86rem; color: inherit; cursor: pointer; }
.sm-item:hover, .sm-item:focus-visible { background: var(--cream); outline: none; }
.sm-item i, .sm-key i, .sm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); flex: 0 0 auto; margin-top: 3px; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(57,26,12,.25); }
.sm-dot { margin: 0 5px -1px 0; }
.sm-legend { margin: 8px 0 0; }
.sm-key { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--tan); border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--brown-dark); cursor: pointer; }
.sm-key i { margin-top: 0; }
.sm-key.on { border-color: var(--brown-dark); background: var(--cream); }
.sm-pop { font-size: 0.85rem; line-height: 1.45; color: #391A0C; }
.sm-pop-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sm-pop-actions .btn { margin: 0; }
@media (max-width: 900px) {
  .sm-layout { grid-template-columns: 1fr; }
  .store-map { height: 60vh; }
  .sm-list { max-height: 360px; }
}

/* ---- Store check chips (migration 061) + calmer Schedule form ---- */
.prep-chip { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font: inherit; font-size: 0.74rem; font-weight: 700;
  line-height: 1.5; white-space: nowrap; cursor: pointer; border: 1.5px solid transparent; }
.prep-chip:disabled { cursor: default; }
.prep-chip:hover:not(:disabled) { filter: brightness(0.96); box-shadow: 0 0 0 2px rgba(57,26,12,.12); }
.prep-chip.p-sched { background: #f3efe8; color: #6b5a4d; border-color: #e2d8ca; }
.prep-chip.p-contact { background: #D9EAE8; color: #2C6B6C; border-color: #b5d4d0; }
.prep-chip.p-order { background: #FFF2C4; color: #7a5a00; border-color: #f2d97a; }
.prep-chip.p-ok { background: #F4F7DB; color: #4f5d0b; border-color: #d6e38a; }
.prep-chip.p-bad { background: #fde3dc; color: #722113; border-color: #f2b3a3; }
.cal-item-state .prep-chip { margin-top: 3px; font-size: 0.7rem; }
.prep-sum { font-weight: 600; font-size: 0.8rem; color: var(--muted, #7a6a5d); margin-left: 6px; }
.prep-sum b { color: #722113; }
.ba-status { margin-top: 6px; font-size: 0.82rem; font-weight: 600; min-height: 1.2em; }
.ba-status.ok { color: #2C6B6C; }
.ba-status.warn { color: #8a5a00; }
.ba-status.bad { color: #722113; }
.store-int-note { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #FFF2C4; border: 1px solid #f2d97a;
  color: #391A0C; font-size: 0.82rem; line-height: 1.4; white-space: pre-line; }
.sm-pop .store-int-note { margin: 4px 0 6px; }
details.shift-more { margin-top: 12px; border: 1px dashed #e2d8ca; border-radius: 10px; padding: 8px 12px; }
details.shift-more > summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; color: #6b5a4d; list-style: revert; }
details.shift-more[open] > summary { margin-bottom: 8px; }

/* ============================================================
   Admin sidebar (Nov 10). Computer: fixed on the left, can collapse to icons.
   Phone / tablet (900px and under): slides in from the menu button.
   ============================================================ */
body.admin-app { --sb-w: 252px; }
body.admin-app.sb-collapsed { --sb-w: 68px; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); z-index: 50; display: flex; flex-direction: column;
  background: #2A1206; color: #F3E7D3; border-right: 3px solid var(--k-yellow); transition: width .18s ease, transform .2s ease; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); min-height: 60px; }
.sb-head .brand { color: #fff; text-decoration: none; display: flex; align-items: center; min-width: 0; }
.sb-head .brand .wordmark { height: 24px; width: auto; }
.sb-tag { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #C9B49F; }
.sb-x { display: none; margin-left: auto; background: none; border: 0; color: #F3E7D3; padding: 6px; border-radius: 8px; cursor: pointer; }
.sidenav { flex: 1; overflow-y: auto; padding: 6px 0 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sb-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #A58C77; padding: 14px 18px 6px; white-space: nowrap; }
body.admin-app .sidenav button, .sb-btn { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-left: 4px solid transparent;
  color: #EADBC8; font: inherit; font-size: 0.9rem; font-weight: 600; text-align: left; padding: 9px 14px; cursor: pointer; text-decoration: none; white-space: nowrap; border-radius: 0; margin: 0; }
body.admin-app .sidenav button .ico, .sb-btn .ico { color: #C9B49F; width: 19px; height: 19px; flex: 0 0 19px; }
body.admin-app .sidenav button span:first-of-type, .sb-btn span { overflow: hidden; text-overflow: ellipsis; }
body.admin-app .sidenav button:hover, .sb-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
body.admin-app .sidenav button.active { background: var(--k-shell); color: #fff; border-left-color: var(--k-yellow); }
body.admin-app .sidenav button.active .ico { color: var(--k-yellow); }
body.admin-app .sidenav button:focus-visible, .sb-btn:focus-visible { outline: 2px solid var(--k-yellow); outline-offset: -2px; }
body.admin-app .sidenav .alert-count { margin-left: auto; position: static; }
.sb-foot { border-top: 1px solid rgba(255,255,255,0.1); padding: 8px 0 10px; }
.sb-who { font-size: 0.78rem; color: #C9B49F; padding: 6px 18px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-btn { font-size: 0.84rem; padding: 8px 14px; }
.sb-scrim { display: none; }
body:not(.sb-ready) .sidebar, body:not(.sb-ready).admin-app { transition: none !important; }

/* Computer */
@media (min-width: 901px) {
  body.admin-app { padding-left: var(--sb-w); transition: padding-left .18s ease; }
  body.admin-app .admin-topbar { display: none; }
  body.admin-app .container { padding-top: 20px; }
  body.sb-collapsed .sidebar .sb-label, body.sb-collapsed .sidebar .sb-tag, body.sb-collapsed .sb-who,
  body.sb-collapsed .sidenav button span, body.sb-collapsed .sb-btn span { display: none; }
  body.sb-collapsed .sidenav button span.alert-count:not(.hidden) { display: block; position: absolute; margin: 0; transform: translate(14px, -10px); font-size: 0.62rem; padding: 1px 5px; }
  body.sb-collapsed .sidenav button { justify-content: center; padding: 11px 0; position: relative; }
  body.sb-collapsed .sb-btn { justify-content: center; padding: 10px 0; }
  body.sb-collapsed .sb-head { justify-content: center; padding: 16px 6px; }
  body.sb-collapsed .sb-head .brand .wordmark { height: 18px; }
  body.sb-collapsed .sidenav { padding-top: 10px; }
  body.sb-collapsed .sidenav button:nth-of-type(1) { margin-top: 0; }
  body.sb-collapsed .sb-collapse .ico { transform: rotate(180deg); }
}

/* Phone / tablet */
@media (max-width: 900px) {
  body.admin-app .admin-topbar { position: sticky; top: 0; z-index: 45; justify-content: flex-start; gap: 10px; padding: 10px 12px; }
  .sb-burger { background: none !important; border: 0 !important; color: #fff; padding: 6px !important; margin: -4px 0 -4px -4px; display: grid; place-items: center; }
  .sb-burger .ico { width: 24px; height: 24px; color: #fff !important; }
  .admin-topbar .brand .wordmark { height: 20px; }
  .page-title { margin-left: auto; color: var(--k-yellow); font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
  .sidebar { width: min(290px, 86vw); transform: translateX(-105%); z-index: 90; box-shadow: none; }
  body.sb-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,0.35); }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(30,12,4,0.45); z-index: 89; }
  body.sb-open { overflow: hidden; }
  .sb-x { display: grid; place-items: center; }
  .sb-collapse { display: none !important; }
  body.admin-app .sidenav button { padding: 12px 16px; font-size: 0.95rem; }
}

/* ============================================================
   Phone: no sideways scrolling. Tables turn into one card per row
   with the column name on the left; filters sit label | box;
   long help text shows two lines (tap to read the rest).
   ============================================================ */
@media (max-width: 1100px) {
  body.admin-app .tbl-scroll { overflow-x: visible; }
  body.admin-app table.stackable, body.admin-app table.stackable > tbody, body.admin-app table.stackable > thead { display: block; width: 100% !important; min-width: 0 !important; }
  body.admin-app table.stackable colgroup, body.admin-app table.stackable > thead, body.admin-app table.stackable tr.stk-head { display: none; }
  body.admin-app table.stackable tr { display: block; background: #fff; border: 1.5px solid var(--k-butter); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  body.admin-app table.stackable tr:hover { background: #fff; }
  body.admin-app table.stackable td { display: block; position: relative !important; padding: 4px 0 4px 36% !important; min-height: 1.4em;
    border: 0 !important; box-shadow: none !important; background: transparent !important; white-space: normal !important;
    overflow-wrap: anywhere; text-align: left !important; min-width: 0 !important; width: auto !important; }
  body.admin-app table.stackable td::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 33%; font-weight: 600; font-size: 0.76rem; color: var(--k-husk); line-height: 1.25; }
  body.admin-app table.stackable td:not([data-label]), body.admin-app table.stackable td.stk-wide, body.admin-app table.stackable td:first-child { padding-left: 0 !important; }
  body.admin-app table.stackable td:not([data-label])::before, body.admin-app table.stackable td.stk-wide::before { display: none; }
  body.admin-app table.stackable td:first-child { font-weight: 700; font-size: 0.95rem; padding-bottom: 6px !important; margin-bottom: 2px; border-bottom: 1px solid var(--k-butter) !important; }
  body.admin-app table.stackable td:first-child::before { display: none; }
  body.admin-app table.stackable td:empty, body.admin-app table.stackable td.stk-empty { display: none; }
  body.admin-app table.stackable td .btn, body.admin-app table.stackable td button { margin-top: 2px; margin-bottom: 2px; }
  body.admin-app table.stackable td .s-chip, body.admin-app table.stackable td .badge { margin: 1px 4px 1px 0; }
  body.admin-app table.stackable td.stk-wide > * { max-width: 100%; }
  body.admin-app table.stackable td select, body.admin-app table.stackable td input:not([type=checkbox]):not([type=radio]) { max-width: 100% !important; }

}
/* Tablet / laptop with the sidebar (641–1100px): two fields per line in each card. */
@media (min-width: 641px) and (max-width: 1100px) {
  body.admin-app table.stackable tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; padding: 10px 14px; }
  body.admin-app table.stackable td { padding-left: 38% !important; }
  body.admin-app table.stackable td:first-child, body.admin-app table.stackable td.stk-wide, body.admin-app table.stackable td:not([data-label]) { grid-column: 1 / -1; padding-left: 0 !important; }
  body.admin-app table.stackable tr.stk-head, body.admin-app table.stackable tr[style*="display: none"], body.admin-app table.stackable tr.hidden { display: none !important; }
}
@media (max-width: 640px) {
  body.admin-app .toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; }
  body.admin-app .toolbar label { width: auto; margin: 0 !important; font-size: 0.82rem; }
  body.admin-app .toolbar > :not(label):not(select):not(input) { grid-column: 1 / -1; }
  body.admin-app .toolbar label:has(input[type="checkbox"]) { grid-column: 1 / -1; }

  body.admin-app .card > p.muted, body.admin-app .card > small.hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  body.admin-app .card > p.muted.open, body.admin-app .card > small.hint.open { display: block; -webkit-line-clamp: unset; }
  body.admin-app .container { padding: 10px 10px 60px; }
}

/* Approve Demo, bottom of a recap (Nov 10) */
.approve-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #F4F7DB; border: 1.5px solid #d6e38a; }
.approve-box:empty { display: none; }
.approve-steps { margin: 4px 0 12px; padding-left: 20px; font-size: 0.9rem; line-height: 1.6; }
.approve-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; letter-spacing: 0.04em; padding: 12px 22px; margin: 0 0 8px; }
.approve-done { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #2C6B6C; font-size: 1rem; }
.approve-done .ico { color: #209E8C !important; }
.approve-box .btn.link { display: block; margin: 8px 0 0; padding-left: 0; }
@media (max-width: 640px) { .approve-btn { width: 100%; justify-content: center; } }

/* Top tiles and the alert-health banner: Live Board only (Nov 10), so other pages start with their own content. */
body.admin-app[data-tab]:not([data-tab="board"]) #stats, body.admin-app[data-tab]:not([data-tab="board"]) #alertBanner { display: none !important; }
/* Availability by BA: one line each (Nov 10) */
.avail-row { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--tan); }
.avail-name { flex: 0 0 170px; font-weight: 700; font-size: 0.92rem; }
.avail-name small { display: block; font-weight: 500; color: var(--k-husk, #A56A42); font-size: 0.76rem; }
.avail-days { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.avail-none { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--cream); font-size: 0.86rem; line-height: 1.5; }
@media (max-width: 640px) { .avail-row { flex-direction: column; gap: 6px; } .avail-name { flex: none; } }
/* Fold-away cards (Nov 10) */
body.admin-app .card.fold > h2 { cursor: pointer; margin-bottom: 0; user-select: none; }
body.admin-app .card.fold > h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--k-husk); transition: transform .15s; }
body.admin-app .card.fold.open > h2::before { transform: rotate(90deg); }
body.admin-app .card.fold.open > h2 { margin-bottom: 12px; }
body.admin-app .card.fold:not(.open) > .fold-body { display: none; }
body.admin-app .card.fold:not(.open) { padding-top: 14px; padding-bottom: 14px; }
body.admin-app .card.fold > h2:focus-visible { outline: 2px solid var(--k-yellow); outline-offset: 4px; border-radius: 6px; }
/* Edit forms tucked under a "Change…" heading (Pay Rules, Nov 10) */
details.edit-fold > summary { cursor: pointer; font-weight: 700; color: var(--k-treacle, #391A0C); padding: 4px 0; }
details.edit-fold[open] > summary { margin-bottom: 10px; }
/* Search + filter row above long lists (Nov 10) */
.list-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.list-tools input[type="search"] { flex: 1 1 240px; max-width: 360px; margin: 0; }
.list-tools select { width: auto; margin: 0; }
.list-tools-btns { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.list-tools-btns .btn { margin: 0; }
@media (max-width: 640px) { .list-tools input[type="search"], .list-tools select { max-width: none; flex: 1 1 100%; } .list-tools-btns { margin-left: 0; } }
/* Report filters fold away on phones (Nov 10) */
.rf-toggle { display: none; }
@media (max-width: 640px) {
  .rf-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 2px 0; font: inherit; font-weight: 700; color: var(--k-treacle, #391A0C); cursor: pointer; text-align: left; }
  .report-filters:not(.rf-open) .rf-body { display: none !important; }
  .report-filters.rf-open .rf-toggle { margin-bottom: 10px; }
  body.admin-app .card.report-filters { padding-top: 12px; padding-bottom: 12px; }
}
/* ================= Performance visuals (Nov 11) ================= */
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pv-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-seg { display: inline-flex; background: #F6EFE5; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.pv-seg button { border: 0; background: none; font: inherit; font-size: 0.82rem; font-weight: 700; color: #6b5a4d; padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; margin: 0; }
.pv-seg button:hover { color: #391A0C; }
.pv-seg button.on { background: #fff; color: #391A0C; box-shadow: 0 1px 3px rgba(57,26,12,.15); }
.pv-seg button:focus-visible { outline: 2px solid #FFCB08; outline-offset: 1px; }
.pv-compare { font-size: 0.82rem; margin: 6px 0 12px; }
.pv-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pv-tile { border: 1.5px solid #F2EADF; border-radius: 12px; padding: 12px 14px 8px; background: #fff; min-width: 0; }
.pv-tile-label { font-size: 0.78rem; font-weight: 700; color: #8A7766; }
.pv-tile-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.pv-tile-value { font-size: 1.6rem; font-weight: 800; color: #391A0C; line-height: 1.15; }
.pv-spark { display: block; width: 100%; height: 32px; }
.pv-delta { font-size: 0.76rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-delta.good { color: #2C6B6C; } .pv-delta.bad { color: #B23A24; } .pv-delta.flat { color: #8A7766; }
.pv-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 10px; }
.pv-h3 { font-size: 0.9rem; margin: 0 0 10px; color: #6b5a4d; }
.pv-bars { display: flex; flex-direction: column; gap: 2px; }
.pv-bar-row { display: grid; grid-template-columns: 172px minmax(0, 1fr); align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; cursor: default; }
.pv-bar-row:hover, .pv-bar-row:focus-visible { background: #FBF6EF; outline: none; }
.pv-bar-name { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 7px; align-items: center; font-size: 0.86rem; font-weight: 700; color: #391A0C; min-width: 0; }
.pv-bar-name i { width: 10px; height: 10px; border-radius: 50%; grid-row: 1 / span 2; }
.pv-bar-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-bar-name small { grid-column: 2; font-weight: 500; color: #8A7766; font-size: 0.74rem; }
.pv-bar-track { position: relative; height: 22px; margin-right: 54px; }
.pv-bar { position: absolute; left: 0; top: 2px; height: 18px; background: #2C6B6C; border-radius: 0 4px 4px 0; min-width: 2px; }
.pv-bar-val { position: absolute; top: 2px; z-index: 2; line-height: 18px; font-size: 0.8rem; font-weight: 700; color: #391A0C; white-space: nowrap; font-variant-numeric: tabular-nums; background: #fff; padding: 0 4px; margin-left: -4px; border-radius: 4px; }
.pv-bar-row:hover .pv-bar-val, .pv-bar-row:focus-visible .pv-bar-val { background: #FBF6EF; }
.pv-avg { position: absolute; z-index: 1; top: -3px; bottom: -3px; width: 0; border-left: 2px solid #A56A42; }
.pv-avg-key { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: #6b5a4d; margin: 8px 0 0 186px; }
.pv-avg-mark { display: inline-block; width: 2px; height: 14px; background: #A56A42; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.78rem; color: #6b5a4d; margin: -4px 0 8px; align-items: center; }
.pv-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.pv-mixbar { display: flex; gap: 2px; height: 26px; }
.pv-seg-part { min-width: 4px; border-radius: 4px; font-size: 0.74rem; font-weight: 800; line-height: 26px; padding-left: 7px; white-space: nowrap; overflow: visible; }
.pv-seg-part.great { background: #2C6B6C; color: #fff; }
.pv-seg-part.ok { background: #D9CBB8; color: #391A0C; }
.pv-seg-part.bad { background: #C8432B; color: #fff; }
.pv-multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pv-mini { border: 1.5px solid #F2EADF; border-radius: 12px; padding: 10px 10px 4px; background: #fff; min-width: 0; }
.pv-mini-head { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; flex-wrap: wrap; }
.pv-mini-head i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.pv-mini-head strong { color: #391A0C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.pv-mini-val { margin-left: auto; font-weight: 800; color: #391A0C; }
.pv-mini-svg { display: block; width: 100%; height: auto; margin-top: 4px; touch-action: pan-y; }
.pv-axis { font-size: 11.5px; fill: #9C8A7C; font-family: inherit; font-variant-numeric: tabular-nums; }
.pv-cross.hidden { display: none; }
.pv-tablebtn { margin: 10px 0 0 !important; padding-left: 0 !important; }
.pv-tip { position: fixed; z-index: 85; max-width: 260px; background: #391A0C; color: #fff; font-size: 0.8rem; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; }
.pv-tip .muted { color: #E5D6C4 !important; }
@media (max-width: 1100px) { .pv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pv-two { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .pv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-tile-value { font-size: 1.3rem; }
  .pv-bar-row { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
  .pv-avg-key { margin-left: 124px; }
  .pv-multiples { grid-template-columns: 1fr; }
  .pv-seg button { padding: 6px 9px; }
}
/* Week by week (one big chart) + BA cost per unit (Nov 11) */
#pvWeekly, #pvCac { width: 100%; overflow: hidden; }
.pv-weekly-svg, .pv-cac-svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; }
.pv-plot-title { font-weight: 700; fill: #6b5a4d; }
.pv-endlabel { font-weight: 800; fill: #391A0C; font-size: 12px; }
.pv-whi.hidden { display: none; }
.pv-line-key { display: inline-block; width: 16px !important; height: 2px !important; border-radius: 1px !important; background: #2C6B6C; vertical-align: 3px !important; }
.pv-tip-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.pv-zone { display: inline-block; width: 16px !important; height: 12px !important; border-radius: 2px !important; }
.pv-zone.great { background: #E4EFEE; border: 1px solid #b9d3d1; } .pv-zone.bad { background: #F9E4DF; border: 1px solid #efc2b7; }
.pv-dot-key { display: inline-block; width: 8px !important; height: 8px !important; border-radius: 50% !important; background: rgba(44,107,108,.35); }
.pv-mark-key { display: inline-block; width: 12px !important; height: 12px !important; border-radius: 50% !important; background: #2C6B6C; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #d8cfc4; }
.pv-cac-name { font-size: 13px; font-weight: 700; fill: #391A0C; font-family: inherit; }
.pv-cac-val { font-size: 12.5px; font-weight: 800; fill: #391A0C; font-family: inherit; font-variant-numeric: tabular-nums; }
.pv-cac-row { cursor: default; }
.pv-cac-row.on > rect:first-child { fill: rgba(57,26,12,0.04); }
/* What moves CAC + BA list (Nov 11) */
#pvDrivers .pv-bar-track { margin-right: 120px; }
.pv-need { position: absolute; z-index: 1; top: -3px; bottom: -3px; width: 0; border-left: 3px solid #391A0C; border-radius: 2px; }
.pv-need-key { display: inline-block; width: 3px !important; height: 14px !important; border-radius: 2px !important; background: #391A0C; vertical-align: -3px !important; }
#pvCacLegend .pv-need-key { background: #A56A42; width: 2px !important; }
.pv-gap { font-size: 0.72rem; font-weight: 800; margin-left: 4px; }
.pv-gap.good { color: #2C6B6C; } .pv-gap.bad { color: #B23A24; }
.pv-inline-sel { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: #6b5a4d; margin: 0; }
.pv-inline-sel select { width: auto; min-width: 170px; margin: 0; }
table.ba-cac-list { max-width: 560px; }
table.ba-cac-list td:nth-child(2), table.ba-cac-list td:nth-child(3), table.ba-cac-list th:nth-child(2), table.ba-cac-list th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { #pvDrivers .pv-bar-track { margin-right: 96px; } .pv-inline-sel, .pv-inline-sel select { width: 100%; } }
/* Tiles open a BA × retailer breakdown (Nov 11) */
button.pv-tile { font: inherit; text-align: left; cursor: pointer; color: inherit; width: 100%; margin: 0; transition: border-color .15s, box-shadow .15s; }
button.pv-tile:hover { border-color: #D9C6AE; }
button.pv-tile:focus-visible { outline: 2px solid #FFCB08; outline-offset: 2px; }
button.pv-tile.open { border-color: #2C6B6C; box-shadow: inset 0 -3px 0 #2C6B6C; }
.pv-tile-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pv-tile-more { font-size: 0.7rem; font-weight: 700; color: #2C6B6C; white-space: nowrap; opacity: 0.85; }
.pv-detail { margin-top: 12px; border: 1.5px solid #2C6B6C; border-radius: 12px; padding: 12px 14px; background: #fff; }
.pv-detail-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-detail-head strong { color: #391A0C; }
.pv-detail-head .muted { font-size: 0.8rem; }
.pv-detail-x { margin-left: auto; border: 0; background: #F6EFE5; color: #391A0C; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 0.9rem; }
.pv-x-wrap { overflow-x: auto; }
table.pv-x { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 0.85rem; }
table.pv-x th { font-size: 0.72rem; white-space: normal; text-align: center; padding: 6px 4px; line-height: 1.25; vertical-align: bottom; min-width: 56px; }
table.pv-x th:first-child, table.pv-x td.pv-x-name { text-align: left; }
table.pv-x td { text-align: center; padding: 7px 8px; border-radius: 6px; border: 0; font-variant-numeric: tabular-nums; font-weight: 700; color: #391A0C; white-space: nowrap; }
table.pv-x td small { display: block; font-weight: 500; font-size: 0.68rem; opacity: 0.75; }
table.pv-x td.pv-x-name { font-weight: 700; white-space: nowrap; }
table.pv-x td.pv-x-empty { color: #CDBFAF; font-weight: 400; }
table.pv-x td.pv-x-total { background: #F6EFE5; }
table.pv-x tr.pv-x-foot td { background: #F6EFE5; font-weight: 800; }
table.pv-x tr:hover td { box-shadow: inset 0 0 0 1px rgba(57,26,12,0.08); }
.pv-x-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
@media (max-width: 640px) {
  .pv-tile-more { display: none; }
  .pv-detail { padding: 10px; }
  body.admin-app table.stackable.pv-x td { text-align: left !important; }
}
/* ================= Performance page layout + shared filter bar (Nov 11 cleanup) ================= */
/* Filter bar: presets, then three dropdowns, all on one line on a computer. */
.report-filters { padding-top: 14px !important; padding-bottom: 12px !important; }
.rf-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.rf-dates { flex: 0 1 auto; }
.rf-selects { display: flex; gap: 8px; flex: 1 1 360px; justify-content: flex-end; flex-wrap: wrap; }
.rf-selects select { width: auto; min-width: 150px; max-width: 220px; margin: 0; padding-top: 7px; padding-bottom: 7px; font-size: 0.86rem; }
.rf-custom { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; background: #FBF6EF; border-radius: 10px; }
.rf-custom label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.84rem; font-weight: 700; color: #6b5a4d; }
.rf-custom input { width: auto; margin: 0; padding: 6px 8px; }
.rf-foot { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin-top: 10px; font-size: 0.8rem; }
.rf-foot .muted { font-size: 0.8rem; }
.rf-check { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-weight: 600; font-size: 0.8rem; color: #6b5a4d; }
.rf-check input { width: auto; margin: 0; }
.rf-check.rf-check-2 { margin-left: 14px; }
.contest-note { margin: 0 0 8px; font-size: 0.85rem; color: #391A0C; }
.push-reset { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #F0E3D2; border-left: 4px solid #A56A42; border-radius: 10px; background: #FBF6EF; font-size: 0.9rem; color: #391A0C; }
/* Availability grid (Nov 18) */
.avail-grid { border-collapse: separate; border-spacing: 0; width: auto; min-width: 100%; }
.avail-grid th { font-size: 0.72rem; text-align: center; padding: 6px 4px; white-space: nowrap; font-weight: 700; color: #6b5a4d; }
.avail-grid th.ag-special { color: #A56A42; }
.avail-grid td.ag { text-align: center; font-weight: 700; font-size: 0.78rem; min-width: 40px; padding: 7px 4px; border: 2px solid #fff; border-radius: 6px; }
.avail-grid td.ag-name { white-space: nowrap; font-weight: 700; position: sticky; left: 0; background: #fff; z-index: 1; padding-right: 12px; }
.avail-grid td.ag-name small { display: block; font-weight: 500; color: #8a7a6c; font-size: 0.7rem; }
.ag-yes { background: #D8EBDD; color: #1F6B4A; }
.ag-part { background: #FBEFC4; color: #8a5a00; }
.ag-no { background: #F6D5CD; color: #B23A24; }
.ag-none { background: #F1EEEA; color: #b0a698; }
.ag-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: 0.8rem; color: #6b5a4d; }
.ag-legend .ag { display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.recap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 8px; }
.recap-selall { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 0.85rem; }
.recap-selall input, .recap-pick { width: auto; margin: 0 6px 0 0; }
.ex-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.ex-filters select, .ex-filters input[type=date] { margin: 0; width: auto; max-width: 190px; }
.ex-date { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 0.8rem; color: #6b5a4d; }
.ar-states summary { cursor: pointer; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.ar-states-list { position: absolute; z-index: 30; background: #fff; border: 1px solid #E5D6C4; border-radius: 10px; padding: 8px 12px; max-height: 260px; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.15); min-width: 190px; }
.ar-states-list label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.85rem; margin: 2px 0; }
.ar-states-list input { width: auto; margin: 0; }
.match-row { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid #F0E3D2; }
.match-row:first-child { border-top: 0; }
.match-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-flag-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.pv-reviewed td { opacity: 0.6; }
/* Total demo cost strip (Nov 12) */
.pv-spend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 0 0 12px; padding: 10px 16px; border: 1px solid #F0E3D2; border-radius: 12px; background: #fff; }
.pv-spend-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #A56A42; }
.pv-spend-num { font-size: 1.6rem; font-weight: 800; color: #391A0C; line-height: 1.1; }
.pv-spend-note { font-size: 0.85rem; color: #6b5a4d; }
@media (max-width: 640px) { .pv-spend { padding: 10px 12px; } .pv-spend-num { font-size: 1.4rem; } }
.rf-foot .btn.link { margin: 0; padding: 0; }
.rf-foot .btn.link:disabled { background: none; color: #C9B8A6; }

/* Section labels between groups of cards */
.pv-section { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #A58C77; margin: 26px 2px 10px; display: flex; align-items: center; gap: 10px; }
.pv-section::after { content: ""; flex: 1; height: 1px; background: #E9DDCF; }
#tab-performance > .report-filters + .pv-section { margin-top: 18px; }

/* Card headers: title + one-line subtitle on the left, controls on the right */
.pv-card { padding: 18px 20px; }
.pv-card .pv-head { align-items: flex-start; margin-bottom: 14px; }
.pv-title h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.pv-title h2 .ico { color: #A56A42; }
.pv-sub { margin: 3px 0 0; font-size: 0.82rem; color: #8A7766; }
.pv-compare { display: none; }
.pv-panel { min-width: 0; }
.pv-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pv-panel-head .pv-h3 { margin: 0; }
.pv-two { gap: 36px; margin-top: 4px; }
.pv-two > section + section { border-left: 1px solid #F0E6DA; padding-left: 32px; }
.pv-viewbtn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #E6D9C9; background: #fff; color: #6b5a4d; font: inherit; font-size: 0.76rem; font-weight: 700; padding: 4px 9px; border-radius: 8px; cursor: pointer; margin: 0; white-space: nowrap; }
.pv-viewbtn .ico { width: 14px; height: 14px; color: inherit !important; }
.pv-viewbtn:hover { border-color: #C9B39B; color: #391A0C; }
.pv-viewbtn[aria-pressed="true"] { background: #F6EFE5; color: #391A0C; }
.pv-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.pv-cols > .card { margin-bottom: 0; }
.pv-select { width: auto; min-width: 160px; margin: 0; padding-top: 6px; padding-bottom: 6px; font-size: 0.86rem; }
.pv-more { margin: 10px 0 0 !important; padding-left: 0 !important; }
.pv-card table { font-size: 0.86rem; }
.pv-card.fold > h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
#tab-performance .pv-cols + .pv-section { margin-top: 26px; }
@media (max-width: 1100px) {
  .pv-cols { grid-template-columns: 1fr; }
  .pv-cols > .card + .card { margin-top: 0; }
  .pv-two > section + section { border-left: 0; padding-left: 0; border-top: 1px solid #F0E6DA; padding-top: 18px; }
  .rf-selects { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .pv-card { padding: 14px 12px; }
  .pv-section { margin: 20px 2px 8px; }
  .rf-selects select { flex: 1 1 100%; max-width: none; }
  .rf-check { margin-left: 0; }
  .pv-card .pv-head .pv-seg, .pv-card .pv-head .pv-select { width: 100%; }
}
@media (max-width: 640px) { .pv-tiles > .pv-tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* Retailer checklist in the report filter bar (Nov 11) */
.rf-retail { position: relative; }
.rf-retail-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 170px; justify-content: space-between; border: 1.5px solid var(--tan, #FFF2C4); background: #fff; border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 0.86rem; color: #391A0C; cursor: pointer; margin: 0; }
.rf-retail-btn:hover { border-color: #D9C6AE; }
.rf-retail-btn.picked { border-color: #2C6B6C; background: #F1F7F6; font-weight: 700; }
.rf-retail-btn span { color: #8A7766; font-size: 0.75rem; }
.rf-retail-pop { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 270px; max-height: min(72vh, 480px); overflow-y: auto; background: #fff; border: 1px solid #E6D9C9; border-radius: 12px; box-shadow: 0 10px 30px rgba(57,26,12,0.16); padding: 8px; }
.rf-retail-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; border-bottom: 1px solid #F0E6DA; margin-bottom: 4px; font-size: 0.85rem; }
.rf-retail-top .btn.link { margin: 0; padding: 0; font-size: 0.8rem; }
.rf-retail-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 8px; }
.rf-retail-row:hover { background: #FBF6EF; }
.rf-retail-row label { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 2px; font-size: 0.86rem; font-weight: 600; color: #391A0C; cursor: pointer; }
.rf-retail-row input { width: 16px; height: 16px; margin: 0; accent-color: #2C6B6C; }
.rf-retail-row small { margin-left: auto; color: #A58C77; font-weight: 600; font-variant-numeric: tabular-nums; }
.rf-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.rf-only { border: 0; background: none; color: #2C6B6C; font: inherit; font-size: 0.76rem; font-weight: 800; padding: 4px 6px; border-radius: 6px; cursor: pointer; opacity: 0; margin: 0; }
.rf-retail-row:hover .rf-only, .rf-only:focus-visible { opacity: 1; background: #E4EFEE; }
@media (hover: none) { .rf-only { opacity: 1; } }
.rf-retail-foot { display: flex; justify-content: flex-end; padding: 8px 4px 2px; border-top: 1px solid #F0E6DA; margin-top: 4px; }
.rf-retail-foot .btn { margin: 0; }
@media (max-width: 640px) { .rf-retail, .rf-retail-btn { width: 100%; } .rf-retail-pop { left: 0; right: 0; width: auto; } }
body.admin-app .card.report-filters { overflow: visible !important; position: relative; z-index: 30; }
/* "The short version" + definitions + store chart (Nov 11) */
.pv-takeaways { list-style: none; margin: 0 0 14px; padding: 12px 16px; background: #FBF6EF; border: 1px solid #F0E3D2; border-radius: 12px; display: grid; gap: 7px; }
.pv-takeaways li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 0.92rem; line-height: 1.45; color: #391A0C; }
.pv-takeaways li.pv-tk-title { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #A56A42; margin-bottom: 2px; }
.pv-tk-tag { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #8A7766; }
.pv-good { color: #2C6B6C; font-weight: 800; } .pv-bad { color: #B23A24; font-weight: 800; }
.pv-defs { margin: 10px 0 0; font-size: 0.78rem; color: #8A7766; line-height: 1.5; }
.pv-defs b { color: #6b5a4d; }
.pv-axis-note { text-align: right; font-size: 0.74rem; color: #9C8A7C; margin-top: 2px; }
.pv-stores { margin-top: 0; }
.pv-stores .pv-h3 .muted { font-weight: 600; font-size: 0.78rem; }
@media (max-width: 640px) { .pv-takeaways { padding: 10px 12px; } .pv-takeaways li { grid-template-columns: 1fr; gap: 0; } }
.pv-stores .pv-bar-row { grid-template-columns: 210px minmax(0, 1fr); }
.pv-stores .pv-bar-name span { white-space: normal; line-height: 1.2; }
@media (max-width: 640px) { .pv-stores .pv-bar-row { grid-template-columns: 130px minmax(0, 1fr); } }
/* ===== Performance review fixes (Nov 11): paid-only CAC, early reads, new cards ===== */
.pv-early-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #F3ECE6; color: #8A7766; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em; vertical-align: 1px; white-space: nowrap; }
.pv-early .pv-bar, .pv-early .pv-drv-bar, .pv-early .pv-meter-fill { opacity: 0.45; }
.pv-early .pv-bar-val, .pv-early .pv-drv-cac, tr.pv-early td, td.pv-early { color: #9C8A7C !important; }
.pv-early .pv-cac-name { fill: #8A7766; }
.pv-cac-count { font-size: 10.5px; fill: #9C8A7C; font-family: inherit; }
.pv-i { cursor: help; color: #A56A42; font-weight: 700; font-size: 0.85em; }
.pv-tile-label > span:first-child { min-width: 0; }
.pv-tile-note { font-size: 0.72rem; color: #8A7766; margin: -2px 0 4px; }
.pv-trend-wait { font-size: 0.72rem; color: #A58C77; font-style: italic; height: 32px; display: flex; align-items: center; }
.pv-unpaid { grid-column: 1 / -1; font-size: 0.78rem; color: #8A7766; margin-top: 6px; }
.pv-unpaid::before { content: "ⓘ "; color: #A56A42; }
.pv-tk-note { color: #8A7766; font-size: 0.82rem; }
.pv-head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pv-traffic button { padding: 5px 10px; font-size: 0.78rem; }
/* What's driving CAC */
.pv-drv-head, .pv-drv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 62px; gap: 12px; align-items: center; }
.pv-drv-head { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #A58C77; padding: 0 4px 6px; }
.pv-drv-head span:last-child, .pv-drv-cac { text-align: right; }
.pv-drv-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-drv-bar { height: 14px; border-radius: 0 4px 4px 0; background: #2C6B6C; min-width: 2px; flex: 0 1 auto; }
.pv-drv-bar.cost { background: #A56A42; }
.pv-drv-cell span { font-size: 0.8rem; font-weight: 700; color: #391A0C; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-drv-cac { font-weight: 800; color: #391A0C; font-variant-numeric: tabular-nums; }
/* Conversion */
.pv-conv-team { font-size: 0.86rem; color: #391A0C; background: #FBF6EF; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.pv-conv-sub { font-weight: 500; color: #8A7766; font-size: 0.74rem; }
/* Shelf health */
.pv-shelf-head, .pv-shelf-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.pv-shelf-head { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #A58C77; padding: 0 4px 6px; }
.pv-shelf-row { padding: 5px 4px; border-radius: 8px; }
.pv-meter-cell { display: flex; align-items: center; gap: 8px; }
.pv-meter { flex: 1; height: 10px; border-radius: 999px; background: #F0E8DD; overflow: hidden; }
.pv-meter-fill { height: 100%; background: #2C6B6C; border-radius: 999px; }
.pv-meter-fill.low { background: #C8432B; }
.pv-meter-val { font-size: 0.8rem; font-weight: 800; color: #391A0C; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.pv-check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pv-check-list li { font-size: 0.86rem; padding: 7px 10px; background: #FBF6EF; border-radius: 8px; color: #391A0C; }
tr.pv-problem td { background: #FDF0EC; }
.pv-why { font-size: 0.82rem; line-height: 1.35; }
.pv-why + .pv-why { margin-top: 3px; }
@media (max-width: 1100px) { .pv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .pv-drv-head { display: none; }
  .pv-drv-row { grid-template-columns: 1fr 1fr; row-gap: 4px; }
  .pv-drv-row .pv-bar-name { grid-column: 1 / -1; }
  .pv-drv-cac { grid-column: 1 / -1; text-align: left; }
  .pv-drv-cac::before { content: "CAC "; font-weight: 600; color: #8A7766; }
  .pv-shelf-head { display: none; }
  .pv-shelf-row { grid-template-columns: 1fr; gap: 4px; }
  .pv-head-tools { justify-content: flex-start; width: 100%; }
}
#pvConv .pv-bar-track { margin-right: 190px; }
@media (max-width: 640px) { #pvConv .pv-bar-track { margin-right: 54px; } .pv-conv-sub { display: none; } }
.lb-notyet { margin-top: 12px; padding: 10px 12px; background: #FBF6EF; border-radius: 10px; font-size: 0.84rem; line-height: 1.6; color: #391A0C; }

/* ---------- Performance, Nov 12: Summary / Full detail, notes, target CAC, long lists, print ---------- */
.pv-viewbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.pv-print-head { display: none; }
.pv-notes { border-left: 4px solid #FFCB08; }
.pv-notes .pv-head { margin-bottom: 6px !important; }
.pv-notes-list { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 0.95rem; line-height: 1.45; color: #391A0C; }
.pv-notes-by { font-size: 0.78rem; color: #8A7766; }
.cac-v { font-variant-numeric: tabular-nums; }
.cac-v.cac-good { color: #1F6B4A; font-weight: 800; }
.cac-v.cac-bad { color: #B23A24; font-weight: 800; }
.pv-tile-value .cac-v.cac-good, .pv-tile-value .cac-v.cac-bad { font-weight: 800; }
.pv-target { position: absolute; top: -3px; bottom: -3px; border-left: 2px dashed #1F6B4A; pointer-events: none; }
.pv-target-mark { display: inline-block; width: 0; height: 14px; border-left: 2px dashed #1F6B4A; vertical-align: -3px; margin-right: 5px; }
.pv-legend i.pv-target-mark { width: 0 !important; height: 14px !important; border-radius: 0 !important; background: none; }
.pv-early-key { display: inline-block; width: 10px !important; height: 10px !important; border-radius: 50% !important; border: 2px solid #9BB8B8; background: #fff; vertical-align: -1px !important; }
.pv-delta.neutral { color: #8A7766; }
.pv-delta-wrap { display: inline-flex; flex-direction: column; line-height: 1.15; }
.pv-under { font-size: 0.64rem; font-weight: 700; color: #A58C77; text-transform: uppercase; letter-spacing: 0.04em; }
.pv-section.pv-collapsible { cursor: pointer; user-select: none; border-radius: 6px; }
.pv-section.pv-collapsible::before { content: "▾"; font-size: 0.9rem; letter-spacing: 0; transition: transform .15s ease; order: 0; }
.pv-section.pv-collapsible.collapsed::before { transform: rotate(-90deg); }
.pv-section.pv-collapsible:hover { color: #6b5a4d; }
.pv-section.pv-collapsible:focus-visible { outline: 2px solid #FFCB08; outline-offset: 2px; }
.pv-sec-hidden { display: none !important; }
.pv-spread-wrap { margin-top: 10px; border-top: 1px solid #F0E8DD; padding-top: 6px; }
.pv-spread-btn { margin: 0 !important; padding: 4px 0 !important; }
tr.pv-gap-row td { text-align: center; color: #A58C77; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; background: #FBF6EF; padding: 4px 10px; }
.pv-gap-li { list-style: none; text-align: center; color: #A58C77; font-size: 0.78rem; font-weight: 700; padding: 2px 0; }
.lb-name { border-bottom: 1px dotted #C9B39B; cursor: help; }
.lb-table td { white-space: nowrap; }
.lb-table th { white-space: normal; vertical-align: bottom; min-width: 64px; }
.lb-table th:nth-child(-n+2) { min-width: 0; }
.pv-thin .pv-shelf, .pv-thin .pv-check-list { opacity: 0.6; }
.target-cac-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tan); }
.target-cac-row > div { width: 170px; }
.target-cac-row .btn { margin: 0; }
.target-cac-row .hint { flex: 1 1 260px; }

/* Summary: only the parts marked data-sum. The BA section can't be collapsed away in Summary. */
#tab-performance.pv-summary > :not([data-sum]):not(#pvTip) { display: none !important; }
#tab-performance.pv-summary .pv-full-only { display: none !important; }
#tab-performance.pv-summary .pv-sec-hidden[data-sum] { display: block !important; }
#tab-performance.pv-summary .pv-collapsible { cursor: default; pointer-events: none; }
#tab-performance.pv-summary .pv-collapsible::before { display: none; }

@media (max-width: 640px) {
  .pv-viewbar { flex-direction: column; align-items: stretch; }
  .pv-viewbar .pv-seg { justify-content: center; }
  .pv-viewbar .pv-seg button { flex: 1; }
}

@media print {
  @page { size: letter portrait; margin: 0.45in; }
  body.pv-printing { padding-left: 0 !important; background: #fff !important; }
  body.pv-printing .sidebar, body.pv-printing .topbar, body.pv-printing .bnav, body.pv-printing .admin-demo-bar,
  body.pv-printing .tab:not(#tab-performance), body.pv-printing .report-filters, body.pv-printing .pv-viewbar,
  body.pv-printing .pv-viewbtn, body.pv-printing .pv-more, body.pv-printing #pvNotesEdit, body.pv-printing .pv-seg,
  body.pv-printing #lbRetailer, body.pv-printing .pv-tip, body.pv-printing .pv-detail, body.pv-printing .toast,
  body.pv-printing .pv-tile-more { display: none !important; }
  body.pv-printing #tab-performance { display: block !important; }
  body.pv-printing .pv-print-head { display: block; font-size: 11pt; color: #391A0C; margin: 0 0 8px; }
  body.pv-printing .card { box-shadow: none !important; border: 1px solid #E9DDCF !important; break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px !important; padding: 10px 12px !important; }
  body.pv-printing .pv-section { margin: 8px 2px 6px; break-after: avoid; }
  body.pv-printing .pv-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 6px; }
  body.pv-printing .pv-tile { padding: 8px 8px 4px; }
  body.pv-printing .pv-tile-value { font-size: 1.2rem; }
  body.pv-printing .pv-two { grid-template-columns: 1fr 1fr !important; }
  body.pv-printing .pv-card table { font-size: 8pt; }
  body.pv-printing .pv-card th, body.pv-printing .pv-card td { padding: 3px 5px; }
  body.pv-printing svg { max-width: 100%; height: auto; }
  body.pv-printing .table-wrap { overflow: visible !important; }
  body.pv-printing * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 1100px) { body.admin-app table.stackable td.stk-tall { min-height: 2.7em; } }
