:root {
  --ink: #2e2926;
  --muted: #6f655c;
  --line: #eadfd2;
  --paper: #f7f2eb;
  --card: #fffdf9;
  --charcoal: #3e3834;
  --accent: #f69014;
  --accent-deep: #d97808;
  --ok: #1d7a4a;
  --danger: #b43232;
  --shadow: 0 18px 40px rgba(62, 56, 52, .08);
  --radius: 22px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100vh;
  background:
    radial-gradient(720px 320px at 8% -8%, rgba(246, 144, 20, .22), transparent 58%),
    radial-gradient(540px 260px at 100% 0%, rgba(62, 56, 52, .08), transparent 50%),
    var(--paper);
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: var(--ink); max-width: 100%; }
.customer-shell, .wrap, .stack, .card, form, .topbar { min-width: 0; max-width: 100%; }
.check span { min-width: 0; overflow-wrap: anywhere; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 9; }

.topbar, .admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 253, 249, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { height: 52px; width: auto; }
.logo-plate { display: inline-block; background: #fff; border-radius: 16px; padding: 8px 10px; }
.topbar a, .admin-top a { color: var(--ink); text-decoration: none; font-weight: 700; }
.top-link {
  background: var(--accent);
  color: #2e2926 !important;
  padding: 8px 14px;
  border-radius: 999px;
}
.wrap { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.hero { padding: 12px 0 8px; }
.eyebrow {
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-deep);
  font-size: 12px; font-weight: 800; margin: 0 0 8px;
}
h1 { font-size: 34px; line-height: 1.12; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 22px; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.55; }
.card {
  background: var(--card);
  border: 1px solid rgba(228, 235, 243, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 12px 0;
}
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-width: 0; min-height: 54px; border-radius: 16px; border: 1px solid #e4d5c4;
  background: #fff; padding: 12px 14px; color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(246, 144, 20, .28);
  border-color: var(--accent);
}
textarea { min-height: 120px; }
.plate-field { max-width: 100%; overflow: hidden; }
.plate-input {
  display: block; width: 100%; min-width: 0; max-width: 100%;
  font-size: clamp(18px, 6vw, 26px); letter-spacing: .03em;
  text-transform: uppercase; font-weight: 800; text-align: center;
}
.otp-input {
  font-size: clamp(22px, 7vw, 32px); letter-spacing: .18em; text-align: center; font-weight: 750;
  width: 100%; padding-left: 8px; padding-right: 8px;
}
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 14px 18px; border-radius: 16px; border: 0;
  background: linear-gradient(180deg, #ffb047, var(--accent) 42%, var(--accent-deep));
  color: #1b2430; text-decoration: none; font-weight: 800;
  width: 100%; cursor: pointer;
  box-shadow: 0 12px 24px rgba(217, 120, 8, .28);
}
.btn.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: none;
}
.btn.copper { background: linear-gradient(180deg, #2a3848, #1b2430); color: #fff; box-shadow: 0 12px 24px rgba(27, 36, 48, .18); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn:disabled, .slot:disabled { cursor: not-allowed; }
.choice-grid, .slot-grid, .day-grid { display: grid; gap: 10px; }
.choice, .slot, .day {
  min-height: 72px; border-radius: 18px; border: 1px solid var(--line); background: #fff;
  color: var(--charcoal); -webkit-appearance: none; appearance: none;
  text-align: left; padding: 14px 16px; width: 100%; cursor: pointer;
  box-shadow: 0 10px 24px rgba(62, 56, 52, .06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.slot:hover, .slot:focus, .choice:hover, .choice:focus, .day:hover, .day:focus {
  background: #fff1dc; color: var(--charcoal); border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(217, 120, 8, .16);
}
.slot:active, .choice:active, .day:active, .btn:active { transform: scale(.98); }
.branch-choice {
  display: grid; gap: 6px; min-height: 108px;
  background: linear-gradient(145deg, #fff 0%, #fff6ea 48%, #fff 100%);
  border-left: 6px solid var(--accent);
}
.branch-choice .pill {
  display: inline-flex; width: max-content; max-width: 100%;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: #2e2926; font-size: 12px; font-weight: 800;
}
.branch-choice .meta { font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.choice strong, .day strong { display: block; font-size: 18px; }
.choice span, .day span, .muted { color: var(--muted); }
.slot-grid { grid-template-columns: repeat(3, 1fr); }
.slot { min-height: 64px; text-align: center; font-weight: 800; font-size: 16px; color: var(--charcoal); background: #fff; }
.slot small { display: block; font-weight: 700; color: #6f655c; }
.slot.is-off, .slot:disabled, .day:disabled {
  background: #efe6db; color: #6b5f54; box-shadow: none; opacity: 1;
}
.steps { display: flex; gap: 6px; padding: 0; margin: 0 0 14px; list-style: none; }
.steps li { flex: 1; height: 6px; border-radius: 99px; background: #eadfd2; }
.steps li.is-done, .steps li.is-current { background: linear-gradient(90deg, var(--accent), #ffc56a); }
.step-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.step-list li {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  box-shadow: 0 8px 18px rgba(27, 36, 48, .04);
}
.step-list span {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800;
  background: #fff4e5; color: var(--accent-deep);
}
.step-list p { margin: 2px 0 0; color: var(--muted); }
.nav-list { display: grid; gap: 8px; margin-top: 16px; }
.nav-list a {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 58px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; text-decoration: none; font-weight: 700;
  box-shadow: 0 8px 18px rgba(27, 36, 48, .04);
}
.nav-list a::after { content: "›"; color: var(--accent-deep); font-size: 22px; line-height: 1; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 750; background: #f3ebe2; color: var(--charcoal); }
.badge.pending { background: #fff1d6; color: #8a5a00; }
.badge.confirmed, .badge.completed { background: #e5f6ee; color: var(--ok); }
.badge.cancelled, .badge.no_show { background: #fde8e8; color: var(--danger); }
.toast {
  position: sticky; top: 8px; z-index: 5; margin: 8px auto; width: min(760px, calc(100% - 32px));
  background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px;
}
.toast.error { background: var(--danger); }
.errors { color: var(--danger); font-size: 14px; margin: 0; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin-top: 2px; }
.footer { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 0 24px; }
.map { width: 100%; height: 220px; border: 0; border-radius: 18px; background: #f0e7dc; }
.desk-only { display: none; }

.admin-shell { min-height: 100vh; }
.admin-side {
  background: var(--charcoal);
  color: #f8f1e8;
  padding: 18px 14px;
  border-bottom: 1px solid #2c2825;
}
.admin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.admin-brand img { height: 48px; width: auto; }
.admin-brand strong { display: block; font-size: 14px; color: #fff; }
.admin-side .help { color: #d9cfc3; }
.admin-side a { color: #f8f1e8; text-decoration: none; display: block; padding: 10px 10px; border-radius: 12px; font-weight: 650; }
.admin-side a:hover, .admin-side a.is-active { background: var(--accent); color: #2e2926; }
.admin-side .btn.secondary { background: transparent; color: #f8f1e8; border-color: rgba(248, 241, 232, .35); }
.admin-main { padding: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 18px; padding: 14px; box-shadow: 0 8px 18px rgba(62, 56, 52, .05); }
.stat b { display: block; font-size: 28px; color: var(--charcoal); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { background: #faf4ec; color: var(--charcoal); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.filters { display: grid; gap: 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn, .row-actions button { width: auto; min-height: 42px; }
.help { color: var(--muted); font-size: 13px; }
.login-body {
  background:
    radial-gradient(520px 240px at 50% 0%, rgba(246, 144, 20, .45), transparent 62%),
    var(--charcoal);
}
.login-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px 0; }
.login-card { width: min(440px, 100%); margin: 0; text-align: center; border-top: 4px solid var(--accent); }
.login-card .logo { height: 108px; margin: 4px auto 8px; }
.login-card label, .login-card .errors { text-align: left; }

@media (min-width: 720px) {
  .slot-grid { grid-template-columns: repeat(4, 1fr); }
  .day-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: repeat(4, 1fr); align-items: end; }
  .step-list { grid-template-columns: 1fr; }
}
@media (min-width: 980px) {
  .customer-shell { display: grid; grid-template-columns: 380px 1fr; min-height: 100vh; }
  .brand-pane {
    background:
      radial-gradient(380px 200px at 20% 0%, rgba(246, 144, 20, .35), transparent 70%),
      var(--charcoal);
    color: #f8f1e8;
    padding: 40px 32px;
    position: sticky; top: 0; height: 100vh;
  }
  .brand-pane .eyebrow { color: var(--accent); }
  .brand-pane .logo-plate { margin-bottom: 28px; }
  .brand-pane .logo { height: 128px; }
  .desk-only { display: block; }
  .mobile-top { display: none; }
  .admin-shell { display: grid; grid-template-columns: 250px 1fr; }
  .admin-side { position: sticky; top: 0; height: 100vh; border-bottom: 0; border-right: 0; }
}
