/* Sweathouse — Admin design language.
 *
 * Lifted from the public site: warm cream + ember amber + Cardo/Inter
 * pairing. Admin keeps the palette, drops the photography, gains
 * compact density. Everything is scoped under .sw-app so it cannot
 * leak onto public pages.
 *
 * Pair with /js/admin.js for sidebar collapse + dark toggle + the
 * shared api()/toast()/fmt helpers each admin page uses.
 */

@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Cardo-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Cardo';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Cardo-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cardo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Cardo-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
}

:root {
  --sw-bg:        #f7f2e8;
  --sw-surface:   #fbf8f1;
  --sw-surface-2: #f1ead9;
  --sw-surface-3: #e9e0c9;

  --sw-ink:       #2a2418;
  --sw-ink-2:     #5a4f3d;
  --sw-ink-3:     #8a7e68;
  --sw-ink-4:     #b5a98c;

  --sw-line:      #e3d8bd;
  --sw-line-2:    #d4c69f;

  --sw-ember:     #c08a3e;
  --sw-ember-ink: #8a5e1f;
  --sw-ember-bg:  #f4e7cf;

  --sw-good:      #6b8a4f;     --sw-good-bg:   #e3ead2;
  --sw-warn:      #b8893d;     --sw-warn-bg:   #f2e4c4;
  --sw-bad:       #a05548;     --sw-bad-bg:    #efd9d0;
  --sw-info:      #6a7a8c;     --sw-info-bg:   #dde2e8;

  --sw-serif: 'Cardo', 'Iowan Old Style', Georgia, serif;
  --sw-sans:  'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
  --sw-mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --sw-text-xs: 11px;
  --sw-text-sm: 12.5px;
  --sw-text-md: 14px;
  --sw-text-lg: 16px;
  --sw-text-xl: 20px;
  --sw-text-2xl: 28px;
  --sw-text-3xl: 36px;

  --sw-r-sm: 3px;
  --sw-r-md: 5px;
  --sw-r-lg: 8px;

  --sw-shadow-sm: 0 1px 0 rgba(70,55,30,0.04);
  --sw-shadow-md: 0 1px 2px rgba(70,55,30,0.06), 0 4px 12px rgba(70,55,30,0.04);
  --sw-shadow-lg: 0 12px 40px rgba(40,30,15,0.12);

  --sw-sidebar-w: 220px;
  --sw-row-h: 36px;
}

.sw-dark {
  --sw-bg:        #1a1612;
  --sw-surface:   #221d17;
  --sw-surface-2: #2a241c;
  --sw-surface-3: #332c22;

  --sw-ink:       #f2ead7;
  --sw-ink-2:     #bdb29a;
  --sw-ink-3:     #8a8170;
  --sw-ink-4:     #5a5246;

  --sw-line:      #3a3225;
  --sw-line-2:    #4a4030;

  --sw-ember:     #d9a661;
  --sw-ember-ink: #f4d199;
  --sw-ember-bg:  #3a2e1c;

  --sw-good: #94b079;     --sw-good-bg: #2c3a24;
  --sw-warn: #d4a55c;     --sw-warn-bg: #3a2e1a;
  --sw-bad:  #c98275;     --sw-bad-bg:  #3a2620;
  --sw-info: #94a3b5;     --sw-info-bg: #283038;
}

/* Body override for admin pages — they set body_class="is-admin" */
body.is-admin {
  background: var(--sw-bg);
  margin: 0;
}
body.is-admin .site-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Reset under sw-app */
.sw-app, .sw-app * { box-sizing: border-box; }
.sw-app {
  font-family: var(--sw-sans);
  font-size: var(--sw-text-md);
  color: var(--sw-ink);
  background: var(--sw-bg);
  line-height: 1.45;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

.sw-app h1, .sw-app h2, .sw-app h3, .sw-app h4 {
  font-family: var(--sw-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--sw-ink);
  margin: 0;
}
.sw-app h1 { font-size: var(--sw-text-3xl); line-height: 1.15; }
.sw-app h2 { font-size: var(--sw-text-2xl); line-height: 1.2; }
.sw-app h3 { font-size: var(--sw-text-xl);  line-height: 1.3; }

.sw-app a { color: inherit; text-decoration: none; }
.sw-mono { font-family: var(--sw-mono); }
.sw-num  { font-variant-numeric: tabular-nums; }

.sw-eyebrow {
  font-family: var(--sw-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-ink-3);
}

.sw-grain::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  mix-blend-mode: multiply;
}

/* ── Buttons ─────────────────────────────────────────────── */
.sw-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  font: 500 var(--sw-text-sm)/1 var(--sw-sans);
  color: var(--sw-ink);
  background: var(--sw-surface);
  border: 1px solid var(--sw-line-2);
  border-radius: var(--sw-r-md);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms;
  white-space: nowrap;
  text-decoration: none;
}
.sw-btn > .ph,
.sw-filters__chip > .ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: relative;
  top: 0;
}
.sw-btn:hover { background: var(--sw-surface-2); border-color: var(--sw-ink-3); }
.sw-btn:active { transform: translateY(0.5px); }
.sw-btn--primary,
.sw-btn--primary:link,
.sw-btn--primary:visited {
  background: var(--sw-ink);
  color: var(--sw-bg) !important;
  border-color: var(--sw-ink);
}
.sw-btn--primary > * {
  color: inherit !important;
}
.sw-btn--primary:hover { background: #3a3122; border-color: #3a3122; }
.sw-dark .sw-btn--primary { background: var(--sw-ember); color: #fff !important; border-color: var(--sw-ember); }
.sw-dark .sw-btn--primary:hover { background: #c98f43; border-color: #c98f43; }
.sw-btn--ember { background: var(--sw-ember); color: #fff; border-color: var(--sw-ember); }
.sw-btn--ember:hover { filter: brightness(0.95); }
.sw-btn--ghost { background: transparent; border-color: transparent; color: var(--sw-ink-2); }
.sw-btn--ghost:hover { background: var(--sw-surface-2); color: var(--sw-ink); }
.sw-btn--danger { color: var(--sw-bad); border-color: var(--sw-bad); background: transparent; }
.sw-btn--danger:hover { background: var(--sw-bad-bg); }
.sw-btn--sm { height: 24px; padding: 0 8px; font-size: var(--sw-text-xs); }
.sw-btn--icon { width: 28px; padding: 0; justify-content: center; }
.sw-btn--icon.sw-btn--sm { width: 24px; }

/* ── Inputs ──────────────────────────────────────────────── */
.sw-input, .sw-select, .sw-textarea {
  width: 100%; height: 28px;
  padding: 0 10px;
  font: 400 var(--sw-text-sm)/1 var(--sw-sans);
  color: var(--sw-ink);
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-md);
  outline: none;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.sw-input:hover, .sw-select:hover { border-color: var(--sw-line-2); }
.sw-input:focus, .sw-select:focus, .sw-textarea:focus {
  border-color: var(--sw-ember);
  box-shadow: 0 0 0 3px rgba(192,138,62,0.15);
  background: var(--sw-surface);
}
.sw-textarea {
  height: auto; min-height: 60px; padding: 8px 10px; line-height: 1.5;
  resize: vertical; font-family: var(--sw-mono); font-size: 12px;
}
.sw-input::placeholder { color: var(--sw-ink-4); }
.sw-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a7e68' fill='none' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.sw-label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 500;
  color: var(--sw-ink-2);
  letter-spacing: 0.02em;
}
.sw-label--inline { flex-direction: row; align-items: center; gap: 8px; }

/* ── Card + table ────────────────────────────────────────── */
.sw-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-lg);
  box-shadow: var(--sw-shadow-sm);
}
.sw-card__hd {
  padding: 14px 16px;
  border-bottom: 1px solid var(--sw-line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sw-card__hd h3 { font-family: var(--sw-serif); font-size: 17px; }
.sw-card__bd { padding: 14px 16px; }

.sw-table { width: 100%; border-collapse: collapse; font-size: var(--sw-text-sm); }
.sw-table th {
  text-align: left;
  font-family: var(--sw-sans);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--sw-line-2);
  background: transparent;
}
.sw-table td {
  padding: 0 12px;
  height: var(--sw-row-h);
  border-bottom: 1px solid var(--sw-line);
  vertical-align: middle;
  color: var(--sw-ink);
}
.sw-table tbody tr { transition: background 80ms; }
.sw-table tbody tr:hover { background: var(--sw-surface-2); }
.sw-table tbody tr:last-child td { border-bottom: 0; }
.sw-table .sw-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Thumb ───────────────────────────────────────────────── */
.sw-thumb {
  width: 28px; height: 28px;
  border-radius: var(--sw-r-sm);
  background: var(--sw-ember);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  position: relative;
}
.sw-thumb--lg { width: 40px; height: 40px; border-radius: var(--sw-r-md); }
.sw-thumb__stripes {
  display: none;
}
.sw-thumb__letter {
  position: relative;
  font-family: var(--sw-serif);
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}

/* ── Pills ───────────────────────────────────────────────── */
.sw-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  font-size: 11px; font-weight: 500;
  border-radius: 999px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  letter-spacing: 0.01em;
}
.sw-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sw-ink-3);
}
.sw-pill--good  { background: var(--sw-good-bg); color: var(--sw-good); }
.sw-pill--good::before  { background: var(--sw-good); }
.sw-pill--warn  { background: var(--sw-warn-bg); color: var(--sw-warn); }
.sw-pill--warn::before  { background: var(--sw-warn); }
.sw-pill--bad   { background: var(--sw-bad-bg);  color: var(--sw-bad); }
.sw-pill--bad::before   { background: var(--sw-bad); }
.sw-pill--info  { background: var(--sw-info-bg); color: var(--sw-info); }
.sw-pill--info::before  { background: var(--sw-info); }
.sw-pill--ember { background: var(--sw-ember-bg); color: var(--sw-ember-ink); }
.sw-pill--ember::before { background: var(--sw-ember); }
.sw-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--loc-border, var(--sw-line));
  border-radius: 999px;
  background: var(--loc-bg, var(--sw-surface-2));
  color: var(--loc-fg, var(--sw-ink-2));
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}
.sw-loc::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--loc-dot, var(--sw-ember));
  flex: 0 0 auto;
}
.sw-loc__text {
  overflow: hidden;
  overflow-wrap: anywhere;
}
.sw-loc-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sw-sidebar {
  width: var(--sw-sidebar-w);
  flex-shrink: 0;
  background: var(--sw-surface);
  border-right: 1px solid var(--sw-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  transition: width 280ms cubic-bezier(.4,.1,.2,1);
}
.sw-sidebar--collapsed { width: 56px; }
.sw-sidebar__hd {
  padding: 16px 14px 10px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--sw-line);
  height: 56px;
}
.sw-burger {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--sw-r-sm);
  transition: background 120ms;
}
.sw-burger:hover { background: var(--sw-surface-2); }
.sw-burger__lines { position: relative; width: 16px; height: 12px; }
.sw-burger__lines span {
  position: absolute; left: 0; right: 0;
  height: 1.5px;
  background: var(--sw-ink);
  border-radius: 1px;
  transition: transform 280ms cubic-bezier(.4,.1,.2,1), top 200ms ease 80ms, opacity 120ms;
}
.sw-burger__lines span:nth-child(1) { top: 2px; }
.sw-burger__lines span:nth-child(2) { top: 8px; }
.sw-burger.is-open .sw-burger__lines span:nth-child(1) { top: 5px; transform: rotate(45deg); transition: top 200ms ease, transform 280ms ease 80ms; }
.sw-burger.is-open .sw-burger__lines span:nth-child(2) { top: 5px; transform: rotate(-45deg); transition: top 200ms ease, transform 280ms ease 80ms; }

.sw-brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--sw-ink);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 200ms;
  text-decoration: none;
  min-width: 0;
}
.sw-sidebar--collapsed .sw-brand { opacity: 0; pointer-events: none; }
.sw-brand__flame { width: 20px; height: 20px; color: var(--sw-ember); flex-shrink: 0; }
.sw-brand__words { display: flex; flex-direction: column; min-width: 0; line-height: 1; }
.sw-brand__name {
  font-family: var(--sw-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--sw-ink);
  line-height: 1.1;
}
.sw-brand__sub {
  font-family: var(--sw-sans);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sw-ink-3);
  margin-top: 2px;
}

.sw-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.sw-nav__group {
  font-family: var(--sw-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-ink-4);
  padding: 14px 10px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.sw-sidebar--collapsed .sw-nav__group { opacity: 0; height: 18px; padding: 8px 0 0; }
.sw-nav a {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  font-size: var(--sw-text-sm);
  color: var(--sw-ink-2);
  text-decoration: none;
  border-radius: var(--sw-r-md);
  margin: 1px 0;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
  overflow: hidden;
}
.sw-nav a:hover { background: var(--sw-surface-2); color: var(--sw-ink); }

/* Role-gated nav: hidden by default, revealed synchronously based on
   data-sw-role on <html> (set by the pre-paint script in shell.html
   from the cached identity). admin.js refreshes the cache after each
   /api/admin/verify and re-applies the gate at runtime. */
.sw-nav a[data-roles] { display: none; }
html[data-sw-role="super_admin"] .sw-nav a[data-roles~="super_admin"],
html[data-sw-role="sub_admin"]   .sw-nav a[data-roles~="sub_admin"],
html[data-sw-role="cairde"]      .sw-nav a[data-roles~="cairde"] { display: flex; }
.sw-nav a.is-active {
  background: var(--sw-ember-bg);
  color: var(--sw-ember-ink);
  font-weight: 500;
}
.sw-nav a.is-active .sw-nav__icon { color: var(--sw-ember); }
.sw-nav__icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--sw-ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sw-nav__count { margin-left: auto; font-size: 10.5px; color: var(--sw-ink-3); font-variant-numeric: tabular-nums; }
.sw-sidebar--collapsed .sw-nav__label,
.sw-sidebar--collapsed .sw-nav__count { opacity: 0; }

.sw-sidebar__ft {
  padding: 10px 12px;
  border-top: 1px solid var(--sw-line);
  display: flex; align-items: center; gap: 10px;
  font-size: var(--sw-text-sm);
  color: var(--sw-ink-2);
}
.sw-sidebar__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.sw-sidebar__account:focus-visible,
.sw-sidebar__ft__id:focus-visible {
  outline: 2px solid var(--sw-ember);
  outline-offset: 2px;
}
.sw-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sw-ember);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sw-serif);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sw-sidebar__ft__id { flex: 1; min-width: 0; overflow: hidden; color: inherit; text-decoration: none; border-radius: var(--sw-r-sm); }
.sw-sidebar__ft__name { font-size: 12px; font-weight: 500; color: var(--sw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-sidebar__ft__email { font-size: 10.5px; color: var(--sw-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-sidebar--collapsed .sw-sidebar__ft__id { display: none; }

/* ── Main / topbar / page ─────────────────────────────────── */
.sw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sw-topbar {
  height: 56px;
  padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--sw-line);
  background: var(--sw-bg);
  position: sticky; top: 0; z-index: 5;
}
.sw-crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--sw-text-sm);
  color: var(--sw-ink-3);
}
.sw-crumbs__sep { color: var(--sw-ink-4); }
.sw-crumbs strong { color: var(--sw-ink); font-weight: 500; }
.sw-search {
  position: relative;
  margin-left: auto;
}
.sw-search input {
  width: 240px;
  height: 28px;
  padding: 0 10px 0 30px;
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-md);
  font: 400 var(--sw-text-sm)/1 var(--sw-sans);
  color: var(--sw-ink);
  outline: none;
}
.sw-search input:focus { border-color: var(--sw-ember); box-shadow: 0 0 0 3px rgba(192,138,62,0.12); }
.sw-search__icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--sw-ink-4);
  pointer-events: none;
}
.sw-kbd {
  font-family: var(--sw-mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--sw-line-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--sw-ink-3);
  background: var(--sw-surface);
}

.sw-page { padding: 24px 28px 48px; flex: 1; }
.sw-page__hd {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.sw-page__hd h1 { font-size: 32px; }
.sw-page__hd p { color: var(--sw-ink-2); font-size: var(--sw-text-md); margin: 4px 0 0; }
.sw-actions { display: flex; gap: 8px; align-items: center; }

/* ── Stats ───────────────────────────────────────────────── */
.sw-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sw-stat {
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-lg);
  padding: 14px 16px 16px;
  position: relative;
  overflow: hidden;
}
.sw-stat__lbl { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sw-ink-3); }
.sw-stat__num {
  font-family: var(--sw-serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--sw-ink);
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.sw-stat__delta { font-size: 11px; color: var(--sw-ink-2); display: flex; align-items: center; gap: 4px; }
.sw-stat__delta--up   { color: var(--sw-good); }
.sw-stat__delta--down { color: var(--sw-bad); }

/* ── Bar / row actions / empty ─────────────────────────────── */
.sw-bar { height: 4px; border-radius: 2px; background: var(--sw-surface-3); overflow: hidden; min-width: 60px; }
.sw-bar > div { height: 100%; background: var(--sw-ember); }

.sw-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 100ms; }
.sw-table tbody tr:hover .sw-row-actions { opacity: 1; }
.sw-calendar-actions {
  opacity: 1;
  margin-left: auto;
}
.sw-week__slot .sw-calendar-actions {
  margin: 8px 0 0;
}
.sw-day__slot .sw-calendar-actions {
  flex: 0 0 auto;
}

.sw-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--sw-ink-3);
  font-size: var(--sw-text-sm);
}

/* ── Filters ─────────────────────────────────────────────── */
.sw-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sw-line);
  background: var(--sw-surface);
  align-items: center;
}
.sw-filters__chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  font-size: var(--sw-text-sm);
  background: var(--sw-bg);
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  color: var(--sw-ink-2);
  cursor: pointer;
}
.sw-filters__chip:hover { border-color: var(--sw-line-2); }
.sw-filters__chip.is-on {
  background: var(--sw-ember-bg);
  color: var(--sw-ember-ink);
  border-color: var(--sw-ember);
}

/* ── Code / SQL ──────────────────────────────────────────── */
.sw-code {
  font-family: var(--sw-mono);
  font-size: 12px;
  background: var(--sw-surface-3);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-md);
  padding: 10px 12px;
  color: var(--sw-ink);
  white-space: pre;
  overflow: auto;
  line-height: 1.6;
}
.sw-dark .sw-code { background: #15110d; }

.sw-rule { height: 1px; background: var(--sw-line); margin: 16px 0; }

.sw-section-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 0 12px;
}
.sw-section-hd h3 { font-family: var(--sw-serif); font-size: 18px; }
.sw-section-hd .sw-eyebrow { color: var(--sw-ink-3); }
.sw-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 20px;
}
@media (max-width: 1040px) {
  .sw-dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Toast ───────────────────────────────────────────────── */
.sw-toast {
  position: fixed; top: 16px; right: 16px;
  padding: 10px 14px;
  background: var(--sw-ink); color: var(--sw-bg);
  border-radius: var(--sw-r-md);
  font-size: var(--sw-text-sm);
  box-shadow: var(--sw-shadow-md);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 160ms, transform 160ms;
  pointer-events: none;
  z-index: 100;
}
.sw-toast.is-show { opacity: 1; transform: translateY(0); }
.sw-toast.is-err { background: var(--sw-bad); color: #fff; }

/* ── Calendar (week + month) — shared by /admin/slots, /admin/bookings, etc. ── */
.sw-cal-views { display: inline-flex; border: 1px solid var(--sw-line); border-radius: 6px; overflow: hidden; }
.sw-cal-views .sw-filters__chip { border-radius: 0; border: 0; margin: 0; }
.sw-cal-views .sw-filters__chip + .sw-filters__chip { border-left: 1px solid var(--sw-line); }

.sw-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sw-week__col { border: 1px solid var(--sw-line); border-radius: var(--sw-r-md); padding: 8px; min-height: 220px; background: var(--sw-surface); display: flex; flex-direction: column; gap: 6px; }
.sw-week__col__hd { font-family: var(--sw-serif); font-size: 13px; color: var(--sw-ink-2); padding: 2px 4px 6px; border-bottom: 1px solid var(--sw-line); display: flex; justify-content: space-between; align-items: baseline; }
.sw-week__col__hd small { font-size: 10px; color: var(--sw-ink-3); font-family: var(--sw-mono); }
.sw-week__slot { padding: 6px 8px; border: 1px solid var(--sw-line); border-radius: 6px; background: var(--sw-bg); cursor: pointer; transition: background 0.1s, border-color 0.1s; font-size: 11.5px; line-height: 1.3; }
.sw-week__slot:hover { background: var(--sw-surface-2); border-color: var(--sw-line-2); }
.sw-week__slot.is-cancelled { opacity: 0.5; text-decoration: line-through; }
.sw-week__slot.is-full { border-color: var(--sw-ember); }
.sw-week__slot__time { font-family: var(--sw-mono); color: var(--sw-ink-2); }
.sw-week__slot__title { font-weight: 500; color: var(--sw-ink); margin-top: 2px; }
.sw-week__slot__cap { color: var(--sw-ink-3); font-size: 10px; margin-top: 2px; }
.sw-week__slot .sw-loc {
  max-width: 100%;
  border-radius: 8px;
}
.sw-week__add { margin-top: auto; opacity: 0.6; }

.sw-month__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.sw-month__title { font-family: var(--sw-serif); font-size: 17px; color: var(--sw-ink); }
.sw-month__weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; padding: 0 2px; }
.sw-month__weekdays span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sw-ink-3); text-align: center; padding: 4px 0; }
.sw-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sw-month__day {
  border: 1px solid var(--sw-line); border-radius: var(--sw-r-md);
  padding: 6px 8px; min-height: 92px; background: var(--sw-surface);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: border-color 0.1s, background 0.1s;
}
.sw-month__day:hover { border-color: var(--sw-line-2); background: var(--sw-surface-2); }
.sw-month__day.is-other { background: transparent; opacity: 0.45; }
.sw-month__day.is-today { border-color: var(--sw-ember); border-width: 2px; padding: 5px 7px; }
.sw-month__day__hd { display: flex; align-items: baseline; justify-content: space-between; }
.sw-month__day__num { font-family: var(--sw-serif); font-size: 13px; color: var(--sw-ink-2); }
.sw-month__day__count { font-family: var(--sw-mono); font-size: 9.5px; color: var(--sw-ink-3); }
.sw-month__day__dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.sw-month__day__dot {
  width: 100%; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--sw-good) var(--fill, 0%), var(--sw-line) var(--fill, 0%));
  border: 0;
  display: block;
  padding: 0;
}
.sw-month__day__dot.is-cancelled { background: var(--sw-line-2); opacity: 0.5; }
.sw-month__day__dot.is-full { background: var(--sw-ember); }
.sw-month__day__dot.is-info { background: var(--sw-good); }

.sw-month__day__events { display: flex; flex-direction: column; gap: 2px; margin-top: auto; min-height: 0; }
.sw-month__day__ev {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 4px; border-radius: 3px;
  font-size: 10.5px; line-height: 1.2;
  background: var(--sw-bg);
  cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.sw-month__day__ev:hover { background: var(--sw-surface-2); }
.sw-month__day__ev__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sw-month__day__ev__time { font-family: var(--sw-mono); color: var(--sw-ink-2); flex-shrink: 0; }
.sw-month__day__ev__title { color: var(--sw-ink); overflow: hidden; text-overflow: ellipsis; }
.sw-month__day__more {
  font-size: 10px; color: var(--sw-ember-ink);
  background: transparent; border: 0; padding: 1px 4px;
  text-align: left; cursor: pointer;
}
.sw-month__day__more:hover { text-decoration: underline; }
.sw-month__day__add {
  background: transparent; border: 1px dashed var(--sw-line-2);
  color: var(--sw-ink-3); border-radius: 3px;
  width: 18px; height: 18px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  transition: opacity 0.1s;
}
.sw-month__day:hover .sw-month__day__add { opacity: 1; }
.sw-month__day__add:hover { background: var(--sw-surface-2); color: var(--sw-ink); }

.sw-day { display: flex; flex-direction: column; border-top: 1px solid var(--sw-line); }
.sw-day__hour {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 54px;
  border-bottom: 1px solid var(--sw-line);
}
.sw-day__time {
  padding: 10px 10px 0 2px;
  font-family: var(--sw-mono);
  font-size: 10.5px;
  color: var(--sw-ink-3);
}
.sw-day__body {
  min-width: 0;
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sw-day__slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-r-md);
  background: var(--sw-bg);
  color: var(--sw-ink);
  cursor: pointer;
  text-align: left;
}
.sw-day__slot:hover { background: var(--sw-surface-2); border-color: var(--sw-line-2); }
.sw-day__slot.is-cancelled { opacity: 0.55; text-decoration: line-through; }
.sw-day__slot.is-full { border-color: var(--sw-ember); }
.sw-day__slot__time { font-family: var(--sw-mono); color: var(--sw-ink-2); font-size: 11px; }
.sw-day__slot__title { font-weight: 600; font-size: 12px; }
.sw-day__slot__meta { color: var(--sw-ink-3); font-size: 10.5px; }
.sw-day__empty { color: var(--sw-ink-4); font-size: 11px; }
.sw-day__add {
  width: 26px;
  height: 26px;
  border: 1px dashed var(--sw-line-2);
  border-radius: var(--sw-r-md);
  background: transparent;
  color: var(--sw-ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sw-day__add:hover { background: var(--sw-surface-2); color: var(--sw-ink); }

.sw-bulkbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sw-line);
  background: var(--sw-ember-bg);
  color: var(--sw-ember-ink);
}
.sw-bulkbar.is-active { display: flex; }
.sw-bulkbar__count { font-weight: 600; margin-right: auto; }
.sw-check {
  width: 16px;
  height: 16px;
  accent-color: var(--sw-ember);
  flex-shrink: 0;
}
.sw-week__slot {
  position: relative;
}
.sw-week__slot.is-selected {
  border-color: var(--sw-ember);
  box-shadow: inset 0 0 0 1px var(--sw-ember);
  background: var(--sw-ember-bg);
}
.sw-week__slot .sw-check {
  position: absolute;
  top: 6px;
  right: 6px;
}
.sw-week__slot.has-check { padding-right: 30px; }

/* ── Mobile admin shell ──────────────────────────────────── */
@media (max-width: 760px) {
  :root {
    --sw-row-h: 42px;
  }

  body.is-admin {
    overflow-x: hidden;
  }

  body.is-admin.sw-mobile-nav-open {
    overflow: hidden;
  }

  .sw-app {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .sw-sidebar,
  .sw-sidebar--collapsed {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--sw-line);
    transition: none;
  }

  .sw-sidebar.is-mobile-open {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-bottom: 0;
    background: var(--sw-surface);
    box-shadow: 0 18px 60px rgba(31, 24, 20, 0.22);
  }

  .sw-sidebar__hd {
    height: 48px;
    padding: 8px 12px;
  }

  .sw-sidebar.is-mobile-open .sw-sidebar__hd {
    flex: 0 0 56px;
    height: 56px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--sw-line);
  }

  .sw-sidebar:not(.is-mobile-open) .sw-sidebar__hd {
    border-bottom: 0;
  }

  .sw-burger {
    display: flex;
    margin-left: auto;
    order: 2;
    width: auto;
    min-width: 76px;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--sw-line-2);
    background: var(--sw-bg);
  }

  .sw-burger::after {
    content: 'Menu';
    font: 600 12px/1 var(--sw-sans);
    color: var(--sw-ink-2);
  }

  .sw-sidebar.is-mobile-open .sw-burger::after {
    content: 'Close';
  }

  .sw-sidebar--collapsed .sw-brand,
  .sw-brand {
    opacity: 1;
    pointer-events: auto;
  }

  .sw-brand__name {
    font-size: 16px;
  }

  .sw-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 12px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .sw-sidebar.is-mobile-open .sw-nav {
    display: flex;
    flex: 1 1 auto;
    padding: 12px;
    max-height: none;
    min-height: 0;
  }

  .sw-nav__group {
    display: block;
    padding: 10px 10px 4px;
  }

  .sw-nav a,
  .sw-sidebar--collapsed .sw-nav a {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--sw-line);
    background: var(--sw-bg);
    border-radius: var(--sw-r-md);
    gap: 7px;
    overflow: visible;
  }

  .sw-sidebar--collapsed .sw-nav__label,
  .sw-sidebar--collapsed .sw-nav__count {
    opacity: 1;
  }

  .sw-nav__icon {
    width: 15px;
    height: 15px;
  }

  .sw-sidebar__ft {
    display: none;
  }

  .sw-sidebar.is-mobile-open .sw-sidebar__ft {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 12px;
    border-top: 1px solid var(--sw-line);
    background: var(--sw-surface);
  }

  .sw-sidebar.is-mobile-open .sw-sidebar__ft__id {
    display: block;
  }

  .sw-main {
    min-width: 0;
    width: 100%;
  }

  .sw-topbar {
    position: static;
    height: auto;
    min-height: 48px;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .sw-crumbs {
    min-width: 0;
    flex: 1 1 100%;
    overflow: hidden;
  }

  .sw-crumbs strong,
  .sw-crumbs span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sw-search {
    order: 3;
    margin-left: 0;
    flex: 1 1 100%;
  }

  .sw-search input {
    width: 100%;
    height: 34px;
  }

  .sw-kbd {
    display: none;
  }

  .sw-topbar > .sw-btn,
  .sw-topbar > a.sw-btn {
    height: 34px;
    flex: 0 0 auto;
  }

  .sw-page {
    padding: 16px 12px 32px;
    min-width: 0;
  }

  .sw-page__hd {
    display: block;
    margin-bottom: 14px;
  }

  .sw-page__hd h1 {
    font-size: 28px;
  }

  .sw-page__hd p {
    font-size: 13px;
  }

  .sw-actions {
    margin-top: 12px;
    flex-wrap: wrap;
  }

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

  .sw-stat {
    padding: 12px;
  }

  .sw-stat__num {
    font-size: 30px;
  }

  .sw-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sw-card__hd {
    padding: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sw-card__bd {
    padding: 12px;
  }

  .sw-table {
    min-width: 680px;
  }

  .sw-table th,
  .sw-table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sw-card-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .sw-card-table thead {
    display: none;
  }

  .sw-card-table tbody,
  .sw-card-table tr,
  .sw-card-table td {
    display: block;
    width: 100%;
  }

  .sw-card-table tr {
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-r-lg);
    background: var(--sw-bg);
    padding: 10px 12px;
    box-shadow: var(--sw-shadow-sm);
  }

  .sw-card-table td {
    border: 0;
    padding: 7px 0;
  }

  .sw-card-table td[data-label] {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .sw-card-table td[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sw-ink-3);
  }

  .sw-card-table td[data-label="Name"] {
    display: block;
    padding-bottom: 10px;
  }

  .sw-card-table td[data-label="Name"]::before {
    display: none;
  }

  .sw-card-table td[data-label="Actions"] {
    display: block;
    padding-top: 10px;
  }

  .sw-card-table td[data-label="Actions"]::before {
    display: none;
  }

  .sw-card-table .sw-row-actions {
    display: flex;
    opacity: 1;
    gap: 8px;
  }

  .sw-card-table .sw-row-actions .sw-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .sw-card-table .sw-row-actions .sw-btn[title]::after,
  .sw-calendar-actions .sw-btn[title]::after {
    content: attr(title);
    font-size: 11px;
    font-weight: 600;
  }

  .sw-card-table .sw-row-actions .sw-btn[title],
  .sw-calendar-actions .sw-btn[title] {
    width: auto;
    min-width: 0;
    padding: 0 9px;
  }

  .sw-row-actions {
    opacity: 1;
  }

  .sw-filters,
  .sw-bulkbar {
    padding: 10px 12px;
    overflow-x: visible;
    flex-wrap: wrap;
    -webkit-overflow-scrolling: touch;
  }

  .sw-filters > span[style*="flex:1"] {
    display: none;
  }

  .sw-bulkbar.is-active {
    display: flex;
  }

  .sw-bulkbar__count {
    flex: 0 0 auto;
    margin-right: 4px;
  }

  .sw-cal-views {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 100%;
    width: 100%;
  }

  .sw-cal-views .sw-filters__chip {
    justify-content: center;
    min-width: 0;
  }

  .sw-week {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .sw-week__col {
    min-width: 210px;
  }

  .sw-month__weekdays,
  .sw-month {
    min-width: 680px;
  }

  .sw-month__scroll {
    overflow-x: auto;
  }

  .sw-month__day {
    min-height: 84px;
  }

  .sw-day__hour {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .sw-day__body {
    align-items: stretch;
  }

  .sw-day__slot {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .sw-stats {
    grid-template-columns: 1fr;
  }

  .sw-btn {
    min-height: 32px;
  }

  .sw-page__hd h1 {
    font-size: 26px;
  }
}
