:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --panel: #ffffff;
  --panel-soft: #edf7ef;
  --panel-tint: #fbfdf8;
  --panel-warm: #fffaf1;
  --ink: #233029;
  --ink-strong: #18231d;
  --muted: #66746b;
  --line: #dfe8df;
  --line-strong: #c5d3c6;
  --accent: #1b7a61;
  --accent-dark: #115a48;
  --sun: #f2b84b;
  --sky: #6aa6b8;
  --berry: #c96d65;
  --warn: #af6e00;
  --bad: #a33c36;
  --good: #19715b;
  --shadow: 0 12px 30px rgba(43, 66, 52, 0.07);
  --shadow-soft: 0 8px 18px rgba(43, 66, 52, 0.06);
  --body-glow: rgba(242, 184, 75, 0.14);
  --body-top: #fbfcf7;
  --body-bottom: #f3f7f8;
  --main-glow: rgba(106, 166, 184, 0.12);
  --sidebar-bg: rgba(255, 255, 255, 0.94);
  --nav-bg: rgba(255, 255, 255, 0.55);
  --nav-active-bg: linear-gradient(180deg, #f3fbf5 0%, #e8f5ee 100%);
  --primary-bg: linear-gradient(180deg, #21866d, #115a48);
  --primary-hover: linear-gradient(180deg, #197a62, #0f4f40);
  --secondary-bg: #ffffff;
  --notice-bg: #eef8f0;
  --stepper-bg: #eef8f0;
  --danger-bg: #fff6f4;
  --good-bg: #e7f5ee;
  --warn-bg: #fff5df;
  --bad-bg: #fff0f0;
  --customer-hero-bg: linear-gradient(135deg, #ffffff 0%, #eef8f0 100%);
  --customer-cart-bg: #fffdfa;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, var(--body-glow), transparent 34rem),
    linear-gradient(180deg, var(--body-top) 0%, var(--bg) 48%, var(--body-bottom) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fcfdfb;
  color: var(--ink);
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(25, 113, 91, 0.18);
  border-color: var(--accent);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 0;
  padding: 0 10px 3px;
}

tbody tr {
  background: #fff;
  box-shadow: var(--shadow-soft);
}

tbody tr:hover {
  background: #fffdfa;
  box-shadow: 0 10px 24px rgba(43, 66, 52, 0.09);
}

td {
  border-top: 1px solid #e6eee5;
  border-bottom: 1px solid #e6eee5;
}

td:first-child {
  border-left: 1px solid #e6eee5;
  border-radius: 8px 0 0 8px;
}

td:last-child {
  border-right: 1px solid #e6eee5;
  border-radius: 0 8px 8px 0;
}

td input,
td select {
  min-width: 84px;
  border-color: transparent;
  background: #f7faf6;
  padding: 7px 8px;
}

td input:hover,
td select:hover {
  border-color: var(--line-strong);
}

td button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.app {
  min-height: 100vh;
  max-width: 100%;
}

.setup-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
  min-height: 100vh;
}

.setup-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.title {
  margin: 2px 0 5px;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.96;
}

.subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
}

.tester-entry-note {
  border: 1px solid rgba(15, 122, 108, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(237, 247, 239, 0.96), rgba(255, 250, 241, 0.94));
  padding: 13px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-soft);
}

.tester-entry-note span {
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tester-entry-note strong {
  display: block;
  color: var(--ink-strong);
  line-height: 1.15;
  margin-top: 4px;
}

.tester-entry-note p {
  color: var(--muted);
  line-height: 1.35;
  margin-top: 5px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  align-items: start;
}

.auth-center {
  display: grid;
  max-width: 620px;
  margin: 0 auto;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(220px, 252px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0, var(--main-glow), transparent 28rem),
    linear-gradient(180deg, var(--body-top) 0%, var(--bg) 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  border-right: 1px solid rgba(197, 211, 198, 0.78);
  background: var(--sidebar-bg);
  backdrop-filter: blur(10px);
  padding: 16px;
  overflow: auto;
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.brand .pill {
  max-width: 100%;
  justify-self: start;
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.22rem;
  font-weight: 900;
}

.brand-name::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--sun));
  box-shadow: 0 0 0 4px rgba(27, 122, 97, 0.1);
}

.brand-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.hub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  width: 100%;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.hub-link:hover {
  border-color: var(--line-strong);
  background: #fbfdf8;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legal-links a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.customer-legal {
  justify-content: center;
  margin: 18px 0 6px;
}

.legal-page {
  width: min(840px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.legal-page h1 {
  margin: 18px 0 10px;
  color: var(--ink-strong);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

.legal-page h2 {
  margin: 24px 0 8px;
  color: var(--ink-strong);
}

.legal-page p {
  color: var(--muted);
  line-height: 1.55;
}

.legal-back {
  width: auto;
  padding: 0 14px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button,
.tab-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--nav-bg);
  color: var(--ink);
  padding: 10px 11px;
  text-align: left;
  font-weight: 750;
}

.nav button span:first-child,
.tab-button span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav button.active,
.tab-button.active {
  background: var(--nav-active-bg);
  border-color: #cfe3d4;
  color: var(--accent-dark);
  box-shadow: var(--shadow-soft);
}

.nav button:hover,
.tab-button:hover {
  background: #f4f7f2;
}

.nav button span:last-child {
  min-width: 24px;
  border-radius: 999px;
  background: #f0f5ee;
  color: var(--accent-dark);
  padding: 2px 7px;
  text-align: center;
  font-size: 0.78rem;
}

.nav button span:last-child:empty {
  display: none;
}

.nav button.active span:last-child {
  background: #d7eee0;
}

.content {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 26px 22px 34px;
}

.view-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.view-head > div {
  min-width: 0;
}

.view-head h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.view-head h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.02;
  color: var(--ink-strong);
}

.view-head p,
.panel p {
  margin: 5px 0 0;
  color: var(--muted);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 17px;
  box-shadow: var(--shadow);
}

.panel.owner-section {
  padding: 20px;
}

.panel + .panel {
  margin-top: 14px;
}

.panel h2 {
  color: #213229;
}

.plan-panel {
  margin-top: 14px;
  box-shadow: none;
  background: var(--panel-tint);
}

.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px;
  box-shadow: 0 4px 12px rgba(43, 66, 52, 0.035);
}

.cards > .card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdf8 100%);
}

.cards > .card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.cards > .card:nth-child(2)::before {
  background: var(--sky);
}

.cards > .card:nth-child(3)::before {
  background: var(--sun);
}

.cards > .card:nth-child(4)::before {
  background: var(--berry);
}

.card-title {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.card-value {
  margin-top: 6px;
  font-size: 1.62rem;
  line-height: 1;
  font-weight: 900;
}

.ops-calendar-panel {
  margin-bottom: 16px;
  container-type: inline-size;
  border-color: rgba(20, 118, 83, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), rgba(235, 247, 238, 0.9)),
    var(--panel);
  box-shadow: 0 18px 42px rgba(20, 28, 22, 0.12);
}

.panel-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-toolbar h2 {
  font-size: clamp(26px, 2.3vw, 36px);
  line-height: 1.02;
  margin-top: 4px;
}

.calendar-toolbar .mini {
  max-width: 780px;
  font-size: 0.96rem;
  line-height: 1.45;
}

.ops-calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.ops-calendar-weekdays,
.ops-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.ops-calendar-weekdays b {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 102px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, var(--panel-tint));
  color: var(--ink);
  padding: 9px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.calendar-day:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(20, 118, 83, 0.38);
  box-shadow: 0 14px 26px rgba(20, 118, 83, 0.12);
}

.calendar-day.today,
.calendar-day.selected {
  border-color: var(--accent);
  outline: 3px solid rgba(20, 118, 83, 0.12);
  box-shadow: 0 16px 30px rgba(22, 128, 111, 0.14);
}

.calendar-day.has-jobs {
  background: linear-gradient(180deg, #fff, var(--good-bg));
}

.calendar-day.has-slots {
  box-shadow: inset 0 -3px 0 var(--good);
}

.calendar-day.has-blocked {
  box-shadow: inset 0 -3px 0 var(--muted);
}

.calendar-day.is-full {
  background: linear-gradient(180deg, #fff, var(--bad-bg));
  border-color: rgba(163, 60, 54, 0.34);
}

.calendar-day span {
  font-weight: 950;
}

.calendar-day small {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--good-bg);
  color: var(--good);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: anywhere;
}

.calendar-day .blocked-line {
  background: var(--bad-bg);
  color: var(--bad);
}

.calendar-day .full-line {
  background: var(--bad-bg);
  color: var(--bad);
}

.calendar-day .empty-line {
  background: var(--panel-soft);
  color: var(--muted);
}

.ops-selected-day-panel {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, var(--panel-tint));
  padding: 14px;
  box-shadow: 0 16px 34px rgba(20, 28, 22, 0.1);
}

.ops-selected-day-panel > span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.ops-selected-day-panel h3 {
  margin: 0;
}

.ops-calendar-actions,
.calendar-agenda.selected {
  display: grid;
  gap: 8px;
}

.calendar-agenda.selected div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, var(--panel-tint));
  padding: 11px;
}

.calendar-stats,
.calendar-legend {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calendar-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--panel-tint));
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.calendar-stats span,
.calendar-legend span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.18rem;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
}

.calendar-legend span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 0 10px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.legend-dot.open {
  background: var(--good);
}

.legend-dot.blocked {
  background: var(--muted);
}

.agenda-item {
  position: relative;
  display: grid;
  gap: 5px;
}

.agenda-item::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
}

.agenda-item.open::before {
  background: var(--good);
}

.agenda-item.blocked::before {
  background: var(--bad);
}

.agenda-item.job,
.agenda-item.open,
.agenda-item.blocked {
  padding-left: 14px !important;
}

.block-option-grid {
  display: grid;
  gap: 9px;
}

.block-option-grid button {
  min-height: 64px;
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
}

.block-option-grid button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.job-schedule-modal {
  width: min(920px, calc(100vw - 32px));
}

.confirm-modal {
  width: min(560px, calc(100vw - 32px));
}

.event-schedule-cell {
  display: grid;
  grid-template-columns: 100px 78px;
  gap: 6px;
}

.event-schedule-cell span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

@container (max-width: 900px) {
  .ops-calendar-shell {
    grid-template-columns: 1fr;
  }

  .ops-selected-day-panel {
    position: static;
  }

  .calendar-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 76px;
    padding: 7px;
  }
}

@container (max-width: 560px) {
  .ops-calendar-weekdays,
  .ops-calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 66px;
  }

  .calendar-day small {
    width: 100%;
    justify-content: center;
    padding-inline: 4px;
  }
}

.calendar-agenda.selected span,
.calendar-agenda.selected small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-agenda.selected strong {
  display: block;
  margin: 3px 0;
}

.card-foot {
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: -4px 0 16px;
}

.quick-actions button {
  display: grid;
  gap: 6px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f9fcf7 100%);
  color: var(--ink);
  padding: 13px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.quick-actions button:hover {
  border-color: #bfd1c2;
  background: #fffdfa;
  transform: translateY(-1px);
}

.quick-actions span {
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-actions strong {
  line-height: 1.2;
}

.demo-testimonial-guide {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 1.55fr) auto;
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(15, 122, 108, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(237, 247, 239, 0.96), rgba(255, 250, 241, 0.94));
  padding: 13px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-soft);
}

.demo-testimonial-guide > div:first-child {
  min-width: 0;
}

.demo-testimonial-guide span,
.demo-testimonial-steps span {
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-testimonial-guide strong {
  display: block;
  color: var(--ink-strong);
  line-height: 1.15;
  margin-top: 4px;
}

.demo-testimonial-guide p,
.demo-testimonial-guide small {
  color: var(--muted);
  line-height: 1.35;
  margin-top: 5px;
}

.demo-testimonial-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.demo-testimonial-steps button {
  appearance: none;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 96px;
  min-width: 0;
  color: var(--ink);
  text-align: left;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 11px;
  cursor: pointer;
}

.demo-feedback-link {
  align-self: center;
  white-space: nowrap;
}

.daily-retention-board {
  border: 1px solid rgba(15, 122, 108, 0.26);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(237, 247, 239, 0.96), rgba(255, 250, 241, 0.96)),
    var(--panel);
  padding: 15px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-soft);
}

.daily-retention-head {
  max-width: 820px;
  margin-bottom: 12px;
}

.daily-retention-head span,
.daily-retention-grid span {
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.daily-retention-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 1.2rem;
  margin-top: 4px;
}

.daily-retention-head p {
  color: var(--muted);
  margin-top: 6px;
}

.daily-retention-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-retention-grid button {
  display: grid;
  gap: 6px;
  min-height: 116px;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.daily-retention-grid button:hover {
  border-color: rgba(15, 122, 108, 0.38);
  transform: translateY(-1px);
}

.daily-retention-grid strong {
  color: var(--ink-strong);
  line-height: 1.15;
}

.daily-retention-grid small {
  color: var(--muted);
  line-height: 1.35;
}

.retention-digest {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(201, 141, 45, 0.26);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.97), rgba(237, 247, 239, 0.78)),
    var(--panel-warm);
  padding: 13px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-soft);
}

.retention-digest > div,
.retention-digest article {
  min-width: 0;
  border: 1px solid rgba(146, 126, 88, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.retention-digest span {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.retention-digest strong {
  display: block;
  color: var(--ink-strong);
  line-height: 1.15;
  margin-top: 4px;
}

.retention-digest p,
.retention-digest small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 5px;
}

.retention-alerts {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.retention-alerts > div,
.retention-alerts button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.retention-alerts button {
  appearance: none;
  display: grid;
  align-content: start;
  gap: 5px;
  text-align: left;
  color: var(--ink-strong);
  font: inherit;
  cursor: pointer;
}

.retention-alerts button.danger {
  border-color: rgba(190, 54, 45, 0.34);
  background: #fff6f3;
}

.retention-alerts button.warn {
  border-color: rgba(201, 141, 45, 0.38);
  background: #fffaf0;
}

.retention-alerts button.good {
  border-color: rgba(15, 122, 108, 0.24);
}

.retention-alerts span {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.retention-alerts strong {
  line-height: 1.15;
}

.retention-alerts small {
  color: var(--muted);
  line-height: 1.34;
}

.operator-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.operator-brief > div,
.operator-brief > button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.operator-brief > div {
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
}

.operator-brief h2 {
  margin: 3px 0 5px;
  color: var(--ink-strong);
  font-size: 1.35rem;
  line-height: 1.08;
}

.operator-brief p {
  margin: 0;
  color: var(--muted);
}

.operator-brief button {
  display: grid;
  gap: 6px;
  align-content: center;
  text-align: left;
}

.operator-brief button span {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.operator-brief button strong {
  line-height: 1.16;
}

.event-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
  padding: 13px;
  box-shadow: var(--shadow-soft);
}

.event-item strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-strong);
}

.event-money {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 92px;
}

.event-money span {
  font-weight: 950;
}

.event-money small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-list {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.inventory-record {
  display: grid;
  gap: 13px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.inventory-record-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.record-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 260px;
}

.inventory-record-head > div {
  min-width: 0;
}

.inventory-record-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-strong);
  font-size: 1.05rem;
}

.inventory-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
}

.inventory-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 248, 0.82);
  padding: 10px;
}

.inventory-fields label,
.inventory-quick label {
  min-width: 0;
}

.record-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.record-details summary {
  color: var(--accent-dark);
  font-size: 0.84rem;
}

.inventory-actions {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.inventory-actions button {
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
}

.menu-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfdf9 100%);
}

.menu-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.menu-name {
  font-size: 1.2rem;
  line-height: 1.15;
}

.menu-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 11px;
}

.metric-row {
  align-items: stretch;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.5rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.recipe-chip {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.recipe-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.recipe-chip strong {
  color: #1f352b;
}

.toolbar,
.row,
.form-grid,
.compact-grid {
  display: grid;
  gap: 11px;
}

.toolbar {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 11px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.split > *,
.setup-grid > *,
.main-grid > * {
  min-width: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #2666c9;
  font-weight: 950;
}

.divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 850;
  max-width: 100%;
}

.primary {
  background: var(--primary-bg);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 90, 72, 0.18);
}

.primary:hover {
  background: var(--primary-hover);
}

.secondary {
  border: 1px solid var(--line-strong);
  background: var(--secondary-bg);
  color: var(--ink);
}

.secondary:hover {
  border-color: #aebcaf;
  background: #fbfdf8;
}

.ghost {
  background: transparent;
  color: var(--accent-dark);
}

.danger {
  background: var(--danger-bg);
  color: var(--bad);
}

.danger:hover {
  background: #ffe8e8;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.pill.good {
  border-color: #9bc9b5;
  background: var(--good-bg);
  color: var(--good);
}

.pill.warn {
  border-color: #dfbf7a;
  background: var(--warn-bg);
  color: var(--warn);
}

.pill.bad {
  border-color: #dfa0a0;
  background: var(--bad-bg);
  color: var(--bad);
}

.choice-grid,
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice,
.check {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 9px;
  color: var(--ink);
  font-weight: 750;
}

.choice input,
.check input {
  width: auto;
}

.choice:hover,
.check:hover {
  border-color: #b8c9ba;
  background: #fbfdf8;
}

.mini {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.setup-steps {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.setup-steps div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-tint);
  padding: 9px;
}

.setup-steps strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  border-radius: 999px;
  background: #dff1e7;
  color: var(--accent-dark);
}

.setup-steps span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.connect-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.connect-step-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
  padding: 13px;
  box-shadow: var(--shadow-soft);
}

.connect-step-card > strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #dff1e7;
  color: var(--accent-dark);
}

.connect-step-card h3 {
  margin: 0 0 7px;
}

.connect-step-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.theme-form {
  display: grid;
  gap: 12px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.theme-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 116px;
  border: 1px solid var(--theme-option-border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--theme-option-bg), var(--theme-option-tint));
  color: var(--theme-option-ink);
  padding: 12px;
}

.theme-option.active {
  box-shadow: inset 0 0 0 2px var(--theme-option-accent), var(--shadow-soft);
}

.theme-option input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--theme-option-accent);
}

.theme-option strong,
.theme-option small {
  display: block;
}

.theme-option small {
  margin-top: 5px;
  color: var(--theme-option-muted);
  font-weight: 650;
  line-height: 1.25;
}

.theme-swatches {
  display: flex;
  grid-column: 1 / -1;
  gap: 7px;
}

.theme-swatches i {
  display: block;
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.theme-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--theme-preview-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, var(--theme-preview-soft), transparent 14rem),
    var(--theme-preview-bg);
  color: var(--theme-preview-ink);
  padding: 13px;
}

.theme-preview p {
  margin: 4px 0 0;
  color: var(--theme-preview-muted);
}

.theme-preview-button {
  min-height: 38px;
  border-radius: 8px;
  background: var(--theme-preview-primary);
  color: #fff;
  padding: 8px 12px;
  font-weight: 850;
}

.theme-preview-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--theme-preview-line);
  border-radius: 999px;
  background: var(--theme-preview-pill);
  color: var(--theme-preview-accent);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

details summary {
  cursor: pointer;
  color: var(--ink-strong);
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6faf5 0%, #fbfdf8 100%);
  padding: 8px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-tint);
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(19, 28, 24, 0.38);
  padding: 18px;
}

.modal {
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal-head,
.modal-body {
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.codebox {
  overflow: auto;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17211d;
  color: #eef8f2;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  white-space: pre;
}

.notice {
  border-left: 4px solid var(--accent);
  background: var(--notice-bg);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.status-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--notice-bg);
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.status-banner.good {
  border-left-color: var(--good);
  background: var(--good-bg);
}

.status-banner.warn {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.status-banner.bad {
  border-left-color: var(--bad);
  background: var(--bad-bg);
}

.status-banner button {
  min-height: 34px;
  padding: 6px 10px;
}

.profit-number {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  font-weight: 950;
}

.profit-number.good {
  color: var(--good);
}

.profit-number.bad {
  color: var(--bad);
}

.right {
  text-align: right;
}

.hide {
  display: none !important;
}

.customer-site {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.customer-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--customer-hero-bg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.customer-hero h1 {
  margin: 2px 0 4px;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.customer-hero p {
  margin: 0;
  color: var(--muted);
}

.customer-back {
  text-decoration: none;
}

.customer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.customer-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  font-weight: 850;
}

.customer-tabs button.active {
  border-color: #cae2d1;
  background: #eaf7ef;
  color: var(--accent-dark);
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.customer-menu-list {
  display: grid;
  gap: 10px;
}

.customer-safe-note {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--notice-bg);
  padding: 12px;
}

.customer-safe-note span {
  color: var(--muted);
}

.customer-menu-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.customer-menu-card.is-sold-out {
  background: #f7f6f1;
  color: var(--muted);
}

.menu-status {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-menu-card h2,
.customer-cart h2 {
  margin: 0;
}

.customer-menu-card p,
.customer-cart p {
  margin: 4px 0 0;
  color: var(--muted);
}

.customer-stepper {
  display: grid;
  grid-template-columns: 40px 36px 40px;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.customer-stepper button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--stepper-bg);
  color: var(--accent-dark);
  font-weight: 900;
}

.customer-cart {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--customer-cart-bg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.customer-cart-lines {
  display: grid;
  gap: 8px;
}

.customer-cart-lines div,
.customer-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.customer-total {
  border-bottom: 0;
  font-size: 1.1rem;
}

.qr-ticket {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.qr-code,
.qr-code img,
.qr-code canvas {
  width: 180px;
  height: 180px;
}

.qr-code {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.qr-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.qr-ticket textarea {
  margin-top: 8px;
  min-height: 130px;
  font-size: 0.78rem;
}

.qr-ticket button {
  margin-top: 8px;
}

.customer-phone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdf8 100%);
  padding: 12px;
}

.customer-phone-head {
  font-size: 1.15rem;
  font-weight: 900;
}

.customer-phone-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.customer-phone-items div {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.scanner-box {
  display: grid;
  gap: 10px;
}

#scanner-video {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17211d;
  object-fit: cover;
}

.order-ticket-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.order-ticket-card h3 {
  margin: 2px 0;
}

.order-ticket-items {
  display: grid;
  gap: 6px;
}

.order-ticket-items div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf8;
  padding: 8px;
}

@media (max-width: 980px) {
  .main-grid,
  .setup-grid,
  .split,
  .customer-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-testimonial-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-retention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operator-brief {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .retention-digest,
  .retention-alerts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operator-brief > div,
  .retention-digest > div,
  .retention-alerts > div {
    grid-column: 1 / -1;
  }

  .connect-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-metrics,
  .recipe-list {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .form-grid,
  .inventory-fields,
  .inventory-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .setup-shell,
  .content,
  .sidebar {
    padding: 12px;
  }

  .setup-top,
  .view-head,
  .status-banner,
  .toolbar,
  .form-grid,
  .compact-grid,
  .choice-grid,
  .check-grid,
  .demo-testimonial-guide,
  .demo-testimonial-steps,
  .quick-actions,
  .daily-retention-grid,
  .operator-brief,
  .retention-digest,
  .retention-alerts,
  .inventory-fields,
  .inventory-quick,
  .cards {
    grid-template-columns: 1fr;
  }

  .operator-brief > div,
  .retention-digest > div,
  .retention-alerts > div {
    grid-column: auto;
  }

  .inventory-record-head,
  .inventory-actions,
  .section-title-row {
    display: grid;
    justify-content: stretch;
  }

  .record-pills {
    max-width: none;
    justify-content: stretch;
  }

  .connect-steps {
    grid-template-columns: 1fr;
  }

  .theme-grid,
  .theme-preview {
    grid-template-columns: 1fr;
  }

  .inventory-actions button {
    width: 100%;
  }

  table {
    min-width: 680px;
  }

  table[data-table="inventory"] {
    display: block;
    min-width: 0;
    border-spacing: 0;
  }

  table[data-table="inventory"] thead {
    display: none;
  }

  table[data-table="inventory"] tbody {
    display: grid;
    gap: 10px;
  }

  table[data-table="inventory"] tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  table[data-table="inventory"] td,
  table[data-table="inventory"] td:first-child,
  table[data-table="inventory"] td:last-child {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  table[data-table="inventory"] td::before {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  table[data-table="inventory"] td:nth-child(1)::before {
    content: "Item";
  }

  table[data-table="inventory"] td:nth-child(2)::before {
    content: "Category";
  }

  table[data-table="inventory"] td:nth-child(3)::before {
    content: "Location";
  }

  table[data-table="inventory"] td:nth-child(4)::before {
    content: "Stock";
  }

  table[data-table="inventory"] td:nth-child(5)::before {
    content: "Low at";
  }

  table[data-table="inventory"] td:nth-child(7)::before {
    content: "Unit cost";
  }

  table[data-table="inventory"] td:nth-child(8)::before {
    content: "Supplier";
  }

  table[data-table="inventory"] td:nth-child(1),
  table[data-table="inventory"] td:nth-child(8),
  table[data-table="inventory"] td:nth-child(9) {
    grid-column: 1 / -1;
  }

  table[data-table="inventory"] td:nth-child(9)::before {
    content: "";
    display: none;
  }

  table[data-table="inventory"] td input,
  table[data-table="inventory"] td select {
    min-width: 0;
  }

  table[data-table="inventory"] td button {
    width: 100%;
  }

  .event-item {
    grid-template-columns: 1fr;
  }

  .event-money {
    justify-items: start;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand {
    grid-template-columns: 1fr;
  }

  .nav button {
    min-height: 44px;
  }

  .plan-panel {
    display: none;
  }

  .view-head {
    display: grid;
  }

  .menu-head {
    display: grid;
  }

  .btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn-row:has(button:only-child) {
    grid-template-columns: 1fr;
  }

  .btn-row button {
    width: 100%;
  }

  .customer-site {
    padding: 12px;
  }

  .customer-hero,
  .customer-menu-card,
  .qr-ticket {
    grid-template-columns: 1fr;
    display: grid;
  }

  .customer-tabs {
    grid-template-columns: 1fr;
  }
}

/* DetailMargin-style TruckMargin owner shell */
body:has(.main-grid) {
  background:
    radial-gradient(circle at 10% 0, rgba(15, 106, 75, 0.22), transparent 32rem),
    radial-gradient(circle at 86% 4%, rgba(231, 181, 74, 0.22), transparent 27rem),
    linear-gradient(180deg, #202420 0, #252d25 306px, var(--body-top) 306px, var(--body-bottom) 100%) !important;
}

.main-grid {
  width: min(1180px, calc(100% - 36px));
  max-width: 1180px;
  min-height: 100vh;
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: transparent !important;
  overflow: visible;
}

.main-grid .sidebar {
  position: sticky;
  top: 12px;
  z-index: 30;
  height: auto;
  min-height: 0;
  padding: 16px;
  overflow: visible;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 5% 0, rgba(20, 118, 83, 0.22), transparent 24rem),
    linear-gradient(135deg, #182218 0, #263b26 68%, #20372d 100%) !important;
  color: #fffaf0;
  box-shadow: 0 20px 48px rgba(13, 19, 16, 0.28);
  backdrop-filter: none;
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
}

.main-grid .brand {
  margin: 0;
  min-width: 0;
}

.main-grid .brand-name {
  color: #fffaf0;
  font-size: 32px;
  line-height: 0.98;
  letter-spacing: 0;
}

.main-grid .brand-name::before {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sun), #d9523f);
  box-shadow: 0 0 0 5px rgba(255, 250, 240, 0.08);
}

.main-grid .brand-note {
  color: rgba(255, 250, 240, 0.72);
  font-size: 13px;
}

.main-grid .brand .pill {
  border-color: rgba(255, 250, 240, 0.22);
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
}

.main-grid .hub-link {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  min-width: max-content;
  margin: 0;
  padding: 0 13px;
  border-color: rgba(255, 250, 240, 0.28);
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
}

.main-grid .hub-link:hover {
  background: #fffaf0;
  color: #182218;
}

.main-grid .nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 8px 8px 0;
  overflow: visible;
  border-top: 1px solid rgba(255, 250, 240, 0.1);
  scrollbar-width: none;
}

.main-grid .nav::-webkit-scrollbar {
  display: none;
}

.main-grid .nav button {
  flex: 1 1 112px;
  min-width: 112px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 8px;
  border-color: rgba(255, 250, 240, 0.22);
  background: rgba(255, 250, 240, 0.09);
  color: #fffaf0;
  box-shadow: none;
}

.main-grid .nav button span:last-child {
  display: none;
}

.main-grid .nav button.active {
  background: #fffaf0;
  color: #182218;
  border-color: rgba(255, 250, 240, 0.7);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  position: relative;
}

.main-grid .nav button.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  background: var(--sun);
}

.main-grid .plan-panel,
.main-grid .legal-links {
  display: none;
}

.main-grid .content {
  padding: 0 0 42px;
  overflow: visible;
  background: transparent;
}

.main-grid .status-banner,
.main-grid .view-head,
.main-grid .cards,
.main-grid .panel,
.main-grid .record-card,
.main-grid .form-card,
.main-grid .customer-panel {
  border-color: rgba(151, 128, 85, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(249, 243, 229, 0.96)),
    #fffdf7;
  box-shadow: 0 14px 32px rgba(16, 35, 30, 0.1);
}

.main-grid .view-head {
  min-height: 76px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(151, 128, 85, 0.24);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.main-grid .view-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--berry));
}

.main-grid .view-head h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.04;
  letter-spacing: 0;
}

.main-grid .cards {
  gap: 10px;
}

.main-grid .card {
  min-height: 82px;
  border-color: rgba(151, 128, 85, 0.26);
  background: linear-gradient(135deg, #fffdf7 0, #f7edda 100%);
  box-shadow: 0 14px 30px rgba(16, 35, 30, 0.09);
}

@media (max-width: 980px) {
  .main-grid {
    width: min(100% - 24px, 1180px);
  }

  .main-grid .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .main-grid .hub-link {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  body:has(.main-grid) {
    background:
      linear-gradient(180deg, #202420 0, #252d25 210px, var(--body-top) 210px, var(--body-bottom) 100%) !important;
  }

  .main-grid {
    width: min(100% - 20px, 1180px);
    margin-top: 10px;
  }

  .main-grid .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .main-grid .nav button {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .main-grid .sidebar {
    top: 8px;
    padding: 12px;
  }

  .main-grid .brand-name {
    font-size: 28px;
  }
}

/* Final UI polish pass */
body:has(.main-grid) {
  background:
    radial-gradient(circle at 10% 0, rgba(27, 122, 97, 0.22), transparent 34rem),
    radial-gradient(circle at 86% 3%, rgba(242, 184, 75, 0.18), transparent 30rem),
    linear-gradient(180deg, #13271d 0, #26321e 306px, #f4f7f3 306px, #f8faf4 100%) !important;
}

.main-grid {
  gap: 14px;
}

.main-grid .sidebar {
  padding: 14px 16px;
  border-radius: 9px;
  box-shadow: 0 22px 52px rgba(14, 34, 24, 0.25);
}

.main-grid .brand-name {
  font-size: clamp(29px, 3.2vw, 36px);
  line-height: 0.98;
}

.main-grid .nav {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 8px;
}

.main-grid .nav button {
  min-height: 58px;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
}

.main-grid .nav button span:first-child {
  line-height: 1.05;
}

.main-grid .view-head {
  min-height: 96px;
  padding: 19px 20px;
}

.main-grid .view-head h1 {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.98;
}

.main-grid .cards {
  gap: 10px;
}

.main-grid .card,
.main-grid .panel,
.main-grid .event-item,
.main-grid .record-card,
.main-grid .form-card {
  border-radius: 9px;
}

.main-grid .panel {
  padding: 18px;
}

.ops-calendar-panel {
  padding: 18px;
}

.calendar-toolbar {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(197, 211, 198, 0.75);
}

.calendar-toolbar h2 {
  font-size: clamp(31px, 3.6vw, 42px);
}

.ops-calendar-shell {
  grid-template-columns: minmax(0, 1fr) 318px;
}

.calendar-day {
  min-height: 96px;
  border-radius: 9px;
}

.calendar-day small {
  font-size: 0.66rem;
}

.ops-selected-day-panel {
  border-radius: 9px;
}

.ops-calendar-actions button {
  min-height: 42px;
}

@media (max-width: 1120px) {
  .main-grid .nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main-grid .nav {
    display: flex;
  }

  .main-grid .nav button {
    min-width: 106px;
  }
}

/* Beta mobile fit pass */
@media (max-width: 560px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-grid,
  .main-grid .sidebar,
  .main-grid .workspace,
  .main-grid .view-head,
  .main-grid .panel,
  .main-grid .card,
  .ops-calendar-panel,
  .ops-selected-day-panel {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .main-grid {
    width: 100%;
    padding: 10px;
    overflow-x: hidden;
  }

  .main-grid .view-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .main-grid .view-head > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
  }

  .main-grid .view-head h1,
  .calendar-toolbar h2 {
    font-size: clamp(30px, 10vw, 40px);
    line-height: 1.02;
  }

  .main-grid .view-head button,
  .main-grid .view-head .primary,
  .main-grid .view-head .secondary {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .main-grid .view-head .primary,
  .main-grid .view-head .secondary {
    min-height: 44px;
  }

  .main-grid .cards,
  .calendar-stats,
  .ops-calendar-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ops-calendar-weekdays,
  .ops-calendar-grid {
    min-width: 0;
    gap: 5px;
  }

  .calendar-day {
    min-width: 0;
    padding: 7px 5px;
  }
}
