/* ============================================================
   AeroCut design system — v1
   Brand: navy #1D3B8B (structure), red #C0392B (action/alerts),
   white surfaces. Mobile-first; barber thumbs > mouse pointers.
   ============================================================ */

:root {
  /* Navy is taken straight from the Aerocut logo (#002255) so the app and
     the mark are the same blue. */
  --navy: #002255;
  --navy-deep: #001838;
  --navy-soft: #E6EBF3;
  --red: #C0392B;
  --red-soft: #FBEDEB;
  --ink: #131722;
  --ink-2: #5A6172;
  --line: #E3E6EE;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --ok: #1E8E5A;
  --ok-soft: #E7F6EE;
  --warn: #B7791F;
  --warn-soft: #FCF3E3;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 3px rgba(19, 23, 34, .07), 0 4px 14px rgba(19, 23, 34, .05);
  --tap: 48px;           /* minimum touch target */
  --pad: 16px;
  --max: 560px;          /* phone-first sheet width */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: var(--pad); padding-bottom: 96px; }

/* ---------- header ---------- */
.appbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.appbar-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--pad);
}
/* The logo is navy line art, so it sits on white rather than inside a
   navy tile — same treatment as the app icon. */
.logo-mark {
  width: 40px; height: 40px; flex: none;
  display: block; object-fit: contain;
}
.appbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.appbar .sub { font-size: 11.5px; color: var(--ink-2); margin-top: -2px; }
.appbar .spacer { flex: 1; }

/* ---------- cards & sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: var(--pad);
  margin-bottom: 12px;
}
.card h2 { font-size: 16px; font-weight: 750; margin-bottom: 10px; }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2);
  margin: 18px 0 8px;
}
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 0; border-radius: var(--r-sm);
  background: var(--navy); color: #fff;
  font-size: 15.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: filter .12s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); filter: brightness(1.12); }
.btn.block { display: flex; width: 100%; }
.btn.red { background: var(--red); }
.btn.ghost {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn.soft { background: var(--navy-soft); color: var(--navy); }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block; font-size: 13px; font-weight: 650;
  color: var(--ink-2); margin-bottom: 5px;
}
input, select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 10px 13px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
  font-size: 16px; font-family: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-soft);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* toggle */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle .lbl { font-weight: 650; font-size: 15px; }
.toggle .hint { font-size: 12.5px; color: var(--ink-2); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #CBD1DE; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .15s;
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 23px; }

/* ---------- chips / badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.badge.ok   { background: var(--ok-soft);  color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.red  { background: var(--red-soft);  color: var(--red); }
.badge.navy { background: var(--navy-soft); color: var(--navy); }

/* ---------- list rows ---------- */
.rowitem {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.rowitem:last-child { border-bottom: 0; }
.rowitem .grow { flex: 1; min-width: 0; }
.rowitem .title { font-weight: 700; font-size: 15.5px; }
.rowitem .sub { font-size: 13px; color: var(--ink-2); }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--navy-soft); color: var(--navy);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
}

/* ---------- tabs (bottom nav) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
}
.tab {
  min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 650; color: var(--ink-2);
  background: none; border: 0; cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tab .ico { font-size: 21px; line-height: 1; }
.tab.active { color: var(--navy); }
.tab.active .ico { transform: translateY(-1px); }

/* ---------- slot grid (booking) ---------- */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.slot {
  min-height: var(--tap);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 650; font-family: inherit;
  cursor: pointer;
}
.slot.sel { background: var(--navy); border-color: var(--navy); color: #fff; }

/* day strip */
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day {
  flex: none; width: 64px; min-height: 72px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.day .dow { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; }
.day .num { font-size: 21px; font-weight: 800; }
.day .mon { font-size: 11px; color: var(--ink-2); }
.day.sel { background: var(--navy); border-color: var(--navy); }
.day.sel .dow, .day.sel .num, .day.sel .mon { color: #fff; }
.day.closed { opacity: .38; }

/* service pick cards */
.svc {
  width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; margin-bottom: 9px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
}
.svc.sel { border-color: var(--navy); background: var(--navy-soft); }
.svc .nm { font-weight: 750; font-size: 15.5px; }
.svc .meta { font-size: 13px; color: var(--ink-2); }
.svc .price { margin-left: auto; font-weight: 800; font-size: 17px; color: var(--navy); }

/* ---------- misc ---------- */
.banner {
  border-radius: var(--r-sm); padding: 11px 14px;
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
}
.banner.ok   { background: var(--ok-soft);   color: var(--ok); }
.banner.red  { background: var(--red-soft);  color: var(--red); }
.banner.navy { background: var(--navy-soft); color: var(--navy-deep); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 14px;
}
.stat .k { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 2px; }

/* Cut notes surfaced on the Today screen — the barber reads these between
   clients, so they sit inline instead of behind a profile tap. */
.cutnote {
  margin: -4px 0 10px 54px;
  padding: 9px 12px;
  background: var(--navy-soft);
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px;
  color: var(--navy-deep);
  line-height: 1.4;
}

.empty {
  text-align: center; color: var(--ink-2);
  padding: 28px 10px; font-size: 14.5px;
}
.empty .big { font-size: 34px; margin-bottom: 6px; }

.hidden { display: none !important; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 650;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 90; max-width: 88vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* modal sheet */
.sheet-back {
  position: fixed; inset: 0; background: rgba(19,23,34,.45);
  z-index: 60; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: var(--max);
  border-radius: 18px 18px 0 0;
  padding: 18px var(--pad) calc(18px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto;
}
.sheet h3 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }

@media (min-width: 720px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 18px; }
}
