/* ==========================================================================
   Art-In Tattoo Studio – admin. Same "Ink & Bone" identity as the site, tuned for daily work:
   dense, legible, no decorative motion. Dark by default, light theme optional.
   ========================================================================== */

:root {
  --a-bg: var(--c-ink);
  --a-panel: #121212;
  --a-panel-2: #181818;
  --a-input: #0d0d0d;
  --a-line: rgba(236, 230, 218, 0.12);
  --a-line-strong: rgba(236, 230, 218, 0.28);
  --a-text: var(--c-bone);
  --a-muted: #a9a296;
  --a-accent: var(--c-red);
  --a-accent-text: var(--c-red-text);
  --a-on-accent: var(--c-on-red);
  --a-hover: rgba(224, 38, 47, 0.1);
  --a-b0: #e0262f;
  --a-b1: #8fb4dc;
  --a-b2: #7fc79a;
  --a-b3: #e8c46a;
  --sidebar-w: 248px;
  --appbar-h: 56px;
  --bottom-h: 64px;
}

[data-theme='light'] {
  color-scheme: light;
  --a-bg: #ece6da;
  --a-panel: #f6f2ea;
  --a-panel-2: #e4ddcf;
  --a-input: #fbf8f2;
  --a-line: rgba(10, 10, 10, 0.12);
  --a-line-strong: rgba(10, 10, 10, 0.3);
  --a-text: #0a0a0a;
  --a-muted: #4f4a42;
  --a-accent: #c41d26;
  --a-accent-text: #a8161e;
  --a-on-accent: #ffffff;
  --a-hover: rgba(196, 29, 38, 0.08);
  --a-b0: #c41d26;
  --a-b1: #2d5f8a;
  --a-b2: #2f7a4b;
  --a-b3: #8a5a00;
  --c-success: #2f7a4b;
  --c-success-tint: rgba(47, 122, 75, 0.1);
  --c-danger: #b3261e;
  --c-danger-tint: rgba(179, 38, 30, 0.08);
  --c-warning: #8a5a00;
  --c-warning-tint: rgba(196, 140, 20, 0.12);
  --c-info: #2d5f8a;
  --c-info-tint: rgba(45, 95, 138, 0.08);
  --ring: 0 0 0 2px var(--a-bg), 0 0 0 4px var(--a-accent);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }
.icon { width: 1.2em; height: 1.2em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon--sm { width: 1em; height: 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--sm { min-height: 40px; padding: 0 12px; font-size: 0.8125rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--a-accent); color: var(--a-on-accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border-color: var(--a-line-strong); color: var(--a-text); }
.btn--ghost:hover { background: var(--a-hover); border-color: var(--a-accent); }
.btn--success { background: var(--c-success); color: #0b1a10; }
[data-theme='light'] .btn--success { color: #fff; }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--danger-ghost { border-color: var(--c-danger); color: var(--c-danger); }
.btn--danger-ghost:hover { background: var(--c-danger-tint); }
.btn.is-loading, .file-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after, .file-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--a-text);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--primary.is-loading::after { border-color: var(--a-on-accent); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--a-line);
  border-radius: var(--radius);
  color: var(--a-text);
  text-decoration: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover { background: var(--a-hover); border-color: var(--a-line-strong); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn--ghost { border-color: transparent; }
.icon-btn--danger { color: var(--c-danger); }
.link-btn { color: var(--a-accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }

/* ---------- Forms ---------- */
.field { display: grid; align-content: start; gap: 6px; margin-bottom: 14px; }
.field label, .field legend, .lang-fields legend {
  color: var(--a-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input, .field select, .field textarea, .lang-field input, .lang-field textarea, .select-inline select, .date-field input, .date-jump input, .hours-edit select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--a-input);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--radius);
  font-size: 1rem;
}
.field textarea, .lang-field textarea { resize: vertical; }
/* Own chevron with room on the right, instead of the browser arrow glued to the edge. */
.field select, .select-inline select, .hours-edit select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5a52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}
.field select option, .select-inline select option, .hours-edit select option { background: var(--a-panel); color: var(--a-text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a-accent) !important; box-shadow: 0 0 0 3px var(--a-hover); }
[aria-invalid='true'] { border-color: var(--c-danger) !important; }
.field__hint, .hint { color: var(--a-muted); font-size: 0.8125rem; }
.hint { display: flex; align-items: center; gap: 6px; margin: 8px 0 16px; }
.field__affix { display: flex; gap: 6px; }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.lang-fields { margin-bottom: 14px; }
.lang-fields legend { margin-bottom: 6px; }
.lang-field { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.lang-field .lang-chip { justify-content: center; min-width: 32px; margin-top: 12px; }

.segmented { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
/* The legend is not a flex item, so the 6px gap after it comes from padding; options start level with a select next to it. */
.segmented legend { width: 100%; padding-bottom: 6px; }
/* Options are buttons, not field captions: undo the uppercase caption style of ".field label". */
.field.segmented label { color: var(--a-text); font-size: inherit; font-weight: inherit; letter-spacing: 0; text-transform: none; }
.segmented label, .segmented button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.segmented label input { position: absolute; opacity: 0; }
.segmented label span, .segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--a-line-strong);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
}
.segmented input:checked + span, .segmented button[aria-pressed='true'] { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-on-accent); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }
.segmented--compact { gap: 0; }
.segmented--compact button { border-radius: 0; margin-left: -1px; }
.segmented--compact button:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.segmented--compact button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { position: relative; width: 42px; height: 24px; flex-shrink: 0; border-radius: 12px; background: var(--a-line-strong); transition: background-color var(--dur-fast); }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--dur-fast); }
.switch input:checked + .switch__track { background: var(--a-accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }

.alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border: 1px solid; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 14px; }
.alert--danger { border-color: var(--c-danger); background: var(--c-danger-tint); }
.alert--warning { display: block; border-color: var(--c-warning); background: var(--c-warning-tint); }
.alert--info { border-color: var(--c-info); background: var(--c-info-tint); }
.conflict-list { margin-top: 6px; }
.conflict-list li { padding: 4px 0; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--a-hover); color: var(--a-muted); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.badge--confirmed { background: var(--c-info-tint); color: var(--c-info); }
.badge--completed { background: var(--c-success-tint); color: var(--c-success); }
.badge--cancelled { background: var(--c-danger-tint); color: var(--c-danger); }
.badge--no_show, .badge--pending { background: var(--c-warning-tint); color: var(--c-warning); }
.badge--today { background: var(--a-accent); color: var(--a-on-accent); margin-left: 8px; }
.badge--role-owner { background: var(--a-hover); color: var(--a-accent-text); }
.lang-chip { display: inline-flex; padding: 1px 6px; border: 1px solid var(--a-line-strong); border-radius: 4px; color: var(--a-accent-text); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; vertical-align: middle; }
.count-chip { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; margin-left: 8px; border-radius: 12px; background: var(--a-hover); color: var(--a-muted); font-size: 0.75rem; font-weight: 700; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--c-danger); color: #fff; font-size: 0.6875rem; font-weight: 800; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot--b0 { background: var(--a-b0); } .dot--b1 { background: var(--a-b1); } .dot--b2 { background: var(--a-b2); } .dot--b3 { background: var(--a-b3); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 3px var(--c-success-tint); }

/* ---------- Boot & login ---------- */
.boot { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.boot__spinner .icon { width: 32px; height: 32px; color: var(--a-accent); animation: spin 1s linear infinite; }
.login { width: 100%; max-width: 400px; }
.login__card { padding: 32px 24px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.login__logo { margin: 0 auto 20px; width: 150px; height: auto; }
/* The emblem has white lettering, so on the light theme it sits on a dark disc. */
[data-theme='light'] .brand-emblem { padding: 3px; background: #0a0a0a; }
.sidebar__wordmark { display: flex; flex-direction: column; color: var(--a-text); font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; line-height: 1; letter-spacing: 0.03em; text-transform: uppercase; }
.sidebar__wordmark small { margin-top: 3px; color: var(--a-muted); font-family: var(--font-mono); font-size: 0.55rem; font-weight: 500; letter-spacing: 0.22em; }
.login__title { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; line-height: 1; text-align: center; text-transform: uppercase; }
.login__subtitle { margin-bottom: 20px; color: var(--a-muted); text-align: center; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
.sidebar { display: none; }
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--appbar-h);
  padding: 0 12px;
  background: var(--a-panel);
  border-bottom: 1px solid var(--a-line);
}
.appbar__title { flex: 1; font-weight: 700; }
.view { padding: 16px 16px 32px; outline: none; max-width: 1400px; }

.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--a-panel);
  border-top: 1px solid var(--a-line);
}
.bottom-nav__link {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: var(--a-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-decoration: none;
}
.bottom-nav__link .icon { width: 22px; height: 22px; }
.bottom-nav__link[aria-current='page'], .bottom-nav__link.is-active { color: var(--a-accent-text); }
.bottom-nav__link[aria-current='page']::before { content: ''; position: absolute; top: 0; width: 32px; height: 2px; background: var(--a-accent); border-radius: 2px; }
.bottom-nav__link .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.bottom-nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.sheet__panel {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  padding: 8px 8px calc(8px + var(--bottom-h) + env(safe-area-inset-bottom));
  background: var(--a-panel);
  border-top: 1px solid var(--a-line-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.sheet__link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-radius: var(--radius); font-weight: 600; text-decoration: none; text-align: left; }
.sheet__link:hover, .sheet__link[aria-current='page'] { background: var(--a-hover); color: var(--a-accent-text); }
.sheet__link .nav-badge { margin-left: auto; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: auto 1fr; padding-bottom: 0; }
  .appbar, .bottom-nav, .sheet { display: none !important; }
  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    height: 100vh;
    padding: 16px 12px;
    background: var(--a-panel);
    border-right: 1px solid var(--a-line);
    transition: width var(--dur);
  }
  .sidebar.is-collapsed { width: 72px; }
  .sidebar__brand { display: flex; align-items: center; height: 48px; padding: 0 8px; margin-bottom: 16px; }
  .sidebar__logo { display: flex; align-items: center; gap: 10px; }
  .sidebar__mark { display: none; }
  .sidebar.is-collapsed .sidebar__logo { display: none; }
  .sidebar.is-collapsed .sidebar__mark { display: block; }
  .sidebar__nav { display: grid; gap: 2px; align-content: start; flex: 1; overflow-y: auto; }
  .sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--a-muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
  }
  .sidebar__link:hover { background: var(--a-hover); color: var(--a-text); }
  .sidebar__link[aria-current='page'] { background: var(--a-hover); color: var(--a-accent-text); box-shadow: inset 3px 0 0 var(--a-accent); }
  .sidebar__link .nav-badge { margin-left: auto; }
  .sidebar.is-collapsed .sidebar__label { display: none; }
  .sidebar.is-collapsed .sidebar__link { justify-content: center; padding: 0; position: relative; }
  .sidebar.is-collapsed .sidebar__link .nav-badge { position: absolute; top: 4px; right: 6px; }
  .sidebar.is-collapsed .sidebar__toggle .icon { transform: rotate(180deg); }
  .sidebar__foot { display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--a-line); }
  .sidebar.is-collapsed .user-chip__text { display: none; }
  .view { padding: 28px 32px 48px; }
}

.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 0; }
.user-chip__avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 0; background: var(--a-hover); border: 1px solid var(--a-line-strong); color: var(--a-accent-text); font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;  }
.user-chip__text { display: grid; min-width: 0; line-height: 1.25; }
.user-chip__text strong, .user-chip__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__text small { color: var(--a-muted); }

/* ---------- Page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-title { font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 1.4vw, 2.8rem); font-weight: 800; line-height: 1; text-transform: uppercase; }
.page-sub { color: var(--a-muted); display: flex; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 599px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
}
.section-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 8px 0 16px; }

.panel { padding: 16px; margin-bottom: 16px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel__title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; }
.panel__title--sub { margin: 20px 0 8px; color: var(--a-muted); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; }
.day-heading { display: flex; align-items: center; margin: 18px 0 8px; font-size: 0.875rem; font-weight: 700; color: var(--a-muted); text-transform: capitalize; }
.result-count { margin: 4px 0 8px; color: var(--a-muted); font-size: 0.8125rem; }

.toolbar, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar__group { display: flex; align-items: center; gap: 6px; }
.select-inline select { min-width: 160px; }
.search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--a-muted); }
.search input { width: 100%; min-height: 44px; padding: 8px 12px 8px 38px; background: var(--a-input); border: 1px solid var(--a-line-strong); border-radius: var(--radius); font-size: 1rem; }
.date-field { display: flex; align-items: center; gap: 6px; color: var(--a-muted); font-size: 0.8125rem; }
.date-field input { width: auto; }
.date-jump input { width: auto; }
@media (max-width: 599px) {
  .filters > * { flex: 1 1 100%; }
  .date-field { flex: 1 1 calc(50% - 4px); }
  .date-field input { flex: 1; min-width: 0; }
  .select-inline, .select-inline select { width: 100%; }
}

/* ---------- Dashboard ---------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--c-warning); border-radius: var(--radius-lg); background: var(--c-warning-tint); text-decoration: none; font-weight: 600; }
.banner__cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--a-accent-text); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.kpis--compact { margin-bottom: 16px; }
.kpi { padding: 14px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); min-width: 0; }
.kpi__label { color: var(--a-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi__value { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); font-weight: 500; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); font-weight: 600; line-height: 1.2; font-variant-numeric: lining-nums; }
.kpi__value small { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; color: var(--a-muted); }
.kpi__sub { display: flex; align-items: center; gap: 4px; color: var(--a-accent-text); font-weight: 700; font-size: 0.875rem; }
@media (max-width: 480px) { .kpi__value small { display: none; } .kpi { padding: 12px 10px; } }

.dash-grid { display: grid; gap: 16px; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 0.875rem; }
.bar__value { color: var(--a-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar__track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--a-hover); overflow: hidden; }
.bar__fill { display: block; width: var(--w); height: 100%; border-radius: 4px; background: var(--a-accent); }
.bar__fill--alt { background: var(--a-b1); }

/* ---------- Booking items ---------- */
.booking-list { display: grid; gap: 8px; }
.booking-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 4px 12px;
  padding: 12px;
  background: var(--a-panel-2);
  border: 1px solid var(--a-line);
  border-left: 3px solid var(--a-accent);
  border-radius: var(--radius);
}
.booking-item--completed { border-left-color: var(--c-success); }
.booking-item--no_show { border-left-color: var(--c-warning); }
.booking-item--cancelled { border-left-color: var(--c-danger); }
.booking-item.is-muted .booking-item__name { text-decoration: line-through; color: var(--a-muted); }
.booking-item__time { display: grid; align-content: start; font-variant-numeric: tabular-nums; line-height: 1.3; }
.booking-item__time strong { font-size: 1.05rem; }
.booking-item__time span { color: var(--a-muted); font-size: 0.8125rem; }
.booking-item__date { color: var(--a-accent-text) !important; font-weight: 700; }
.booking-item__main { min-width: 0; }
.booking-item__name { font-weight: 700; overflow-wrap: anywhere; }
.booking-item__meta { color: var(--a-muted); font-size: 0.875rem; }
.booking-item__notes { display: flex; gap: 6px; margin-top: 4px; font-size: 0.8125rem; color: var(--a-text); font-style: italic; }
.booking-item__side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.booking-item__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
@media (min-width: 760px) {
  .booking-item { grid-template-columns: 72px 1fr auto; align-items: center; }
  .booking-item__side { grid-column: auto; flex-direction: column; align-items: flex-end; }
}

/* ---------- States ---------- */
.state { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; text-align: center; color: var(--a-muted); }
.state__icon { width: 36px; height: 36px; color: var(--a-accent); opacity: 0.7; }
.state__title { color: var(--a-text); font-weight: 600; }
.state--loading { justify-items: stretch; padding: 8px 0; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--a-panel), var(--a-panel-2), var(--a-panel)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .boot__spinner .icon, .btn.is-loading::after { animation: none; } }

/* ---------- Calendar ---------- */
.cal-range { margin-bottom: 12px; font-weight: 700; text-transform: capitalize; }
.cal { --row-h: 44px; --axis-w: 52px; border: 1px solid var(--a-line); border-radius: var(--radius-lg); background: var(--a-panel); overflow: auto; max-height: calc(100vh - 220px); }
.cal__head, .cal__body { display: grid; grid-template-columns: var(--axis-w) repeat(var(--cols), minmax(120px, 1fr)); }
.cal__head { position: sticky; top: 0; z-index: 3; background: var(--a-panel); border-bottom: 1px solid var(--a-line-strong); }
.cal__colhead { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 6px; font-weight: 700; border-left: 1px solid var(--a-line); }
.cal__colhead--day { flex-direction: column; gap: 0; line-height: 1.1; }
.cal__colhead--day small { color: var(--a-muted); text-transform: capitalize; }
.cal__colhead--day.is-today strong { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 0; background: var(--a-accent); color: var(--a-on-accent); }
.cal__body { position: relative; }
.cal-axis, .cal-col { position: relative; height: calc(var(--rows) * var(--row-h)); }
.cal-axis__label { position: absolute; top: calc(var(--r) * var(--row-h)); right: 6px; transform: translateY(-50%); color: var(--a-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.cal-axis__label:first-child { transform: none; }
.cal-col { display: grid; grid-auto-rows: var(--row-h); border-left: 1px solid var(--a-line); }
.cal-slot { border-bottom: 1px dashed var(--a-line); }
.cal-slot:nth-child(even) { border-bottom-style: solid; }
button.cal-slot:hover { background: var(--a-hover); }
button.cal-slot:focus-visible { outline-offset: -2px; }
.cal-slot.is-closed { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--a-hover) 6px 7px); }
.cal-event, .cal-block {
  position: absolute;
  top: calc(var(--r) * var(--row-h) + 2px);
  left: 3px;
  right: 3px;
  height: calc(var(--span) * var(--row-h) - 4px);
  overflow: hidden;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: left;
}
.cal-event { z-index: 2; display: grid; align-content: start; gap: 1px; padding: 4px 8px; background: var(--a-panel-2); border: 1px solid var(--a-line-strong); border-left: 4px solid var(--a-b0); }
.cal-event:hover { border-color: var(--a-accent); }
.cal-event--b1 { border-left-color: var(--a-b1); } .cal-event--b2 { border-left-color: var(--a-b2); } .cal-event--b3 { border-left-color: var(--a-b3); }
.cal-event--completed { opacity: 0.7; }
.cal-event--no_show { opacity: 0.55; text-decoration: line-through; }
.cal-event__time { color: var(--a-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.cal-event__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event__meta { color: var(--a-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-block { z-index: 1; display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; pointer-events: none; color: var(--c-danger); font-weight: 600; background: repeating-linear-gradient(135deg, var(--c-danger-tint) 0 8px, transparent 8px 16px); border: 1px dashed var(--c-danger); }
.cal-now { position: absolute; z-index: 4; left: var(--axis-w); right: 0; top: calc(var(--r) * var(--row-h)); height: 2px; background: var(--c-danger); pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--c-danger); }
.cal--week { --axis-w: 48px; }
.cal--week .cal__head, .cal--week .cal__body { grid-template-columns: var(--axis-w) repeat(7, minmax(96px, 1fr)); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; color: var(--a-muted); font-size: 0.8125rem; }
.legend span { display: inline-flex; align-items: center; }
.agenda__day { padding-bottom: 8px; border-bottom: 1px solid var(--a-line); }
.agenda__day.is-today .day-heading { color: var(--a-accent-text); }
.block-chip { display: flex; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 8px; border: 1px dashed var(--c-danger); border-radius: var(--radius); color: var(--c-danger); font-size: 0.8125rem; font-weight: 600; }

/* ---------- Lists ---------- */
.card-list, .row-list { display: grid; gap: 8px; }
.row-list.panel { padding: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); }
.row + .row { border-top: 1px solid var(--a-line); }
.row.is-muted { opacity: 0.6; }
.row__main { flex: 1 1 200px; min-width: 0; }
.row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; }
.row__meta { color: var(--a-muted); font-size: 0.875rem; }
.row__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.block-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); }
.block-row__icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 0; background: var(--c-danger-tint); color: var(--c-danger); }
.block-row__main { flex: 1; min-width: 0; }
.block-row__title { font-weight: 700; }
.block-row__meta { color: var(--a-muted); font-size: 0.875rem; }

.review-list { display: grid; gap: 12px; }
@media (min-width: 1000px) { .review-list { grid-template-columns: 1fr 1fr; } }
.review-card { display: grid; gap: 10px; padding: 16px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); }
.review-card.is-pending { border-left: 3px solid var(--c-warning); }
.review-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-card__text { font-family: var(--font-sans); font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.review-card__meta { color: var(--a-muted); font-size: 0.8125rem; }
.review-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stars { display: inline-flex; gap: 2px; color: var(--a-accent); }
.star { width: 16px; height: 16px; }
.star--on { fill: currentColor; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; padding: 8px; color: var(--a-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--a-line-strong); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--a-line); }
@media (max-width: 699px) {
  .table thead { display: none; }
  .table tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--a-line); }
  .table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; }
  .table td::before { content: attr(data-label); color: var(--a-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
}

/* ---------- Content management ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; border-bottom: 1px solid var(--a-line); scrollbar-width: none; }
.tabs__tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-bottom: 2px solid transparent; color: var(--a-muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs__tab[aria-current='page'] { color: var(--a-accent-text); border-bottom-color: var(--a-accent); }
.hours-edit { display: grid; gap: 4px; }
.hours-edit__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px 0; border-bottom: 1px solid var(--a-line); }
.hours-edit__day { min-width: 110px; font-weight: 600; text-transform: capitalize; }
.hours-edit__times { display: flex; align-items: center; gap: 8px; }
.hours-edit__times select { width: auto; }
.hours-edit__closed { color: var(--c-danger); font-weight: 600; }

.team-admin { display: grid; gap: 12px; }
@media (min-width: 900px) { .team-admin { grid-template-columns: 1fr 1fr; } }
.team-admin__card { display: flex; gap: 14px; padding: 14px; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius-lg); }
.team-admin__card.is-muted { opacity: 0.6; }
.team-admin__photo { display: grid; place-items: center; width: 96px; height: 120px; flex-shrink: 0; overflow: hidden; border-radius: var(--radius); background: var(--a-panel-2); color: var(--a-accent-text); font-family: var(--font-display); font-size: 3rem; }
.team-admin__photo img { width: 100%; height: 100%; object-fit: cover; }
.team-admin__body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.team-admin__body .row__actions { margin-top: 6px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.dropzone { position: relative; display: grid; justify-items: center; gap: 4px; padding: 24px; margin-bottom: 14px; border: 2px dashed var(--a-line-strong); border-radius: var(--radius-lg); color: var(--a-muted); text-align: center; cursor: pointer; }
.dropzone .icon { width: 28px; height: 28px; color: var(--a-accent); }
.dropzone span { color: var(--a-text); font-weight: 600; overflow-wrap: anywhere; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { border-color: var(--a-accent); }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery-admin__item { overflow: hidden; background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--radius); }
.gallery-admin__item.is-muted img { opacity: 0.4; }
.gallery-admin__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-admin__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; }
.gallery-admin__actions { display: flex; gap: 2px; margin-left: auto; }
.gallery-admin__actions .icon-btn { width: 36px; height: 36px; }
.modal__preview { max-height: 180px; margin: 0 auto 12px; border-radius: var(--radius); }

/* ---------- Dialogs ---------- */
.dialog { padding: 0; border: 1px solid var(--a-line-strong); border-radius: var(--radius-lg); background: var(--a-panel); color: var(--a-text); box-shadow: var(--shadow-2); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dialog--wide { width: min(760px, calc(100vw - 24px)); }
/* The global "* { margin: 0 }" reset removes the browser's centring of <dialog>; restore it. */
.dialog { margin: auto; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog__body { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.dialog__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 0; background: var(--c-info-tint); color: var(--c-info); }
.dialog__icon.is-danger { background: var(--c-danger-tint); color: var(--c-danger); }
.dialog__icon .icon { width: 26px; height: 26px; }
.dialog__title { font-size: 1.15rem; }
.dialog__text { color: var(--a-muted); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; width: 100%; }
.dialog__actions .btn { flex: 1 1 140px; }
.modal { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--a-line); }
.modal__title { font-size: 1.1rem; }
.modal__body { padding: 16px 20px; overflow-y: auto; }
.modal__error { margin: 0 20px 12px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--a-line); }
.modal__foot-start { margin-right: auto; }
@media (max-width: 599px) {
  .dialog--modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .modal { height: 100dvh; max-height: 100dvh; }
  .modal__body { flex: 1; }
  .modal__foot .btn { flex: 1; }
  .modal__foot-start { flex: 0 0 100%; order: 3; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 12px; right: 12px; bottom: calc(var(--bottom-h) + 12px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 900px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; } }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 12px 16px;
  background: var(--a-panel);
  border: 1px solid var(--c-success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease);
}
.toast .icon { color: var(--c-success); }
.toast--error { border-color: var(--c-danger); }
.toast--error .icon { color: var(--c-danger); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
