/* ============================================================================
   ACE'S AESTHETIC CLINIC - STAFF WORKSPACE  ·  "Atelier" design system
   Rebuilt from scratch 2026-09-29.

   Direction (skills: ui-ux-pro-max, visual-direction, color-theory,
   web-typography, ui-design, component-patterns, accessibility):
   quiet-luxury minimalism. Warm ivory canvas, white floating surfaces, one
   champagne-gold accent used sparingly (60-30-10), ink for structure.
   Cormorant serif for page titles / greetings only; Poppins for every UI
   and data surface. Light + dark are two independent palettes, not an
   inversion. Everything is a token; no raw hex outside the palette blocks.

   Scope: every rule is under `body.admin-app`, so the shared primitives in
   components.css (also used by the customer site) are restyled for the
   workspace only. Class names and element ids are a contract with
   assets/js/admin-shell.js and each page's own script - restyle freely,
   rename never.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------ */
body.admin-app {
  color-scheme: light;

  /* primitives - light */
  --a-canvas: #F6F2EA;
  --a-surface: #FFFFFF;
  --a-raised: #FFFDF8;
  --a-sunken: #EFE9DC;
  --a-ink: #17140F;
  --a-ink-2: #4A433A;
  --a-ink-3: #6B6256;
  --a-line: #E7DFD0;
  --a-line-strong: #D5CAB6;
  --a-gold: #8A6519;
  --a-gold-fill: #B8933F;
  --a-gold-soft: #F4ECD6;
  --a-gold-line: rgba(184, 147, 63, 0.38);
  --a-ok: #3B6636;
  --a-ok-soft: #E6EEDF;
  --a-warn: #855500;
  --a-warn-soft: #FAEFD0;
  --a-bad: #B0261B;
  --a-bad-soft: #FBE6E3;
  --a-scrim: rgba(23, 20, 15, 0.46);
  --a-shadow-1: 0 1px 2px rgba(23, 20, 15, 0.04), 0 1px 1px rgba(23, 20, 15, 0.03);
  --a-shadow-2: 0 4px 14px rgba(23, 20, 15, 0.06), 0 1px 3px rgba(23, 20, 15, 0.05);
  --a-shadow-3: 0 18px 44px rgba(23, 20, 15, 0.14), 0 4px 12px rgba(23, 20, 15, 0.06);
  --a-glass: rgba(246, 242, 234, 0.82);

  --a-serif: 'Cormorant', 'Times New Roman', serif;
  --a-sidebar-w: 252px;
  --a-topbar-h: 76px;
  --a-radius: 16px;
  --a-radius-sm: 10px;
  --a-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* remap the shared semantic tokens so components.css primitives (buttons,
     inputs, badges, tables, dialogs, tabs...) pick the workspace palette up
     with no per-component edits */
  --color-bg: var(--a-canvas);
  --color-bg-alt: var(--a-sunken);
  --color-card: var(--a-surface);
  --color-ink: var(--a-ink);
  --color-ink-soft: var(--a-ink-2);
  --color-ink-faint: var(--a-ink-3);
  --color-primary: var(--a-ink);
  --color-primary-hover: var(--a-ink-2);
  --color-on-primary: #FFFFFF;
  --color-accent: var(--a-gold);
  --color-accent-soft: var(--a-gold-soft);
  --color-border: var(--a-line);
  --color-border-strong: var(--a-line-strong);
  --color-success: var(--a-ok);
  --color-success-surface: var(--a-ok-soft);
  --color-warning: var(--a-warn);
  --color-warning-surface: var(--a-warn-soft);
  --color-danger: var(--a-bad);
  --color-danger-surface: var(--a-bad-soft);
  --color-info: var(--a-ink-2);
  --color-info-surface: var(--a-sunken);
  --color-ring: var(--a-gold-fill);
  --terracotta-100: var(--a-gold-soft);
  --terracotta-300: #D9BE84;
  --terracotta-600: var(--a-gold);
  --terracotta-700: var(--a-gold);
  --pearl-50: var(--a-raised);
  --pearl-100: var(--a-sunken);
  --pearl-200: var(--a-sunken);
  --blush-50: var(--a-raised);
  --blush-100: var(--a-sunken);
  --champagne-200: var(--a-gold-soft);
  --rose-600: var(--a-ink);
  --rose-700: var(--a-ink-2);
  --rose-300: var(--a-line-strong);
  --rose-500: var(--a-gold-fill);
  --gold-600: var(--a-gold);
  --plum-900: var(--a-ink);
  --plum-600: var(--a-ink-2);
  --radius-btn: 12px;
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;

  /* legacy names still read by page-level inline styles */
  --admin-bg: var(--a-canvas);
  --admin-card: var(--a-surface);
  --admin-ink: var(--a-ink);
  --admin-ink-soft: var(--a-ink-2);
  --admin-ink-faint: var(--a-ink-3);
  --admin-border: var(--a-line);
  --admin-border-strong: var(--a-line-strong);
  --muted: var(--a-ink-3);
  --shadow-xs: var(--a-shadow-1);
  --shadow-sm: var(--a-shadow-1);
  --shadow-md: var(--a-shadow-2);
  --shadow-lg: var(--a-shadow-3);

  background: var(--a-canvas);
  color: var(--a-ink);
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* dark: an independent palette (warm espresso, muted gold), never an inversion */
html[data-admin-theme="dark"] body.admin-app {
  color-scheme: dark;
  --a-canvas: #14110D;
  --a-surface: #1D1913;
  --a-raised: #232017;
  --a-sunken: #100E0A;
  --a-ink: #F3EEE4;
  --a-ink-2: #CFC6B6;
  --a-ink-3: #A79D8C;
  --a-line: #322C22;
  --a-line-strong: #453D30;
  --a-gold: #DDB865;
  --a-gold-fill: #C9A24E;
  --a-gold-soft: #2C2412;
  --a-gold-line: rgba(221, 184, 101, 0.4);
  --a-ok: #9CC48F;
  --a-ok-soft: #1E2A1B;
  --a-warn: #E4B45C;
  --a-warn-soft: #2E2410;
  --a-bad: #F09A90;
  --a-bad-soft: #341A17;
  --a-scrim: rgba(0, 0, 0, 0.62);
  --a-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --a-shadow-2: 0 6px 18px rgba(0, 0, 0, 0.42);
  --a-shadow-3: 0 22px 50px rgba(0, 0, 0, 0.6);
  --a-glass: rgba(20, 17, 13, 0.8);
  --color-on-primary: #14110D;
  --terracotta-300: #8C7238;
}

/* The staff workspace is light until someone chooses dark with the moon button, and then it stays as chosen on that device.
   It no longer switches by itself when the phone or computer is set to dark mode. */

/* ---------------------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------------------ */
body.admin-app a { color: inherit; }
body.admin-app .muted, body.admin-app .faint { color: var(--a-ink-3); }
body.admin-app .text-xs { font-size: 0.78rem; }
body.admin-app .text-sm { font-size: 0.875rem; }
body.admin-app ::selection { background: var(--a-gold-soft); color: var(--a-ink); }

body.admin-app .skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 3000;
  padding: 10px 16px; border-radius: var(--a-radius-sm);
  background: var(--a-ink); color: var(--a-canvas); font-weight: 600; text-decoration: none;
  transition: top 160ms var(--a-ease);
}
body.admin-app .skip-link:focus { top: 12px; }

body.admin-app :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--a-gold-fill);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------------------
   3. SHELL - sidebar + workspace
   ------------------------------------------------------------------------ */
body.admin-app .admin-shell {
  display: grid;
  grid-template-columns: var(--a-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--a-canvas);
}
body.admin-app .admin-shell a,
body.admin-app .admin-shell button,
body.admin-app .admin-shell input,
body.admin-app .admin-shell select,
body.admin-app .admin-shell textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* --- sidebar: sits on the canvas itself (no card, no hard rule) --- */
body.admin-app .admin-sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px 18px;
  background: var(--a-canvas);
  border-right: 1px solid var(--a-line);
  overflow: hidden;
}
body.admin-app .admin-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 20px;
  text-decoration: none;
}
body.admin-app .admin-brand .logo-mark {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: var(--a-surface); border: 1px solid var(--a-line); box-shadow: var(--a-shadow-1);
}
body.admin-app .admin-brand .logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.admin-app .admin-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
body.admin-app .admin-brand .brand-name {
  font-family: var(--a-serif); font-size: 1.32rem; font-weight: 600; letter-spacing: 0;
  color: var(--a-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.admin-app .admin-brand .brand-sub {
  margin-top: 3px; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--a-gold);
}

body.admin-app .side-nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 2px;
  padding: 2px 6px 12px 0;
  scrollbar-width: thin; scrollbar-color: var(--a-line-strong) transparent;
}
body.admin-app .side-nav::-webkit-scrollbar { width: 6px; }
body.admin-app .side-nav::-webkit-scrollbar-thumb { background: var(--a-line-strong); border-radius: 8px; }

body.admin-app .side-nav > a,
body.admin-app .side-nav-group-btn {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 0; border-radius: 12px; background: transparent;
  font: inherit; font-size: 0.9rem; font-weight: 500; text-align: left; text-decoration: none;
  color: var(--a-ink-2); cursor: pointer;
  transition: background-color 160ms var(--a-ease), color 160ms var(--a-ease);
}
body.admin-app .side-nav > a svg,
body.admin-app .side-nav-group-btn > svg:first-child { flex-shrink: 0; color: var(--a-ink-3); transition: color 160ms var(--a-ease); }
body.admin-app .side-nav > a:hover,
body.admin-app .side-nav-group-btn:hover { background: var(--a-sunken); color: var(--a-ink); }
body.admin-app .side-nav > a:hover svg,
body.admin-app .side-nav-group-btn:hover > svg:first-child { color: var(--a-ink); }

body.admin-app .side-nav > a[aria-current="page"] {
  background: var(--a-surface); color: var(--a-ink); font-weight: 600;
  box-shadow: var(--a-shadow-1), inset 0 0 0 1px var(--a-line);
}
body.admin-app .side-nav > a[aria-current="page"] svg { color: var(--a-gold); }
body.admin-app .side-nav > a[aria-current="page"]::before,
body.admin-app .side-sub a[aria-current="page"]::before {
  content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--a-gold-fill);
}

body.admin-app .side-nav-group-btn .chev { margin-left: auto; transition: transform 200ms var(--a-ease), color 160ms var(--a-ease); color: var(--a-ink-3); flex-shrink: 0; }
body.admin-app .side-nav-group-btn:hover .chev,
body.admin-app .side-nav-group-btn[aria-expanded="true"] .chev { color: var(--a-ink); transform: translateX(2px); }
body.admin-app .side-nav-group-btn[aria-expanded="true"] { background: var(--a-sunken); color: var(--a-ink); }
body.admin-app .side-nav-group-btn.is-active { color: var(--a-ink); font-weight: 600; }
body.admin-app .side-nav-group-btn.is-active > svg:first-child { color: var(--a-gold); }

/* Flyout: floats beside the sidebar, never pushes it. Lives on <body>. */
.side-flyout {
  position: fixed; z-index: 400; min-width: 212px; max-width: 280px; max-height: calc(100vh - 16px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px; padding: 8px;
  background: var(--a-surface, #fff); color: var(--a-ink, #17140F);
  border: 1px solid var(--a-line, rgba(0,0,0,.1)); border-radius: 16px;
  box-shadow: var(--a-shadow-3, 0 18px 48px rgba(23,20,15,.18));
  animation: side-fly-in 160ms var(--a-ease, ease-out);
}
.side-flyout[hidden] { display: none; }
.side-flyout.is-sheet { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto; max-width: none; max-height: 70vh; z-index: 500; padding: 10px; }
/* On a phone the menu opens at the pressed button (position is set by the script), above the drawer. */
.side-flyout.is-under { z-index: 500; }
.side-flyout-title { padding: 8px 12px 6px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-gold, #8A6519); }
.side-flyout a {
  position: relative; display: flex; align-items: center; min-height: 42px; padding: 8px 12px;
  border-radius: 10px; font-size: 0.88rem; font-weight: 500; color: var(--a-ink-2, #4a4338); text-decoration: none;
  transition: background-color 140ms var(--a-ease, ease), color 140ms var(--a-ease, ease);
}
.side-flyout a:hover, .side-flyout a:focus-visible { background: var(--a-sunken, #efe9dc); color: var(--a-ink, #17140F); outline: none; }
.side-flyout a[aria-current="page"] { color: var(--a-ink, #17140F); font-weight: 600; background: var(--a-sunken, #efe9dc); }
.side-flyout a[aria-current="page"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--a-gold-fill, #b58a2b); }
@keyframes side-fly-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .side-flyout { animation: none; } }

body.admin-app .side-foot {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px;
  padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--a-line);
}
body.admin-app .side-foot a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 12px;
  font-size: 0.86rem; font-weight: 500; color: var(--a-ink-3); text-decoration: none;
  transition: background-color 160ms var(--a-ease), color 160ms var(--a-ease);
}
body.admin-app .side-foot a:hover { background: var(--a-sunken); color: var(--a-ink); }
body.admin-app .side-foot svg { flex-shrink: 0; }

/* --- workspace column --- */
body.admin-app .admin-main { min-width: 0; display: flex; flex-direction: column; }

body.admin-app .workspace-header {
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
  display: flex; align-items: center; gap: 20px;
  min-height: var(--a-topbar-h);
  padding: 14px clamp(20px, 3vw, 40px);
  background: var(--a-glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--a-line);
}
body.admin-app .ws-menu-btn { display: none; }
body.admin-app .ws-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.admin-app .ws-eyebrow {
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--a-gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.admin-app .ws-title h1 {
  margin: 0; font-family: var(--a-serif); font-size: clamp(1.55rem, 2.2vw, 2rem); font-weight: 600;
  line-height: 1.1; letter-spacing: 0; color: var(--a-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* command-bar search */
body.admin-app .ws-search { position: relative; flex: 0 1 360px; min-width: 180px; }
body.admin-app .ws-search .input {
  height: 44px; padding: 0 84px 0 44px; border-radius: 999px;
  background: var(--a-surface); border: 1px solid var(--a-line); box-shadow: var(--a-shadow-1);
  font-size: 0.875rem;
}
body.admin-app .ws-search .input::-webkit-search-cancel-button { display: none; }
body.admin-app .ws-search .input::placeholder { color: var(--a-ink-3); }
body.admin-app .ws-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; color: var(--a-ink-3); pointer-events: none; }
body.admin-app .ws-kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none;
  display: inline-flex; gap: 3px;
}
body.admin-app .ws-kbd kbd {
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
  font: 600 0.68rem/1 'Poppins', sans-serif; color: var(--a-ink-3);
  background: var(--a-sunken); border: 1px solid var(--a-line); border-radius: 6px;
}

body.admin-app .ws-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
body.admin-app .ws-actions .icon-btn { width: 44px; height: 44px; border-radius: 50%; color: var(--a-ink-2); }
body.admin-app .ws-actions .icon-btn:hover { background: var(--a-sunken); color: var(--a-ink); }
body.admin-app .ws-user { display: inline-flex; align-items: center; gap: 10px; padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--a-line); }
body.admin-app .ws-user-name { font-weight: 600; font-size: 0.86rem; color: var(--a-ink); white-space: nowrap; }

body.admin-app .notif-wrap { position: relative; }
body.admin-app .notif-badge {
  position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--a-bad); border: 2px solid var(--a-canvas); color: #fff; font-size: 0.6rem; font-weight: 700; line-height: 1;
}

body.admin-app .avatar-btn, body.admin-app .avatar-lg {
  border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex-shrink: 0;
  background: var(--a-gold-soft); color: var(--a-gold);
}
body.admin-app .avatar-btn { width: 42px; height: 42px; border: 1px solid var(--a-gold-line); cursor: pointer; padding: 0; }
body.admin-app .avatar-lg { width: 46px; height: 46px; }
body.admin-app .avatar-btn img, body.admin-app .avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.admin-app .avatar-initials { font-weight: 600; color: var(--a-gold); }

/* floating menus (profile, notifications, search results, row kebabs) */
body.admin-app .ws-portal { position: fixed; z-index: 2000; }
body.admin-app .ws-menu, body.admin-app .ws-search-results, body.admin-app .side-flyout {
  background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 14px;
  box-shadow: var(--a-shadow-3);
}
body.admin-app .ws-menu { padding: 6px; min-width: 240px; }
body.admin-app .ws-menu-title { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a-ink-3); padding: 8px 10px 4px; }
body.admin-app .ws-menu-link {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 9px 12px; text-align: left;
  border: 0; background: transparent; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--a-ink); text-decoration: none;
}
body.admin-app .ws-menu-link:hover { background: var(--a-sunken); }
body.admin-app .ws-menu-link svg { color: var(--a-ink-3); flex-shrink: 0; }
body.admin-app .ws-menu-link--danger:hover { background: var(--a-bad-soft); color: var(--a-bad); }
body.admin-app .ws-menu-link--danger:hover svg { color: var(--a-bad); }
body.admin-app .ws-menu-sep { height: 1px; margin: 5px 6px; background: var(--a-line); }
body.admin-app .ws-profile-head { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--a-line); margin-bottom: 4px; }
body.admin-app .kebab-btn.is-open { background: var(--a-sunken); color: var(--a-ink); }

body.admin-app .ws-search-results { overflow: hidden auto; max-height: 400px; }
body.admin-app .ws-search-results a {
  display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--a-line);
  text-decoration: none; color: var(--a-ink);
}
body.admin-app .ws-search-results a:last-child { border-bottom: 0; }
body.admin-app .ws-search-results a:hover { background: var(--a-sunken); }
body.admin-app .ws-search-results .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- page toolbar + body --- */
body.admin-app .page-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px clamp(18px, 2.2vw, 32px) 0; flex-shrink: 0;
  max-width: 1480px; width: 100%; margin: 0 auto;
}
body.admin-app .page-toolbar[hidden] { display: none; }
body.admin-app .page-toolbar-desc { margin: 0; font-size: 0.9rem; color: var(--a-ink-3); }
body.admin-app .page-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

body.admin-app .workspace-body {
  flex: 1; min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto;
  padding: clamp(20px, 2.2vw, 30px) clamp(18px, 2.2vw, 32px) 64px;
  display: flex; flex-direction: column; gap: 24px;
}
body.admin-app .workspace-body--fixed { min-height: 0; }
body.admin-app .workspace-body > * { animation: aRise 420ms var(--a-ease) both; }
body.admin-app .workspace-body > *:nth-child(2) { animation-delay: 50ms; }
body.admin-app .workspace-body > *:nth-child(3) { animation-delay: 100ms; }
body.admin-app .workspace-body > *:nth-child(4) { animation-delay: 150ms; }
body.admin-app .workspace-body > *:nth-child(n+5) { animation-delay: 190ms; }
@keyframes aRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   4. SURFACES - panel, stat, list rows
   ------------------------------------------------------------------------ */
body.admin-app .panel {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius);
  box-shadow: var(--a-shadow-1);
}
body.admin-app .panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--a-line);
}
body.admin-app .panel-title {
  margin: 0; display: flex; align-items: baseline; gap: 10px;
  font-family: 'Poppins', sans-serif; font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; color: var(--a-ink);
}
body.admin-app .panel-title small { font-size: 0.78rem; font-weight: 500; color: var(--a-ink-3); letter-spacing: 0; }
body.admin-app .panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.admin-app .panel-body { padding: 24px; }
body.admin-app .panel-body.flush { padding: 0; }
body.admin-app .panel-grid { display: grid; gap: 24px; }

body.admin-app .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 16px; }
body.admin-app .stats-grid-sm { grid-template-columns: repeat(auto-fit, minmax(176px, 280px)); justify-content: start; }
body.admin-app .stat-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px;
  background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: var(--a-shadow-1);
  transition: transform 220ms var(--a-ease), box-shadow 220ms var(--a-ease), border-color 220ms var(--a-ease);
}
body.admin-app .stat-card:hover { transform: translateY(-2px); box-shadow: var(--a-shadow-2); border-color: var(--a-line-strong); }
body.admin-app .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.admin-app .stat-label { font-size: 0.8rem; font-weight: 500; color: var(--a-ink-3); letter-spacing: 0.01em; }
body.admin-app .stat-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--a-gold-soft); color: var(--a-gold); }
body.admin-app .stat-icon.rose, body.admin-app .stat-icon.gold { background: var(--a-gold-soft); color: var(--a-gold); }
body.admin-app .stat-icon.green { background: var(--a-ok-soft); color: var(--a-ok); }
body.admin-app .stat-icon.lav { background: var(--a-warn-soft); color: var(--a-warn); }
body.admin-app .stat-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'Poppins', sans-serif; font-size: 1.9rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--a-ink);
}
body.admin-app .stat-sub { margin-top: -8px; font-size: 0.78rem; font-weight: 500; color: var(--a-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.admin-app .stat-delta { font-size: 0.78rem; font-weight: 600; }
body.admin-app .stat-delta.up { color: var(--a-ok); }
body.admin-app .stat-delta.down { color: var(--a-bad); }

body.admin-app .split-view { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
body.admin-app .split-view.rev { grid-template-columns: 380px minmax(0, 1fr); }
body.admin-app .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; }
body.admin-app .filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body.admin-app .line-items-table input, body.admin-app .line-items-table select { min-width: 90px; }
body.admin-app .line-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.admin-app .thumb { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; background: var(--a-sunken) center/cover no-repeat; display: inline-block; }

body.admin-app .list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 24px;
  color: inherit; text-decoration: none; border-bottom: 1px solid var(--a-line);
  transition: background-color 160ms var(--a-ease);
}
body.admin-app .list-row:last-child { border-bottom: 0; }
body.admin-app a.list-row:hover, body.admin-app .list-row:hover { background: var(--a-raised); }
body.admin-app .list-row > svg:first-child, body.admin-app .list-row > span:first-child {
  flex: none; width: 38px; height: 38px; padding: 9px; display: grid; place-items: center;
  border-radius: 12px; background: var(--a-gold-soft); color: var(--a-gold);
}

body.admin-app .card-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600;
  color: var(--a-gold); text-decoration: none;
}
body.admin-app .card-link:hover { text-decoration: underline; text-underline-offset: 3px; }

body.admin-app .meter { --pct: 0%; height: 8px; border-radius: 999px; background: var(--a-sunken); overflow: hidden; position: relative; margin-top: 8px; }
body.admin-app .meter::after { content: ""; position: absolute; inset: 0; width: var(--pct); border-radius: inherit; background: var(--a-ink); transition: width 420ms var(--a-ease); }
body.admin-app .meter-shop::after { background: var(--a-gold-fill); }

/* ---------------------------------------------------------------------------
   5. CONTROLS - buttons, inputs, badges, tabs, segmented
   ------------------------------------------------------------------------ */
body.admin-app .btn {
  height: 42px; padding: 0 18px; gap: 8px; border-radius: 12px;
  font-family: 'Poppins', sans-serif; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.005em; text-transform: none;
  border: 1px solid transparent;
  transition: background-color 160ms var(--a-ease), border-color 160ms var(--a-ease), color 160ms var(--a-ease), box-shadow 160ms var(--a-ease), transform 160ms var(--a-ease);
}
body.admin-app .btn:active { transform: scale(0.98); }
body.admin-app .btn-sm { height: 36px; padding: 0 14px; font-size: 0.8rem; border-radius: 10px; }
body.admin-app .btn-lg { height: 50px; padding: 0 28px; font-size: 0.92rem; border-radius: 14px; }
body.admin-app .btn-primary, body.admin-app .btn-gold {
  background: var(--a-ink); background-image: none; color: var(--color-on-primary);
  border-color: var(--a-ink); box-shadow: var(--a-shadow-1);
}
body.admin-app .btn-primary:hover, body.admin-app .btn-gold:hover { background: var(--a-ink-2); border-color: var(--a-ink-2); box-shadow: var(--a-shadow-2); }
body.admin-app .btn-secondary { background: var(--a-gold-soft); color: var(--a-gold); border: 1px solid var(--a-gold-line); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.admin-app .btn-secondary:hover { background: var(--a-gold-soft); border-color: var(--a-gold-fill); }
body.admin-app .btn-outline { background: var(--a-surface); color: var(--a-ink); border: 1px solid var(--a-line-strong); box-shadow: var(--a-shadow-1); }
body.admin-app .btn-outline:hover { background: var(--a-raised); border-color: var(--a-ink-3); color: var(--a-ink); }
body.admin-app .btn-ghost { background: transparent; color: var(--a-ink-2); }
body.admin-app .btn-ghost:hover { background: var(--a-sunken); color: var(--a-ink); }
body.admin-app .btn-danger { background: var(--a-bad); color: #fff; border-color: var(--a-bad); }
body.admin-app .btn-danger:hover { filter: brightness(0.94); }
body.admin-app .btn-success { background: var(--a-ok); color: #fff; border-color: var(--a-ok); }
body.admin-app .btn[disabled], body.admin-app .btn[aria-disabled="true"] { opacity: 0.45; }

body.admin-app .icon-btn { width: 40px; height: 40px; border-radius: 12px; color: var(--a-ink-2); }
body.admin-app .icon-btn:hover { background: var(--a-sunken); color: var(--a-ink); }

body.admin-app .field > label, body.admin-app .field-label, body.admin-app .label { font-size: 0.8rem; font-weight: 600; color: var(--a-ink-2); letter-spacing: 0.005em; }
body.admin-app .input, body.admin-app .select, body.admin-app .textarea {
  min-height: 44px; padding: 10px 14px; border-radius: 12px;
  background-color: var(--a-surface); color: var(--a-ink); border: 1px solid var(--a-line-strong);
  font-family: 'Poppins', sans-serif; font-size: 0.9rem;
  transition: border-color 160ms var(--a-ease), box-shadow 160ms var(--a-ease), background-color 160ms var(--a-ease);
}
body.admin-app .input::placeholder, body.admin-app .textarea::placeholder { color: var(--a-ink-3); opacity: 0.75; }
body.admin-app .input:hover, body.admin-app .select:hover, body.admin-app .textarea:hover { border-color: var(--a-ink-3); }
body.admin-app .input:focus, body.admin-app .select:focus, body.admin-app .textarea:focus {
  outline: none; border-color: var(--a-gold-fill); box-shadow: 0 0 0 4px var(--a-gold-soft);
}
body.admin-app .input[aria-invalid="true"], body.admin-app .select[aria-invalid="true"] { border-color: var(--a-bad); box-shadow: 0 0 0 4px var(--a-bad-soft); }
body.admin-app .select {
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23857a6a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
body.admin-app .hint { font-size: 0.78rem; color: var(--a-ink-3); }
body.admin-app .field-error { font-size: 0.78rem; color: var(--a-bad); font-weight: 500; }
body.admin-app .form-section-title {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a-gold);
  padding-bottom: 8px; border-bottom: 1px solid var(--a-line); margin-bottom: 8px;
}
body.admin-app .search-box .input { padding-left: 42px; }
body.admin-app .search-box svg { color: var(--a-ink-3); }
body.admin-app .th-select { width: auto; max-width: 180px; min-height: 0; padding: 6px 30px 6px 12px; font-size: 0.78rem; border-radius: 8px; }

body.admin-app .badge {
  gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1.5;
  text-transform: none;
}
body.admin-app .badge-neutral { background: var(--a-sunken); color: var(--a-ink-2); }
body.admin-app .badge-success { background: var(--a-ok-soft); color: var(--a-ok); }
body.admin-app .badge-warning { background: var(--a-warn-soft); color: var(--a-warn); }
body.admin-app .badge-danger { background: var(--a-bad-soft); color: var(--a-bad); }
body.admin-app .badge-info { background: var(--a-sunken); color: var(--a-ink-2); }
body.admin-app .badge-gold { background: var(--a-gold-soft); color: var(--a-gold); }
body.admin-app .badge-success-light, body.admin-app .badge-warning-light, body.admin-app .badge-gold-light { opacity: 0.9; }

body.admin-app .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--a-line); overflow-x: auto; scrollbar-width: none; }
body.admin-app .tab {
  padding: 12px 16px; font-size: 0.86rem; font-weight: 600; color: var(--a-ink-3);
  border: 0; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
  transition: color 160ms var(--a-ease), border-color 160ms var(--a-ease);
}
body.admin-app .tab:hover { color: var(--a-ink); }
body.admin-app .tab[aria-selected="true"] { color: var(--a-ink); border-bottom-color: var(--a-gold-fill); }

body.admin-app .chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--a-line-strong); background: var(--a-surface);
  font-size: 0.78rem; font-weight: 600; color: var(--a-ink-2);
}
body.admin-app .chip:hover { border-color: var(--a-ink-3); color: var(--a-ink); }
body.admin-app .chip[aria-pressed="true"], body.admin-app .chip.active { background: var(--a-ink); border-color: var(--a-ink); color: var(--color-on-primary); }

body.admin-app .seg-control { background: var(--a-sunken); border: 1px solid var(--a-line); border-radius: 12px; padding: 3px; gap: 2px; }
body.admin-app .seg-btn { padding: 7px 14px; border-radius: 9px; font-size: 0.8rem; font-weight: 600; color: var(--a-ink-3); transition: background-color 160ms var(--a-ease), color 160ms var(--a-ease), box-shadow 160ms var(--a-ease); }
body.admin-app .seg-btn:hover { color: var(--a-ink); }
body.admin-app .seg-btn[aria-pressed="true"] { background: var(--a-surface); color: var(--a-ink); box-shadow: var(--a-shadow-1), inset 0 0 0 1px var(--a-line); }

body.admin-app .banner { border-radius: 14px; padding: 14px 18px; font-size: 0.875rem; }
body.admin-app .banner-info { background: var(--a-sunken); color: var(--a-ink-2); border: 1px solid var(--a-line); }
body.admin-app .banner-success { background: var(--a-ok-soft); color: var(--a-ok); border: 1px solid transparent; }
body.admin-app .banner-warning { background: var(--a-warn-soft); color: var(--a-warn); border: 1px solid transparent; }
body.admin-app .banner-error { background: var(--a-bad-soft); color: var(--a-bad); border: 1px solid transparent; }

body.admin-app .empty-state { padding: 56px 24px; color: var(--a-ink-3); }
body.admin-app .empty-state svg { color: var(--a-gold-fill); opacity: 0.85; }
body.admin-app .empty-state h3 { font-family: var(--a-serif); font-size: 1.5rem; font-weight: 600; color: var(--a-ink); margin-bottom: 6px; }
body.admin-app .skeleton { background: linear-gradient(90deg, var(--a-sunken) 25%, var(--a-raised) 50%, var(--a-sunken) 75%); background-size: 200% 100%; }
body.admin-app .divider { background: var(--a-line); }
body.admin-app .timeline { border-left-color: var(--a-line); }
body.admin-app .timeline li::before { background: var(--a-gold-fill); box-shadow: 0 0 0 3px var(--a-surface); }

/* ---------------------------------------------------------------------------
   6. DATA TABLES
   ------------------------------------------------------------------------ */
body.admin-app .table-wrap {
  border: 1px solid var(--a-line); border-radius: 14px; background: var(--a-surface);
  overflow-x: auto; overflow-y: hidden; box-shadow: none;
}
body.admin-app .panel > .table-wrap, body.admin-app .panel-body.flush > .table-wrap { border: 0; border-radius: 0; }
body.admin-app .data-table { font-size: 0.875rem; }
body.admin-app .data-table thead th {
  position: sticky; top: 0; z-index: 2; padding: 12px 10px;
  background: var(--a-raised); border-bottom: 1px solid var(--a-line);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a-ink-3);
  white-space: nowrap;
}
body.admin-app .data-table td { padding: 13px 10px; border-bottom: 1px solid var(--a-line); color: var(--a-ink); }
body.admin-app .data-table tbody tr:last-child td { border-bottom: 0; }
body.admin-app .data-table tbody tr:hover { background: var(--a-raised); }
body.admin-app .data-table .row-total td { background: var(--a-raised); font-weight: 600; }
body.admin-app .data-table th:first-child, body.admin-app .data-table td:first-child { padding-left: 22px; }
body.admin-app .data-table th:last-child, body.admin-app .data-table td:last-child { padding-right: 22px; }
body.admin-app .data-table td.num-cell, body.admin-app .data-table th.num-cell { font-variant-numeric: tabular-nums; }
body.admin-app .data-table td.financial { font-weight: 600; }
body.admin-app #bk-table th, body.admin-app #bk-table td { white-space: nowrap; }
body.admin-app .data-table .truncate { max-width: 146px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------------------------------------------------------------------------
   7. DIALOGS, SHEETS, TOASTS
   ------------------------------------------------------------------------ */
body.admin-app .dialog-backdrop, body.admin-app .sheet-backdrop { background: var(--a-scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.admin-app .dialog {
  background: var(--a-surface); -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid var(--a-line); border-radius: 22px; box-shadow: var(--a-shadow-3);
}
body.admin-app .dialog-header { background: var(--a-surface); border-bottom: 1px solid var(--a-line); border-radius: 22px 22px 0 0; padding: 20px 28px; }
body.admin-app .dialog-title { font-family: var(--a-serif); font-size: 1.6rem; font-weight: 600; letter-spacing: 0; }
body.admin-app .dialog-body { padding: 24px 28px; }
body.admin-app .dialog-footer { background: var(--a-surface); border-top: 1px solid var(--a-line); border-radius: 0 0 22px 22px; padding: 16px 28px; }
body.admin-app .sheet { background: var(--a-surface); -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid var(--a-line); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: var(--a-shadow-3); }
body.admin-app .sheet-grabber { background: var(--a-line-strong); }

body.admin-app .toast { background: var(--a-ink); color: var(--color-on-primary); border-radius: 14px; box-shadow: var(--a-shadow-3); font-size: 0.875rem; padding: 14px 18px; }
body.admin-app .toast.success { background: var(--a-ok); color: #fff; }
body.admin-app .toast.error { background: var(--a-bad); color: #fff; }
body.admin-app .toast.gold { background: var(--a-gold-fill); color: #17140F; }
html[data-admin-theme="dark"] body.admin-app .toast.success, html[data-admin-theme="dark"] body.admin-app .toast.error { color: #14110D; }

/* ---------------------------------------------------------------------------
   8. CALENDAR
   ------------------------------------------------------------------------ */
body.admin-app .calendar-layout { align-items: start; }
body.admin-app .cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; text-align: center; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--a-ink-3); }
body.admin-app .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
body.admin-app .cal-cell {
  aspect-ratio: 1; min-height: 46px; border: 1px solid transparent; border-radius: 12px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 4px 2px;
  transition: background-color 160ms var(--a-ease), border-color 160ms var(--a-ease);
}
body.admin-app .cal-pad { pointer-events: none; }
body.admin-app .cal-cell:not(.cal-pad):hover { background: var(--a-sunken); }
body.admin-app .cal-today { border-color: var(--a-gold-fill); }
body.admin-app .cal-cell.cal-selected { background: var(--a-ink); border-color: var(--a-ink); color: var(--color-on-primary); }
body.admin-app .cal-cell.cal-selected .dot { background: currentColor; }
body.admin-app .cal-num { font-size: 0.86rem; font-weight: 600; line-height: 1; }
body.admin-app .cal-dots { display: flex; gap: 3px; }
body.admin-app .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--a-ink-3); display: inline-block; }
body.admin-app .dot-info { background: var(--a-ink-2); }
body.admin-app .dot-success { background: var(--a-ok); }
body.admin-app .dot-warning { background: var(--a-warn); }
body.admin-app .dot-danger { background: var(--a-bad); }

/* ---------------------------------------------------------------------------
   9. DASHBOARD - hero, bento, chart, schedule
   ------------------------------------------------------------------------ */
body.admin-app .home-hero {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: clamp(26px, 3vw, 40px);
  border-radius: 24px; border: 1px solid var(--a-line);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--a-gold-soft) 0%, transparent 58%),
    linear-gradient(180deg, var(--a-surface), var(--a-raised));
  box-shadow: var(--a-shadow-1);
}
body.admin-app .home-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  border: 1px solid var(--a-gold-line); box-shadow: 0 0 0 36px rgba(184, 147, 63, 0.05), 0 0 0 78px rgba(184, 147, 63, 0.035); pointer-events: none;
}
body.admin-app .home-hero > * { position: relative; z-index: 1; }
body.admin-app .home-hero-eyebrow { margin: 0 0 8px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--a-gold); }
body.admin-app .home-hero h2 { margin: 0; font-family: var(--a-serif); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 600; line-height: 1.05; color: var(--a-ink); }
body.admin-app .home-hero p.lede { margin: 12px 0 0; max-width: 52ch; font-size: 0.95rem; line-height: 1.6; color: var(--a-ink-2); }
body.admin-app .home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

body.admin-app .rev-chart { display: flex; flex-direction: column; gap: 16px; }
body.admin-app .rev-legend { display: flex; justify-content: flex-end; gap: 18px; font-size: 0.78rem; color: var(--a-ink-3); }
body.admin-app .rev-legend span { display: inline-flex; align-items: center; gap: 7px; }
body.admin-app .rev-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
body.admin-app .rev-legend i.treatment { background: var(--a-ink); }
body.admin-app .rev-legend i.shop { background: var(--a-gold-fill); }
body.admin-app .rev-columns { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 180px; padding-bottom: 26px; position: relative; border-bottom: 1px solid var(--a-line);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--a-line) calc(25% - 1px), var(--a-line) 25%); background-size: 100% calc(100% - 26px); background-repeat: no-repeat; }
body.admin-app .rev-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; border-radius: 10px; transition: background-color 160ms var(--a-ease); }
body.admin-app .rev-day:hover { background: var(--a-gold-soft); }
body.admin-app .rev-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; }
body.admin-app .rev-bars i { display: block; width: 14px; min-height: 2px; border-radius: 5px 5px 0 0; transition: height 520ms var(--a-ease); }
body.admin-app .rev-bars i.treatment { background: var(--a-ink); }
body.admin-app .rev-bars i.shop { background: var(--a-gold-fill); }
body.admin-app .rev-day > span { position: absolute; bottom: -22px; font-size: 0.72rem; font-weight: 500; color: var(--a-ink-3); }
body.admin-app .rev-empty { text-align: center; padding: 6px 0 2px; font-size: 0.84rem; color: var(--a-ink-3); }

body.admin-app .fin-rows { display: flex; flex-direction: column; gap: 14px; }
body.admin-app .fin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
body.admin-app .fin-row .label { color: var(--a-ink-3); }
body.admin-app .fin-row .value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--a-ink); }
body.admin-app .fin-row.total { padding-top: 14px; border-top: 1px dashed var(--a-line-strong); }
body.admin-app .fin-row.total .label { color: var(--a-ink); font-weight: 600; }
body.admin-app .fin-row.total .value { font-size: 1.2rem; }
body.admin-app .fin-row.total .value.neg { color: var(--a-bad); }
body.admin-app .fin-row.total .value.pos { color: var(--a-ok); }

body.admin-app .agenda { display: flex; flex-direction: column; }
body.admin-app .agenda-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--a-line); text-decoration: none; color: inherit; transition: background-color 160ms var(--a-ease); }
body.admin-app .agenda-row:last-child { border-bottom: 0; }
body.admin-app .agenda-row:hover { background: var(--a-raised); }
body.admin-app .agenda-time { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--a-ink); }
body.admin-app .agenda-who { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.admin-app .agenda-what { font-size: 0.8rem; color: var(--a-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

body.admin-app .mini-cal { display: flex; flex-direction: column; }
body.admin-app .mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
body.admin-app .mini-cal-dow { font-size: 0.66rem; text-align: center; color: var(--a-ink-3); font-weight: 600; letter-spacing: 0.08em; padding-bottom: 6px; }
body.admin-app .mini-cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; font-size: 0.82rem; font-weight: 600; color: var(--a-ink); }
body.admin-app .mini-cal-day.is-next { color: var(--a-ink-3); opacity: 0.6; font-weight: 500; }
body.admin-app .mini-cal-day.is-today { background: var(--a-ink); color: var(--color-on-primary); }
body.admin-app .mini-cal-overflow { position: absolute; top: -6px; right: 0; font-size: 0.6rem; font-weight: 700; color: var(--a-gold); }
body.admin-app .cal-nav--month { display: flex; align-items: center; gap: 8px; }
body.admin-app .cal-nav--month p { margin: 0; font-weight: 600; font-size: 0.875rem; min-width: 11ch; text-align: center; }
body.admin-app .cal-arrow { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-surface); color: var(--a-ink); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0; transition: background-color 160ms var(--a-ease); }
body.admin-app .cal-arrow:hover { background: var(--a-sunken); }
body.admin-app .calendar-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; font-size: 0.78rem; color: var(--a-ink-3); }
body.admin-app .calendar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--a-gold-fill); }


/* dashboard bento grid: 3 tracks, panels span 2 or 3 */
body.admin-app .home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
body.admin-app .home-grid .span-2 { grid-column: span 2; }
body.admin-app .home-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  body.admin-app .home-grid { grid-template-columns: 1fr; }
  body.admin-app .home-grid .span-2, body.admin-app .home-grid .span-3 { grid-column: auto; }
}

/* ---------------------------------------------------------------------------
   10. RESPONSIVE - drawer < 1024px, bottom nav + More sheet < 768px
   ------------------------------------------------------------------------ */
/* The phone bottom menu is styled only up to 768px, so it must be hidden from 769px up (tablets show the menu button instead). */
@media (min-width: 769px) { body.admin-app .admin-bottom-nav { display: none; } }
@media (max-width: 900px) { body.admin-app .calendar-layout, body.admin-app .split-view, body.admin-app .split-view.rev { grid-template-columns: 1fr !important; } }

@media (max-width: 1024px) {
  body.admin-app .ws-menu-btn { display: inline-flex; }
  body.admin-app .admin-shell { grid-template-columns: 1fr; }
  body.admin-app .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(84vw, 312px);
    background: var(--a-surface); border-right: 1px solid var(--a-line); border-radius: 0 24px 24px 0;
    transform: translateX(-104%); transition: transform 300ms var(--a-ease);
    z-index: calc(var(--z-nav) + 20); box-shadow: var(--a-shadow-3);
  }
  body.admin-app .admin-shell.is-nav-open .admin-sidebar { transform: none; }
  body.admin-app .page-toolbar-desc { display: none; }
  body.admin-app .admin-scrim { position: fixed; inset: 0; z-index: calc(var(--z-nav) + 10); background: var(--a-scrim); }
  body.admin-app .admin-scrim[hidden] { display: none; }
}

@media (max-width: 768px) {
  body.admin-app .workspace-header { padding: 12px 16px; gap: 10px; min-height: 64px; }
  body.admin-app .ws-search, body.admin-app .ws-user-name { display: none; }
  body.admin-app .ws-user { border-left: 0; padding-left: 0; margin-left: 0; }
  body.admin-app .ws-title h1 { font-size: 1.4rem; }
  body.admin-app .workspace-body { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); gap: 18px; }
  body.admin-app .page-toolbar { padding: 14px 16px 0; }
  body.admin-app .ws-actions .btn:not(.btn-primary) { display: none; }
  body.admin-app .panel-head { padding: 16px 18px; }
  body.admin-app .panel-body { padding: 18px; }
  body.admin-app .list-row, body.admin-app .agenda-row { padding-left: 18px; padding-right: 18px; }
  body.admin-app .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.admin-app .stat-card { padding: 16px; gap: 10px; }
  body.admin-app .stat-value { font-size: 1.45rem; }
  body.admin-app .home-hero { border-radius: 20px; align-items: flex-start; }
  body.admin-app .th-select { max-width: 140px; }
  body.admin-app .panel-tools { width: 100%; min-width: 0; }
  body.admin-app .panel-tools .seg-control { width: 100%; }
  body.admin-app .panel-tools .search-box { flex: 1 1 100%; min-width: 0; }

  body.admin-app .admin-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-nav);
    background: var(--a-glass); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--a-line);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); min-height: 64px;
  }
  body.admin-app .admin-bottom-nav a, body.admin-app .admin-bottom-nav-more {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 48px; padding: 6px 0; border-radius: 14px; background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: 0.66rem; font-weight: 600; color: var(--a-ink-3); text-decoration: none;
  }
  body.admin-app .admin-bottom-nav a[aria-current="page"] { color: var(--a-ink); background: var(--a-surface); box-shadow: inset 0 0 0 1px var(--a-line); }
  body.admin-app .admin-bottom-nav a[aria-current="page"] svg { color: var(--a-gold); }

  /* dense tables become compact cards on phones */
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid),
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody,
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tr,
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) td { display: block; width: 100%; min-width: 0; }
  body.admin-app .table-wrap:has(.data-table:not(.line-items-table):not(.calendar-grid)) { border: 0; background: transparent; overflow: visible; }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) thead { display: none; }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody tr {
    margin: 0 0 12px; padding: 16px; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: var(--a-shadow-1);
  }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody td { padding: 4px 0; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody td:first-child { font-size: 1rem; font-weight: 600; padding-bottom: 8px; }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody td.financial,
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody td.num-cell.financial { justify-content: flex-end; font-size: 1.05rem; font-weight: 600; padding-top: 6px; }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid) tbody td:last-child:not(:first-child) { justify-content: flex-end; padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--a-line); }
  body.admin-app .data-table:not(.line-items-table):not(.calendar-grid):not(#bk-table) tbody td:not(:first-child):not(.financial):not(.num-cell.financial):not(:last-child) { display: none; }
  /* phone card: customer, treatment, when, amount, status, actions (ref + payment method live in the detail view) */
  body.admin-app #bk-table th:nth-child(1), body.admin-app #bk-table td:nth-child(1),
  body.admin-app #bk-table th:nth-child(6), body.admin-app #bk-table td:nth-child(6) { display: none; }
  body.admin-app #bk-table td:nth-child(2) { font-size: 1rem; padding-bottom: 6px; }
  body.admin-app #bk-table td:nth-child(2) .truncate { font-weight: 600; max-width: 60vw; }
  body.admin-app #bk-table td:nth-child(3) .truncate { max-width: 55vw; }
  body.admin-app #bk-table td:nth-child(7) { padding-top: 6px; }
}

/* mobile quick actions + More sheet */
body.admin-app .m-quick-actions { display: none; }
body.admin-app .m-qa-title { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-ink-3); margin: 2px 2px 10px; font-weight: 600; }
body.admin-app .m-qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
body.admin-app .m-qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 6px; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 16px; text-decoration: none; color: var(--a-ink); font-size: 0.72rem; font-weight: 600; box-shadow: var(--a-shadow-1); }
body.admin-app .m-qa svg { width: 20px; height: 20px; color: var(--a-gold); }
@media (max-width: 768px) { body.admin-app .m-quick-actions { display: block; } }
@media (max-width: 380px) { body.admin-app .m-qa-grid { grid-template-columns: repeat(2, 1fr); } }

body.admin-app .ws-more-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-nav) + 30);
  background: var(--a-surface); border: 1px solid var(--a-line); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--a-shadow-3);
  max-height: 82vh; overflow: auto; transform: translateY(100%); transition: transform 300ms var(--a-ease);
}
body.admin-app .ws-more-sheet[hidden] { display: none; }
body.admin-app .ws-more-sheet:not([hidden]) { transform: none; }
body.admin-app .ws-more-head { display: flex; align-items: center; padding: 4px 4px 12px; }
body.admin-app .ws-more-head b { font-family: var(--a-serif); font-size: 1.4rem; font-weight: 600; }
body.admin-app .ws-more-search { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; margin-bottom: 14px; background: var(--a-sunken); border: 1px solid var(--a-line); border-radius: 14px; color: var(--a-ink-3); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
body.admin-app .ws-more-search svg { color: var(--a-gold); }
body.admin-app .ws-more-group { margin-bottom: 18px; }
body.admin-app .ws-more-group h4 { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-ink-3); margin: 4px 4px 10px; font-weight: 600; }
body.admin-app .ws-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
body.admin-app .ws-more-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; background: var(--a-raised); border: 1px solid var(--a-line); border-radius: 14px; text-decoration: none; color: var(--a-ink); font-size: 0.72rem; font-weight: 600; text-align: center; }
body.admin-app .ws-more-link svg { width: 20px; height: 20px; color: var(--a-gold); }
body.admin-app .ws-more-scrim { position: fixed; inset: 0; z-index: calc(var(--z-nav) + 25); background: var(--a-scrim); }
body.admin-app .ws-more-scrim[hidden] { display: none; }

/* ---------------------------------------------------------------------------
   11. SIGN-IN
   ------------------------------------------------------------------------ */
body.admin-login { min-height: 100vh; }
body.admin-login .login-shell { min-height: 100vh; display: grid; place-items: center; padding: clamp(16px, 4vw, 56px); background:
  radial-gradient(90% 80% at 0% 0%, var(--a-gold-soft), transparent 55%), var(--a-canvas); }
body.admin-login .login-card {
  width: min(100%, 1080px); min-height: 620px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  overflow: hidden; border: 1px solid var(--a-line); border-radius: 28px; background: var(--a-surface); box-shadow: var(--a-shadow-3);
}
body.admin-login .login-story {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; overflow: hidden;
  padding: clamp(36px, 5vw, 64px); color: #F6F2EA;
  background: linear-gradient(150deg, rgba(20, 17, 13, 0.9), rgba(52, 44, 34, 0.86)), url('../img/clinic-interior-2.jpg') center/cover;
}
body.admin-login .login-story::after { content: ""; position: absolute; right: -90px; bottom: -110px; width: 320px; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(221, 184, 101, 0.35); box-shadow: 0 0 0 38px rgba(221, 184, 101, 0.06), 0 0 0 84px rgba(221, 184, 101, 0.04); pointer-events: none; }
body.admin-login .login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 420px; }
body.admin-login .login-brand .logo-mark { width: 56px; height: 56px; padding: 7px; border-radius: 16px; background: #F6F2EA; border: 1px solid rgba(255, 255, 255, 0.4); overflow: hidden; display: grid; place-items: center; }
body.admin-login .login-kicker { margin: 10px 0 0; color: #DDB865; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; }
body.admin-login .login-title { max-width: 11ch; margin: 0; color: #F6F2EA; font-family: var(--a-serif); font-size: clamp(2.6rem, 4.6vw, 4.2rem); font-weight: 500; line-height: 0.98; }
body.admin-login .login-sub { max-width: 34ch; margin: 0; color: rgba(246, 242, 234, 0.78); font-size: 0.98rem; line-height: 1.7; }
body.admin-login .login-story-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: rgba(246, 242, 234, 0.66); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
body.admin-login .login-story-note span { width: 32px; height: 1px; background: #DDB865; }
body.admin-login .login-story-note p { margin: 0; }
body.admin-login .login-access { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 64px); background: var(--a-surface); }
body.admin-login .login-access-head { margin-bottom: 30px; }
body.admin-login .login-form-intro { display: flex; align-items: center; gap: 10px; color: var(--a-gold); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
body.admin-login .login-form-intro::before { content: ""; width: 24px; height: 1px; background: currentColor; }
body.admin-login .login-access-head h2 { margin: 12px 0 10px; color: var(--a-ink); font-family: var(--a-serif); font-size: 2.6rem; font-weight: 600; line-height: 1; }
body.admin-login .login-access-head > p:last-child { margin: 0; color: var(--a-ink-3); font-size: 0.9rem; line-height: 1.6; }
body.admin-login .login-field label { display: block; margin-bottom: 8px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a-ink-3); font-weight: 600; }
body.admin-login .login-field .input { height: 54px; padding-inline: 16px; border-radius: 14px; }
body.admin-login .login-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; width: 100%; border-radius: 14px; letter-spacing: 0.02em; }
body.admin-login .login-submit span { line-height: 0; transition: transform 200ms var(--a-ease); }
body.admin-login .login-submit:hover span { transform: translateX(4px); }
body.admin-login .login-submit:disabled { opacity: 0.7; cursor: wait; }
body.admin-login .login-return { margin: 26px 0 0; text-align: center; }
body.admin-login .login-return a { color: var(--a-ink-3); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
body.admin-login .login-return a:hover { color: var(--a-ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 1024px) {
  body.admin-login .login-story { display: none; }
  body.admin-login .login-card { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
  body.admin-login .login-access { padding: 44px 30px; }
}
@media (max-width: 480px) {
  body.admin-login .login-access { padding: 32px 20px; }
  body.admin-login .login-access-head h2 { font-size: 2.1rem; }
}

/* ---------------------------------------------------------------------------
   12. MOTION PREFERENCES
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  body.admin-app *, body.admin-app *::before, body.admin-app *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}

/* compact in-table actions so a status + primary action + kebab fit one row */
body.admin-app .data-table .row-actions { justify-content: flex-end; gap: 6px; }
body.admin-app .data-table .row-actions .btn-sm { height: 34px; padding: 0 12px; font-size: 0.78rem; }

/* week view (calendar page) */
body.admin-app .week-grid { gap: 10px; }
body.admin-app .week-day { border-radius: 16px; background: var(--a-surface); border-color: var(--a-line); min-height: 260px; }
body.admin-app .week-day.cal-selected { background: var(--a-gold-soft); color: var(--a-ink); border-color: var(--a-gold-line); }
body.admin-app .week-day.today { box-shadow: inset 0 0 0 2px var(--a-gold-fill); }
body.admin-app .week-head { padding: 12px 14px; border-bottom-color: var(--a-line); }
body.admin-app .week-body { padding: 8px; gap: 8px; }
body.admin-app .wk-bk { background: var(--a-surface); color: var(--a-ink); border-color: var(--a-line); border-left-width: 3px; border-radius: 10px; padding: 8px 10px; font-size: 0.76rem; box-shadow: var(--a-shadow-1); }
body.admin-app .wk-bk:hover { background: var(--a-raised); border-color: var(--a-line-strong); }
body.admin-app .stat-icon.info, body.admin-app .stat-icon.blue { background: var(--a-sunken); color: var(--a-ink-2); }
body.admin-app .stat-icon.red, body.admin-app .stat-icon.danger { background: var(--a-bad-soft); color: var(--a-bad); }
body.admin-app .stat-icon.amber, body.admin-app .stat-icon.warning { background: var(--a-warn-soft); color: var(--a-warn); }
body.admin-app .stat-icon.accent { background: var(--a-gold-soft); color: var(--a-gold); }
body.admin-app .stat-icon.bad { background: var(--a-bad-soft); color: var(--a-bad); }
body.admin-app .stat-icon.good, body.admin-app .stat-icon.success { background: var(--a-ok-soft); color: var(--a-ok); }
body.admin-app .stat-icon.neutral { background: var(--a-sunken); color: var(--a-ink-2); }
/* long money values step down in size so a KPI is never truncated */
body.admin-app .stat-value--lg { font-size: 1.5rem; }
body.admin-app .stat-value--xl { font-size: 1.2rem; letter-spacing: -0.03em; }
@media (max-width: 768px) { body.admin-app .stat-value--lg { font-size: 1.2rem; } body.admin-app .stat-value--xl { font-size: 1.02rem; } }

/* ---------------------------------------------------------------------------
   PHONE CATALOGUE LIST (inventory, products, services) + floating action button
   ------------------------------------------------------------------------ */
body.admin-app .only-mobile { display: none; }
@media (max-width: 768px) {
  body.admin-app .only-mobile { display: block; }
  body.admin-app .only-desktop { display: none !important; }
}
body.admin-app .item-list { display: flex; flex-direction: column; }
body.admin-app .item-row {
  position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 16px 18px; border-bottom: 1px solid var(--a-line); cursor: pointer; text-align: left;
  transition: background-color 160ms var(--a-ease);
}
body.admin-app .item-row:last-child { border-bottom: 0; }
body.admin-app .item-row:active, body.admin-app .item-row:hover { background: var(--a-raised); }
body.admin-app .item-thumb { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--a-sunken); display: block; flex-shrink: 0; }
body.admin-app .item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.admin-app .item-thumb .item-ph { position: absolute; inset: 0; display: none; place-items: center; color: var(--a-ink-3); font-style: normal; }
body.admin-app .item-thumb.is-empty .item-ph { display: grid; }
body.admin-app .item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body.admin-app .item-name { font-size: 0.98rem; font-weight: 600; line-height: 1.3; color: var(--a-ink); overflow-wrap: anywhere; }
body.admin-app .item-meta { font-size: 0.86rem; color: var(--a-ink-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
body.admin-app .item-line { font-size: 0.86rem; color: var(--a-ink-3); font-variant-numeric: tabular-nums; }
body.admin-app .item-line b { color: var(--a-ink); font-weight: 600; }
body.admin-app .item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
body.admin-app .item-stat { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--a-ink); font-variant-numeric: tabular-nums; }
body.admin-app .item-stat.tone-danger { color: var(--a-bad); }
body.admin-app .item-stat.tone-warning { color: var(--a-warn); }
body.admin-app .item-stat.tone-success { color: var(--a-ok); }
body.admin-app .item-act { flex-shrink: 0; }
@media (max-width: 380px) { body.admin-app .item-row { grid-template-columns: 64px minmax(0, 1fr); } body.admin-app .item-thumb { width: 64px; height: 64px; } }

body.admin-app .fab {
  position: fixed; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 70;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  background: var(--a-gold-fill); color: #17140F; box-shadow: var(--a-shadow-3);
  transition: transform 160ms var(--a-ease), box-shadow 160ms var(--a-ease);
}
body.admin-app .fab:active { transform: scale(0.94); }
@media (max-width: 768px) { body.admin-app .fab.only-mobile { display: inline-flex; } }

/* desktop: the KPI cards sit in one row (they shrink to fit; they never wrap onto a second row) */
@media (min-width: 769px) {
  body.admin-app .stats-grid:not(.stats-grid-sm) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow-x: auto; }
  body.admin-app .stats-grid:not(.stats-grid-sm) > .stat-card { min-width: 150px; }
}
/* phones: KPI cards become one swipe strip so the working list starts high on the screen */
@media (max-width: 768px) {
  body.admin-app .stats-grid:not(.stats-grid-sm) {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 0 16px;
  }
  body.admin-app .stats-grid:not(.stats-grid-sm)::-webkit-scrollbar { display: none; }
  body.admin-app .stats-grid:not(.stats-grid-sm) > .stat-card { flex: 0 0 168px; scroll-snap-align: start; padding: 14px; gap: 8px; }
  body.admin-app .stats-grid:not(.stats-grid-sm) .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
  body.admin-app .stats-grid:not(.stats-grid-sm) .stat-label { font-size: 0.74rem; line-height: 1.25; }
  body.admin-app .stats-grid:not(.stats-grid-sm) .stat-value { font-size: 1.3rem; }
  body.admin-app .stats-grid:not(.stats-grid-sm) .stat-value--lg { font-size: 1.1rem; }
  body.admin-app .stats-grid:not(.stats-grid-sm) .stat-value--xl { font-size: 0.98rem; }
  body:has(.fab.only-mobile) .assistant-fab { right: auto !important; left: 16px !important; }
}

/* ---------------------------------------------------------------------------
   DIALOGS ON PHONES - every form opens as a full-width bottom sheet, fields
   stack in one column, nothing is wider than the screen
   ------------------------------------------------------------------------ */
@media (max-width: 640px) {
  body.admin-app .dialog-backdrop { align-items: flex-end; padding: 0; }
  body.admin-app .dialog { width: 100% !important; max-width: 100% !important; max-height: 94vh; max-height: 94dvh; border-radius: 24px 24px 0 0; animation: aSheetUp 280ms var(--a-ease); }
  body.admin-app .dialog-header { padding: 16px 18px; border-radius: 24px 24px 0 0; }
  body.admin-app .dialog-title { font-size: 1.4rem; }
  body.admin-app .dialog-body { padding: 18px; }
  body.admin-app .dialog-footer { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); gap: 10px; }
  body.admin-app .dialog-footer .btn { flex: 1 1 auto; }
  body.admin-app .dialog .form-grid { grid-template-columns: 1fr; }
  body.admin-app .dialog [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  body.admin-app .dialog [style*="width:6cm"] { width: 100% !important; }
  body.admin-app .dialog .row { flex-wrap: wrap; }
  body.admin-app .dialog .row > .field, body.admin-app .dialog .row > .grow { flex: 1 1 100%; min-width: 0; }
  body.admin-app .dialog .field, body.admin-app .dialog .input, body.admin-app .dialog .select, body.admin-app .dialog .textarea { min-width: 0; max-width: 100%; }
  body.admin-app .dialog .input, body.admin-app .dialog .select, body.admin-app .dialog .textarea { font-size: 16px; } /* stops iOS zooming into fields */
  body.admin-app .dialog .table-wrap { overflow-x: auto; }
  @keyframes aSheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* invoice / estimate builder: each line becomes a small card */
  body.admin-app .dialog .line-items-table { min-width: 0 !important; width: 100%; border: 0 !important; }
  body.admin-app .dialog .line-items-table thead { display: none; }
  body.admin-app .dialog .line-items-table, body.admin-app .dialog .line-items-table tbody { display: block; }
  body.admin-app .dialog .line-items-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; padding: 14px; margin-bottom: 12px; border: 1px solid var(--a-line); border-radius: 16px; background: var(--a-raised); }
  body.admin-app .dialog .line-items-table td { display: block; padding: 0; border: 0; min-width: 0; }
  body.admin-app .dialog .line-items-table td:first-child { grid-column: 1 / -1; padding-right: 40px; }
  body.admin-app .dialog .line-items-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-ink-3); }
  body.admin-app .dialog .line-items-table td.li-line { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; font-size: 1.05rem; font-weight: 600; text-align: right; border-top: 1px dashed var(--a-line); padding-top: 10px; }
  body.admin-app .dialog .line-items-table td.li-line::before { margin: 0; }
  body.admin-app .dialog .line-items-table td.li-act { position: absolute; top: 8px; right: 8px; }
}

/* ---------- upload-only media field ---------- */
.mf { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--border, #d8cfbe); border-radius: 16px; }
.mf-preview { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: rgba(127,127,127,.12); }
.mf-preview img, .mf-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-empty { font-size: .7rem; opacity: .6; }
.mf-body { min-width: 0; display: grid; gap: 8px; }
.mf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mf-status { display: block; overflow-wrap: anywhere; }
@media (max-width: 480px) { .mf-preview { width: 72px; height: 72px; } }

/* Figures on the summary cards are never cut short: they shrink to fit instead of ending in "...". */
body.admin-app .stat-value { overflow: visible; text-overflow: clip; white-space: nowrap; font-size: clamp(1.2rem, 0.9rem + 0.9vw, 1.9rem); }
body.admin-app .stat-value--lg { font-size: clamp(1.1rem, 0.8rem + 0.8vw, 1.5rem); }
body.admin-app .stat-value--xl { font-size: clamp(1rem, 0.75rem + 0.7vw, 1.25rem); }
body.admin-app .stat-card { min-width: 0; }
body.admin-app .stat-sub { white-space: normal; text-overflow: clip; }

/* money in summary cards: the whole figure, with a small TZS above it */
body.admin-app .stat-cur { display: block; font: 600 0.62rem/1 var(--font-body, inherit); letter-spacing: 0.16em; color: var(--a-ink-faint, var(--admin-ink-soft, #6B6256)); margin-bottom: 5px; }
body.admin-app .stat-value { overflow-wrap: anywhere; }

/* staff cards on a phone: the role and status line stays visible, and empty-table messages are never cut off */
.staff-meta-sm { display: none; }
@media (max-width: 768px) { body.admin-app .staff-meta-sm { display: block; } }
body.admin-app td[colspan] > .empty-state, .pos-app td[colspan] > .empty-state { position: sticky; left: 0; max-width: calc(100vw - 70px); margin-inline: auto; }
@media (max-width: 768px) {
  body.admin-app .seg-control, body.admin-app .rpt-seg { max-width: 100%; }
}

/* tables marked m-cards: on a phone every column shows, each with its heading (the label is copied from the table header) */
@media (max-width: 768px) {
  body.admin-app .data-table.m-cards tbody td:not(:first-child):not(:last-child) { display: flex !important; justify-content: space-between !important; align-items: baseline; gap: 12px; padding: 3px 0; font-size: .86rem; text-align: right; }
  body.admin-app .data-table.m-cards tbody td[data-label]:not(:first-child):not(:last-child)::before { content: attr(data-label); color: var(--a-ink-faint, #6b6256); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; text-align: left; flex: 0 0 auto; }
  body.admin-app .data-table.m-cards tbody td:empty { display: none !important; }
  body.admin-app .data-table.m-cards tbody td.financial, body.admin-app .data-table.m-cards tbody td.num-cell { font-size: .9rem !important; font-weight: 600; padding-top: 3px !important; }
}

/* ---- clean-up pass: money cards, search boxes and toolbars look the same on every page ---- */
body.admin-app .stat-card { gap: 10px; padding: 18px 20px; }
body.admin-app .stat-sub { margin-top: -2px; }
body.admin-app .stats-grid { margin-bottom: 20px; }
body.admin-app .fd-search { position: relative; }
body.admin-app .fd-search .input, body.admin-app .fd-search .pos-input { height: 40px; padding-left: 40px; width: 100%; font-size: 0.86rem; }
body.admin-app .fd-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--a-ink-3); pointer-events: none; }
@media (min-width: 769px) {
  body.admin-app .panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  body.admin-app .panel-tools .search-box { flex: 1 1 280px; min-width: 240px; max-width: 380px; }
  body.admin-app .panel-tools .fd-search { flex: 0 1 300px; min-width: 200px; }
  body.admin-app .panel-tools:has(.fd-search) { flex-wrap: nowrap; }
}
body.admin-app .kebab-btn { flex: none; }

/* one title per page: the header bar names it, the page does not repeat it */
body.admin-app .page-toolbar-desc { display: none; }
body.admin-app .page-toolbar { padding-top: 14px; }

/* ---- Filters: one tidy bar. Count on the left, search and filter on the right, same height, never ragged ---- */
body.admin-app .workspace-body > :empty { display: none; }
body.admin-app .panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 14px 18px; }
body.admin-app .panel-title { margin: 0 auto 0 0; }
body.admin-app .panel-tools { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; gap: 10px; min-width: 0; }
body.admin-app .panel-tools .seg-control { flex: 0 1 auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0; }
body.admin-app .panel-tools .seg-control::-webkit-scrollbar { display: none; }
body.admin-app .panel-tools .search-box { flex: 1 1 240px; min-width: 200px; max-width: 340px; margin: 0; }
body.admin-app .panel-tools .search-box .input, body.admin-app .fd-search .input { height: 40px; }
body.admin-app .fd-tools { flex-wrap: nowrap; gap: 10px; padding: 12px 16px; }
body.admin-app .fd-count { margin-right: auto; white-space: nowrap; }
body.admin-app .fd-tools .fd-search { flex: 0 1 340px; min-width: 160px; }
@media (max-width: 640px) {
  body.admin-app .panel-head { padding: 12px 14px; }
  body.admin-app .panel-title { flex: 0 0 100%; }
  body.admin-app .panel-tools { flex: 0 0 100%; justify-content: stretch; }
  body.admin-app .panel-tools .seg-control, body.admin-app .panel-tools .search-box { flex: 1 1 100%; max-width: none; }
  body.admin-app .fd-tools { flex-wrap: wrap; padding: 12px 14px; }
  body.admin-app .fd-count { flex: 0 0 100%; margin: 0; font-size: .8rem; color: var(--a-ink-3); }
  body.admin-app .fd-tools .fd-search { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 640px) {
  body.admin-app .panel-tools:has(.fd-search) { flex-wrap: nowrap; }
  body.admin-app .panel-tools .fd-search { flex: 1 1 0; min-width: 0; max-width: none; }
  body.admin-app .panel-tools .fd-filter { flex: 0 0 auto; }
}

/* a stat card that is a link, and a panel that opens its page */
body.admin-app a.stat-card { text-decoration: none; color: inherit; cursor: pointer; }
body.admin-app a.stat-card:focus-visible { outline: 2px solid var(--a-gold, #B8933F); outline-offset: 2px; }
body.admin-app .panel--link { cursor: pointer; }
body.admin-app .panel--link:hover { border-color: var(--a-line-strong); }

/* number boxes have no up/down arrows: they cause wrong amounts. Type the number. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; display: none; }

/* the cards at the top of a page: never narrower than 200px; the ones that do not fit step aside (see fitSummary in admin-shell.js) */
@media (min-width: 769px) {
  body.admin-app .page-summary > .stat-card { min-width: 200px; }
}
body.admin-app .page-summary > .stat-card.stat-fit-hidden { display: none !important; }

/* Tablet and small screens: the search is a round icon; pressing it opens the field in the same place (the title makes room). */
@media (max-width: 1100px) {
  body.admin-app .ws-search, body.admin-app .ws-search:not(:focus-within) { flex: 0 0 44px; min-width: 44px; width: 44px; display: block; }
  body.admin-app .ws-search .input { width: 100%; padding: 0; color: transparent; cursor: pointer; }
  body.admin-app .ws-search .input::placeholder { color: transparent; }
  body.admin-app .ws-kbd { display: none; }
  body.admin-app .ws-search-icon { left: 0; width: 44px; height: 44px; top: 0; transform: none; justify-content: center; align-content: center; }
  body.admin-app .ws-search:focus-within { flex: 0 1 min(340px, 62vw); width: auto; min-width: 44px; }
  body.admin-app .ws-search:focus-within .input { padding: 0 16px 0 44px; color: var(--a-ink); cursor: text; }
  body.admin-app .ws-search:focus-within .input::placeholder { color: var(--a-ink-3); }
}

/* The phone header: menu, the page name, search, notifications and the account: nothing else, evenly spaced. The light/dark switch lives in the account menu. */
@media (max-width: 768px) {
  body.admin-app .workspace-header { padding: 8px 12px; gap: 4px; min-height: 58px; align-items: center; }
  body.admin-app .ws-menu-btn { width: 40px; height: 40px; flex: none; margin-right: 2px; }
  body.admin-app .ws-title { flex: 1 1 auto; min-width: 0; gap: 0; }
  body.admin-app .ws-eyebrow { font-size: 0.58rem; letter-spacing: 0.16em; line-height: 1.2; }
  body.admin-app .ws-title h1 { font-size: 1.2rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.admin-app .ws-search, body.admin-app .ws-search:not(:focus-within) { flex: 0 0 40px; min-width: 40px; width: 40px; }
  body.admin-app .ws-search .input { height: 40px; }
  body.admin-app .ws-search-icon { width: 40px; height: 40px; }
  body.admin-app .ws-search:focus-within { position: absolute; left: 12px; right: 12px; top: 9px; width: auto; z-index: 30; }
  body.admin-app .ws-search:focus-within .input { box-shadow: var(--a-shadow-2, 0 6px 20px rgba(0,0,0,.14)); }
  body.admin-app .ws-actions { gap: 0; flex: none; }
  body.admin-app .ws-actions [data-theme-toggle] { display: none; }
  body.admin-app .ws-actions .icon-btn { width: 40px; height: 40px; }
  body.admin-app .avatar-btn { width: 36px; height: 36px; margin-left: 4px; }
}
@media (max-width: 768px) {
  /* the search is a plain icon like the bell; it opens a field across the header when pressed */
  body.admin-app .ws-search:not(:focus-within) .input { background: transparent; border-color: transparent; box-shadow: none; }
}


/* ===== Phone: the same website look, with only what is needed every day =====
   Setup, team, content, system, documents and reports are for a tablet or a computer. A phone keeps the one main action on a page. */
@media (max-width: 768px) {
  /* what a phone does not offer: menu entries and buttons marked for bigger screens, and the extras beside the main action */
  body.admin-app .only-tablet, body.admin-app .only-desktop { display: none !important; }
  body.admin-app .page-toolbar-actions .btn:not(.btn-primary) { display: none !important; }
  body.admin-app [data-fb="export"], body.admin-app [data-fb="refresh"], body.admin-app [data-fb="funnel"] { display: none !important; }

  /* the bottom bar: one line per name */
  body.admin-app .admin-bottom-nav a, body.admin-app .admin-bottom-nav button { white-space: nowrap; font-size: 0.68rem; }

  /* Home: only today's work */
  body.admin-app [aria-labelledby="week-title"], body.admin-app [aria-labelledby="split-title"],
  body.admin-app [aria-labelledby="goal-title"], body.admin-app .setup-card, body.admin-app .home-tip,
  body.admin-app .panel--link { display: none !important; }
  body.admin-app .home-hero-actions { grid-template-columns: 1fr 1fr; }
  body.admin-app .home-hero-actions .btn { min-width: 0; padding: 0 6px; white-space: normal; line-height: 1.15; text-align: center; font-size: 0.78rem; }
  body.admin-app .panel-title small { display: block; margin: 2px 0 0; font-size: 0.74rem; font-weight: 500; }
  body.admin-app .panel-head { flex-wrap: wrap; row-gap: 6px; }
  body.admin-app .agenda-row, body.admin-app .agenda .row { gap: 10px; }
  body.admin-app [aria-labelledby="act-title"] h3, body.admin-app [aria-labelledby="act-title"] .t { font-size: 0.95rem; line-height: 1.3; }
}

/* Phone: the first card on Home has one button, Open front desk. */
@media (max-width: 768px) {
  body.admin-app .home-hero-actions .btn:not(:first-child) { display: none !important; }
  body.admin-app .home-hero-actions { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body.admin-app .home-hero-actions { display: grid; width: 100%; }
  body.admin-app .home-hero-actions .btn:first-child { width: 100%; white-space: nowrap; font-size: 0.9rem; min-height: 44px; }
}
@media (max-width: 768px) {
  /* the one button of the first card: full width, tall, centred, a clear gold button */
  body.admin-app .home-hero { gap: 16px; }
  body.admin-app .home-hero-actions .btn:first-child {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 20px; border-radius: 16px;
    font-size: 0.98rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; text-align: center;
    box-shadow: 0 8px 20px rgba(184, 137, 63, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }
  body.admin-app .home-hero-actions .btn:first-child svg { width: 19px; height: 19px; flex: none; }
}
@media (max-width: 768px) {
  body.admin-app .home-hero { flex-direction: column; align-items: stretch; }
  body.admin-app .home-hero-actions { width: 100%; }
}
@media (max-width: 768px) {
  body.admin-app .home-hero .home-hero-actions { grid-template-columns: minmax(0, 1fr) !important; }
  body.admin-app .home-hero .home-hero-actions .btn:first-child { width: 100% !important; max-width: none !important; }
}

/* Phone Home: the two money cards only (shop and treatment cash). */
@media (max-width: 768px) {
  body.admin-app.page-home .stats-rail { display: none !important; }
}

/* Phone Home: after the two money cards, only the revenue bars (no activity list, no quick actions, no chart switches). */
@media (max-width: 768px) {
  body.admin-app.page-home [aria-labelledby="act-title"], body.admin-app.page-home .m-quick-actions, body.admin-app.page-home [aria-labelledby="sched-title"] { display: none !important; }
  body.admin-app [aria-labelledby="rev-title"] .panel-head .row, body.admin-app [aria-labelledby="rev-title"] .fx-seg { display: none !important; }
  body.admin-app [aria-labelledby="rev-title"] .fx-chart { height: 200px; }
}

/* Phone bottom bar: a floating dock. Rounded, soft glass, a raised gold tab for the page you are on. */
@media (max-width: 768px) {
  body.admin-app .admin-bottom-nav {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; min-height: 66px; gap: 2px;
    border: 1px solid var(--a-line); border-radius: 26px;
    background: color-mix(in srgb, var(--a-surface, #fff) 92%, transparent);
    box-shadow: 0 12px 32px rgba(23, 20, 15, 0.18), 0 2px 6px rgba(23, 20, 15, 0.06);
  }
  body.admin-app .admin-bottom-nav a, body.admin-app .admin-bottom-nav .admin-bottom-nav-more {
    min-height: 54px; border-radius: 20px; gap: 3px; font-size: 0.66rem; letter-spacing: 0.01em; font-weight: 600; color: var(--a-ink-3) !important;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  }
  body.admin-app .admin-bottom-nav a svg, body.admin-app .admin-bottom-nav .admin-bottom-nav-more svg { width: 22px; height: 22px; stroke-width: 1.9; }
  body.admin-app .admin-bottom-nav a[aria-current="page"] {
    color: #5a4010 !important; background: linear-gradient(180deg, #f6e7c4, #e9d199);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 12px rgba(184, 137, 63, 0.3);
  }
  body.admin-app .admin-bottom-nav a[aria-current="page"] svg { color: #8a6519; }
  :root[data-admin-theme="dark"] body.admin-app .admin-bottom-nav a[aria-current="page"] { color: #f0cf8a !important; background: rgba(209, 162, 87, 0.22); box-shadow: inset 0 0 0 1px rgba(209, 162, 87, 0.35); }
  :root[data-admin-theme="dark"] body.admin-app .admin-bottom-nav a[aria-current="page"] svg { color: #f0cf8a; }
}

/* Phone: no scroll bar down the side of the page (it still scrolls). */
@media (max-width: 768px) {
  html, body { scrollbar-width: none; -ms-overflow-style: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
@media (max-width: 768px) {
  /* the assistant button sits clear above the floating bottom bar */
  body.admin-app .assistant-fab, body.admin-app #aa-fab { bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
  body.admin-app .workspace-body { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
}

/* ===== Phone: the first screen is one screen (no scrolling), every page can be pulled down to refresh, and the top cards are one swipe row ===== */
@media (max-width: 768px) {
  /* our own pull-to-refresh replaces the browser's, and the page springs back like an app */
  html { overscroll-behavior-y: contain; }

  /* Home scrolls like every other page: the greeting, the two cash cards, then the revenue card at its full size (nothing squeezed to fit one screen) */
  body.admin-app.page-home .workspace-body { gap: 14px; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  body.admin-app.page-home [aria-labelledby="rev-title"] .fx-chart { height: 230px; }
  body.admin-app.page-home [aria-labelledby="rev-title"] .fx-rev-total { font-size: 1.35rem; }

  /* the cards at the top of a page: one row, swipe sideways, the first four only */
  html body.admin-app .stats-grid, html body.admin-app .stats-grid.is-slim, html body.admin-app .stats-grid.is-slim.page-summary, html body.admin-app .page-summary {
    display: flex !important; flex-wrap: nowrap !important; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; scroll-padding: 0 16px;
  }
  body.admin-app .stats-grid::-webkit-scrollbar, body.admin-app .page-summary::-webkit-scrollbar { display: none; }
  html body.admin-app .stats-grid > *, html body.admin-app .page-summary > .stat-card { flex: 0 0 calc((100% - 32px - 12px) / 2) !important; min-width: 0 !important; max-width: none; scroll-snap-align: start; }
  body.admin-app .stats-grid > :nth-child(n+5), body.admin-app .page-summary > :nth-child(n+5) { display: none !important; }

  /* the pull-down refresh */
  .pull-ind { position: fixed; top: 70px; left: 50%; width: 38px; height: 38px; margin-left: -19px; z-index: 60; display: grid; place-items: center; border-radius: 50%; background: var(--a-surface, #fff); box-shadow: 0 6px 18px rgba(23, 20, 15, 0.18); color: var(--a-gold, #8a6519); opacity: 0; pointer-events: none; transform: scale(0.6); }
  .pull-ind svg { width: 20px; height: 20px; }
  .pull-ind.is-spin svg { animation: pullSpin 0.7s linear infinite; }
  @keyframes pullSpin { to { transform: rotate(360deg); } }
}
@media (max-width: 768px) {
  html body.admin-app .stats-grid, html body.admin-app .stats-grid.is-slim, html body.admin-app .page-summary {
    overflow-x: auto !important; overflow-y: hidden !important; max-width: calc(100% + 32px); min-width: 0; margin-left: -16px !important; margin-right: -16px !important;
    padding-left: 16px !important; padding-right: 16px !important; grid-template-columns: none !important;
  }
  html body.admin-app .workspace-body > * { min-width: 0; max-width: 100%; }
  html body.admin-app .workspace-body > .stats-grid, html body.admin-app .workspace-body > .page-summary { max-width: calc(100% + 32px); }
}
@media (max-width: 768px) {
  /* closer spacing: the card row sits right above the list */
  html body.admin-app .workspace-body { gap: 12px; }
  html body.admin-app .stats-grid, html body.admin-app .stats-grid.is-slim, html body.admin-app .page-summary { padding-bottom: 4px !important; margin-bottom: 0 !important; }
  html body.admin-app .stats-cash { margin-top: 0; }
}
@media (max-width: 768px) {
  /* a toolbar whose buttons are all left off the phone takes no room, and a panel sits right under what is above it */
  html body.admin-app #fin-page-bar:not(:has(.fin-period)):not(:has(.fin-custom-row)) { display: none; }
  html body.admin-app .workspace-body > .panel, html body.admin-app .workspace-body > section.panel { margin-top: 0 !important; }
}
@media (max-width: 768px) {
  /* every card in the row is the same height and its label has room for two lines, so the figures line up from card to card */
  html body.admin-app .stats-grid, html body.admin-app .page-summary { align-items: stretch; }
  html body.admin-app .stats-grid > .stat-card, html body.admin-app .page-summary > .stat-card { display: flex !important; flex-direction: column; justify-content: flex-start; gap: 8px; min-height: 122px; padding: 14px; }
  html body.admin-app .stats-grid .stat-top, html body.admin-app .page-summary .stat-top { min-height: 38px; align-items: flex-start; gap: 8px; }
  html body.admin-app .stats-grid .stat-label, html body.admin-app .page-summary .stat-label { font-size: 0.78rem; line-height: 1.25; }
  html body.admin-app .stats-grid .stat-value, html body.admin-app .page-summary .stat-value { margin-top: auto; }
}
@media (max-width: 768px) {
  /* Home shows the shop and the treatment cashbook only */
  html body.admin-app.page-home .stats-cash > :nth-child(n+3) { display: none !important; }
  html body.admin-app.page-home .stats-cash { overflow-x: hidden !important; }
  html body.admin-app.page-home .stats-cash > .stat-card { flex: 1 1 0 !important; }
}
@media (max-width: 768px) {
  html body.admin-app .stats-grid > .stat-card, html body.admin-app .page-summary > .stat-card { align-items: stretch; text-align: left; }
  html body.admin-app .stats-grid .stat-top, html body.admin-app .page-summary .stat-top { width: 100%; justify-content: space-between; }
  html body.admin-app .stats-grid .stat-label, html body.admin-app .page-summary .stat-label { text-align: left; flex: 1; min-width: 0; }
  html body.admin-app .stats-grid .stat-value, html body.admin-app .page-summary .stat-value { align-self: flex-start; text-align: left; }
}
@media (max-width: 768px) {
  /* in the card view of a list the row's action buttons (the three dots) sit at the right edge */
  html body.admin-app td:last-child { justify-content: flex-end; }
  html body.admin-app td:last-child > .row, html body.admin-app td:last-child > .row-actions, html body.admin-app td:last-child > .menu-wrap { margin-left: auto; justify-content: flex-end; width: 100%; }
}

/* Phone, catalog pages: the page's main button is at the top, so the round add button, the "What customers see" preview and other panel extras are left off */
@media (max-width: 768px) {
  html body.admin-app .fab.only-mobile, html body.admin-app #pr-fab { display: none !important; }
  html body.admin-app #pr-view-btn { display: none !important; }
  html body:has(.fab.only-mobile) .assistant-fab { right: 16px !important; left: auto !important; }
}
@media (max-width: 768px) {
  /* card lists: the accounting "stream" tag is not needed on a phone */
  html body.admin-app .data-table tbody td[data-label="Stream"]:not(#a):not(#b):not(#c) { display: none !important; }
}

/* Phone, Packages: a light card. The name and picture, the price and whether it is active, and the edit pencil. The details are for the full site. */
@media (max-width: 768px) {
  html body.admin-app .data-table.m-cards tbody tr[data-pk] { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px 16px; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td { display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td::before { display: none !important; content: none !important; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Items"], html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Stream"] { display: none !important; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Package"] { grid-column: 1; grid-row: 1; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Package"] .text-xs { display: none; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Package"] b { font-size: 1rem; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Actions"] { grid-column: 2; grid-row: 1; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Price"] { grid-column: 1; grid-row: 2; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Price"] .text-xs { display: none; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Price"] b { font-size: 1.05rem; }
  html body.admin-app .data-table.m-cards tbody tr[data-pk] > td[data-label="Status"] { grid-column: 2; grid-row: 2; justify-self: end; }
}

/* Phone: an empty list says one short line, without the long explanation and without a box inside the box */
@media (max-width: 768px) {
  html body.admin-app .empty-state p { display: none; }
  html body.admin-app .panel .empty-state { border: 0 !important; box-shadow: none !important; background: none !important; padding: 28px 16px; min-height: 0; }
  html body.admin-app .empty-state h3 { font-size: 1.05rem; margin: 6px 0 0; }
}
@media (max-width: 768px) {
  html body.admin-app tbody tr:has(.empty-state) { border: 0 !important; box-shadow: none !important; background: none !important; margin: 0 !important; }
}

/* Phone, Finance overview: "Needs attention" is one short line per item */
@media (max-width: 768px) {
  html body.admin-app .list-row:has([data-i1], [data-i2], [data-i3]) .text-xs.muted { display: none; }
  html body.admin-app .list-row:has([data-i1], [data-i2], [data-i3]) { padding: 12px 14px; gap: 12px; align-items: center; }
  html body.admin-app .list-row:has([data-i1], [data-i2], [data-i3]) b { font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
}

/* Phone: Cashbooks ledger entries as one tidy row (date + description left, amount + balance right) */
@media (max-width: 768px) {
  html body.admin-app #cb-rows > tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 11px 14px !important; }
  html body.admin-app #cb-rows > tr > td { display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left; }
  html body.admin-app #cb-rows > tr > td::before { display: none !important; content: none !important; }
  html body.admin-app #cb-rows > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: .72rem; color: var(--a-ink-faint, #6b6256); }
  html body.admin-app #cb-rows > tr > td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html body.admin-app #cb-rows > tr > td:nth-child(4), html body.admin-app #cb-rows > tr > td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; font-size: .95rem !important; font-weight: 600; }
  html body.admin-app #cb-rows > tr > td:nth-child(6) { grid-column: 2; grid-row: 2; text-align: right; font-size: .72rem !important; font-weight: 400 !important; color: var(--a-ink-faint, #6b6256); }
  html body.admin-app #cb-rows > tr > td:empty { display: none !important; }
}

/* Phone: cards that sit inside a panel stay inside it (no bleed past the panel edge) */
@media (max-width: 768px) {
  html body.admin-app .panel-body > .stats-grid, html body.admin-app .panel-body > .stats-grid.is-slim {
    margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; max-width: 100% !important; scroll-padding: 0;
  }
  html body.admin-app .panel-body > .stats-grid > .stat-card { min-height: 0; padding: 12px 14px; gap: 6px; }
  html body.admin-app .panel-body > .stats-grid .stat-label { font-size: .74rem; }
}
@media (max-width: 768px) { html body.admin-app #cb-meta { display: none !important; } }

/* Phone: Expenses list rows as one tidy line */
@media (max-width: 768px) {
  html body.admin-app #ex-rows > tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 11px 14px !important; }
  html body.admin-app #ex-rows > tr > td { display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left; }
  html body.admin-app #ex-rows > tr > td::before { display: none !important; content: none !important; }
  html body.admin-app #ex-rows > tr > td[data-label="Date"] { grid-column: 1; grid-row: 2; font-size: .72rem; color: var(--a-ink-faint, #6b6256); }
  html body.admin-app #ex-rows > tr > td[data-label="Category"] { grid-column: 1; grid-row: 1; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html body.admin-app #ex-rows > tr > td[data-label="Paid from"] { grid-column: 2; grid-row: 2; text-align: right; font-size: .72rem; color: var(--a-ink-faint, #6b6256); }
  html body.admin-app #ex-rows > tr > td[data-label="Amount"] { grid-column: 2; grid-row: 1; text-align: right; font-size: .95rem !important; font-weight: 600; border: 0 !important; }
  html body.admin-app #ex-rows > tr > td:empty { display: none !important; }
}

/* Phone: treatment rows keep name, group, price and status only (no menu number) */
@media (max-width: 768px) {
  html body.admin-app.page-website-services .item-row .item-main > .item-line:nth-child(4) { display: none !important; }
  html body.admin-app.page-website-services .item-row .item-foot { margin-top: 2px; }
}

/* Phone: Invoices and Payments rows as compact cards (number + date, who, amount/balance, status, menu) */
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr[data-inv], html body.admin-app #pm-rows > tr[data-pm] { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 12px 14px !important; }
  html body.admin-app #inv-rows > tr[data-inv] > td, html body.admin-app #pm-rows > tr[data-pm] > td { display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left; }
  html body.admin-app #inv-rows > tr[data-inv] > td::before, html body.admin-app #pm-rows > tr[data-pm] > td::before { display: none !important; content: none !important; }
  /* invoices */
  html body.admin-app #inv-rows > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
  html body.admin-app #inv-rows > tr > td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: .86rem; }
  html body.admin-app #inv-rows > tr > td:nth-child(2) .text-xs { display: none; }
  html body.admin-app #inv-rows > tr > td:nth-child(3), html body.admin-app #inv-rows > tr > td:nth-child(4), html body.admin-app #inv-rows > tr > td:nth-child(5) { display: none !important; }
  html body.admin-app #inv-rows > tr > td:nth-child(6) { grid-column: 2; grid-row: 1; text-align: right; font-size: .95rem !important; font-weight: 600; }
  html body.admin-app #inv-rows > tr > td:nth-child(7) { grid-column: 2; grid-row: 2; justify-self: end; }
  html body.admin-app #inv-rows > tr > td:nth-child(8) { grid-column: 3; grid-row: 1 / span 2; }
  /* payments */
  html body.admin-app #pm-rows > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
  html body.admin-app #pm-rows > tr > td:nth-child(2), html body.admin-app #pm-rows > tr > td:nth-child(5) { display: none !important; }
  html body.admin-app #pm-rows > tr > td:nth-child(3) { grid-column: 1; grid-row: 2; font-size: .86rem; }
  html body.admin-app #pm-rows > tr > td:nth-child(3) .text-xs { display: none; }
  html body.admin-app #pm-rows > tr > td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-size: .95rem !important; font-weight: 600; }
  html body.admin-app #pm-rows > tr > td:nth-child(6) { grid-column: 2; grid-row: 2; justify-self: end; }
  html body.admin-app #pm-rows > tr > td:nth-child(6) .text-xs { display: none; }
  html body.admin-app #pm-rows > tr > td:nth-child(7) { grid-column: 3; grid-row: 1 / span 2; }
}

/* Phone: list rows inside a box are plain rows with a hairline between them (no card inside the card) */
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr[data-inv], html body.admin-app #pm-rows > tr[data-pm], html body.admin-app #ex-rows > tr, html body.admin-app #cb-rows > tr {
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; margin: 0 !important;
    border-bottom: 1px solid var(--a-line, rgba(60, 45, 20, .12)) !important; padding: 12px 16px !important;
  }
  html body.admin-app #inv-rows > tr:last-child, html body.admin-app #pm-rows > tr:last-child, html body.admin-app #ex-rows > tr:last-child, html body.admin-app #cb-rows > tr:last-child { border-bottom: 0 !important; }
}

/* Filters sit in the page's top row, beside the main button */
html body.admin-app .page-toolbar { flex-wrap: wrap; align-items: center; gap: 10px; }
html body.admin-app .page-toolbar > #fin-page-bar.in-toolbar { margin: 0 0 0 auto !important; padding: 0 !important; flex: 0 1 auto; min-width: 0; }
@media (max-width: 768px) {
  html body.admin-app .page-toolbar > #fin-page-bar.in-toolbar { margin: 0 !important; }
}

/* Phone: who it is for comes first and bold; the number and date are the quiet second line */
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr > td:nth-child(1), html body.admin-app #pm-rows > tr > td:nth-child(1) { grid-row: 2 !important; display: flex !important; gap: 8px; align-items: baseline; flex-wrap: wrap; color: var(--a-ink-faint, #6b6256); }
  html body.admin-app #inv-rows > tr > td:nth-child(1) b, html body.admin-app #pm-rows > tr > td:nth-child(1) b { font-weight: 500 !important; font-size: .74rem !important; letter-spacing: 0; }
  html body.admin-app #inv-rows > tr > td:nth-child(1) .text-xs, html body.admin-app #pm-rows > tr > td:nth-child(1) .text-xs { font-size: .74rem !important; }
  html body.admin-app #inv-rows > tr > td:nth-child(2), html body.admin-app #pm-rows > tr > td:nth-child(3) { grid-row: 1 !important; font-size: 1rem !important; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr > td:nth-child(1), html body.admin-app #pm-rows > tr > td:nth-child(1) { flex-wrap: nowrap !important; white-space: nowrap; overflow: hidden; }
  html body.admin-app #inv-rows > tr > td:nth-child(1) .text-xs, html body.admin-app #pm-rows > tr > td:nth-child(1) .text-xs { margin: 0 !important; font-weight: 400 !important; }
}
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr > td:nth-child(1), html body.admin-app #pm-rows > tr > td:nth-child(1) { flex-direction: column !important; align-items: flex-start !important; gap: 1px !important; flex-wrap: nowrap !important; }
}

/* Phone: the amount sits in the top-right corner of the row; the menu tucks in at the bottom-right */
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr[data-inv], html body.admin-app #pm-rows > tr[data-pm] { grid-template-columns: minmax(0, 1fr) auto !important; position: relative; }
  html body.admin-app #inv-rows > tr > td:nth-child(8) { position: absolute !important; right: 8px; bottom: 6px; grid-column: auto; grid-row: auto; }
  html body.admin-app #inv-rows > tr > td:nth-child(7) { margin-right: 34px; }
  html body.admin-app #inv-rows > tr[data-inv] { padding-bottom: 14px !important; }
  html body.admin-app #pm-rows > tr > td:nth-child(7) { grid-column: 1 / -1 !important; grid-row: 3 !important; justify-self: end; }
  html body.admin-app #pm-rows > tr > td:nth-child(7):not(:has(*)) { display: none !important; }
}

/* Phone invoices: customer | status | price on the top line; number and date underneath */
@media (max-width: 768px) {
  html body.admin-app #inv-rows > tr[data-inv] { grid-template-columns: minmax(0, 1fr) auto auto !important; column-gap: 10px; }
  html body.admin-app #inv-rows > tr > td:nth-child(2) { grid-column: 1 !important; grid-row: 1 !important; }
  html body.admin-app #inv-rows > tr > td:nth-child(7) { grid-column: 2 !important; grid-row: 1 !important; margin: 0 !important; justify-self: end; white-space: nowrap; }
  html body.admin-app #inv-rows > tr > td:nth-child(6) { grid-column: 3 !important; grid-row: 1 !important; }
  html body.admin-app #inv-rows > tr > td:nth-child(1) { grid-column: 1 / span 2 !important; grid-row: 2 !important; }
}

/* Desktop Invoices list: even columns, headings lined up with their content, status right beside the actions */
@media (min-width: 769px) {
  html body.admin-app #inv-table { table-layout: fixed; width: 100%; }
  html body.admin-app #inv-table th:nth-child(1) { width: 17%; }
  html body.admin-app #inv-table th:nth-child(2) { width: 21%; }
  html body.admin-app #inv-table th:nth-child(3) { width: 11%; }
  html body.admin-app #inv-table th:nth-child(4), html body.admin-app #inv-table th:nth-child(5), html body.admin-app #inv-table th:nth-child(6) { width: 12%; }
  html body.admin-app #inv-table th:nth-child(7) { width: 12%; }
  html body.admin-app #inv-table th:nth-child(8) { width: 56px; }
  html body.admin-app #inv-table th, html body.admin-app #inv-table td { padding-left: 14px; padding-right: 14px; vertical-align: middle; }
  html body.admin-app #inv-table th:nth-child(7), html body.admin-app #inv-table td:nth-child(7) { text-align: right; padding-right: 4px; }
  html body.admin-app #inv-table td:nth-child(8) { padding-left: 0; padding-right: 14px; }
  html body.admin-app #inv-table th:nth-child(8) { padding-left: 0; padding-right: 14px; }
  html body.admin-app #inv-table td:nth-child(2) .truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 769px) {
  html body.admin-app #inv-table th:nth-child(1) { width: 16%; }
  html body.admin-app #inv-table th:nth-child(2) { width: 17%; }
  html body.admin-app #inv-table th:nth-child(3) { width: 10%; }
  html body.admin-app #inv-table th:nth-child(8) { width: 92px; }
  html body.admin-app #inv-table td:nth-child(8) { text-align: right; }
}
@media (min-width: 769px) {
  html body.admin-app #inv-table :is(th, td):nth-child(n+4):nth-child(-n+6) { text-align: left !important; }
}

/* Desktop: Invoices - Stream moves about 2 cm left (narrower Invoice and Customer columns) */
@media (min-width: 769px) {
  html body.admin-app #inv-table th:nth-child(1) { width: 124px; }
  html body.admin-app #inv-table th:nth-child(2) { width: 113px; }
  html body.admin-app #inv-table th:nth-child(3) { width: 10%; }
}

/* Desktop: the other list pages - money columns start under their headings, status sits beside the actions */
@media (min-width: 769px) {
  html body.admin-app :is(#rc-table, #bl-tablewrap table, table:has(> #pm-rows), table:has(> #cb-rows), table:has(> #ex-rows)) :is(th, td).num-cell { text-align: left !important; }
  html body.admin-app :is(#rc-table, #bl-tablewrap table, table:has(> #pm-rows), table:has(> #cb-rows), table:has(> #ex-rows)) :is(th, td) { vertical-align: middle; padding-left: 14px; padding-right: 14px; }
  /* status column (second to last) shrinks to its content and hugs the actions column */
  html body.admin-app :is(#bl-tablewrap table, table:has(> #pm-rows)) :is(th, td):nth-last-child(2) { width: 1%; white-space: nowrap; text-align: right; padding-right: 4px; }
  html body.admin-app :is(#rc-table, #bl-tablewrap table, table:has(> #pm-rows)) :is(th, td):last-child { width: 1%; white-space: nowrap; text-align: right; }
}
@media (min-width: 769px) {
  html body.admin-app #inv-table th:nth-child(3) { width: 112px; }
  html body.admin-app #inv-table th:nth-child(4), html body.admin-app #inv-table th:nth-child(5), html body.admin-app #inv-table th:nth-child(6) { width: auto; }
  html body.admin-app #inv-table th:nth-child(7) { width: 120px; }
}

/* Cashbooks cards: three equal cards across the box, short labels, no explanatory line */
html body.admin-app .stats-grid.is-slim:has(#cb-balance) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html body.admin-app #cb-channels .text-xs { display: none !important; }
@media (max-width: 768px) {
  html body.admin-app .stats-grid.is-slim:has(#cb-balance) { display: flex !important; }
}
@media (min-width: 769px) {
  html body.admin-app .stats-grid.is-slim:has(#cb-balance) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) { html body.admin-app #cb-channels { display: none !important; } }

/* Filters in the top row (Cashbooks) and a calm gap before the cards */
html body.admin-app .page-toolbar > #cb-bar.in-toolbar { margin: 0 0 0 auto !important; padding: 0 !important; flex: 0 1 auto; min-width: 0; }
@media (max-width: 768px) {
  html body.admin-app .page-toolbar > #cb-bar.in-toolbar { margin: 0 !important; }
  html body.admin-app .workspace-body { gap: 10px; }
  html body.admin-app .page-toolbar { margin-bottom: 0; }
}
html body.admin-app .stats-grid.is-slim:has(#cb-balance) { margin-bottom: 0 !important; }
@media (max-width: 768px) {
  html body.admin-app .page-toolbar > #cb-bar.in-toolbar { margin: 0 auto 0 0 !important; }
  html body.admin-app .page-toolbar:has(> #cb-bar.in-toolbar):not(:has(.btn)) { min-height: 0; }
}

/* The balance line under the cashbook title is not needed */
html body.admin-app #cb-channels { display: none !important; }

/* From / To dates: one tidy row in the list header */
html body.admin-app .panel-head .fin-custom-row { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 0 auto; padding: 0; background: none; border: 0; border-radius: 0; }
html body.admin-app .fin-custom-row label { flex-direction: row; align-items: center; gap: 8px; font: 600 12px var(--font-body); color: var(--admin-ink-soft); }
html body.admin-app .fin-custom-row input[type="date"], html body.admin-app .fin-custom-row .date-input, html body.admin-app .fin-custom-row input { height: 34px; padding: 0 10px; border: 1px solid var(--admin-border) !important; border-radius: 10px !important; background: var(--a-surface, #fff); font: 600 13px var(--font-body); color: var(--admin-ink); box-shadow: none; min-width: 150px; }
@media (max-width: 768px) {
  html body.admin-app .panel-head .fin-custom-row { width: 100%; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  html body.admin-app .fin-custom-row label { flex-direction: column; align-items: stretch; gap: 4px; }
  html body.admin-app .fin-custom-row input { min-width: 0; width: 100%; }
}
@media (max-width: 768px) {
  html body.admin-app .fin-custom-row input { font-size: 11.5px !important; padding: 0 6px !important; letter-spacing: -.01em; }
  html body.admin-app .fin-custom-row label > * { min-width: 0; }
}

/* Cashbooks list: the new Cashbook column; equal widths and the same space either side of every column */
html body.admin-app #cb-rows > tr > td:nth-child(3) { grid-column: 1; grid-row: 3; }
@media (min-width: 769px) {
  html body.admin-app table:has(> #cb-rows) { table-layout: fixed; width: 100%; }
  html body.admin-app table:has(> #cb-rows) th:nth-child(1) { width: 15%; }
  html body.admin-app table:has(> #cb-rows) th:nth-child(3) { width: 14%; }
  html body.admin-app table:has(> #cb-rows) th:nth-child(4), html body.admin-app table:has(> #cb-rows) th:nth-child(5), html body.admin-app table:has(> #cb-rows) th:nth-child(6) { width: 15%; }
  html body.admin-app table:has(> #cb-rows) :is(th, td) { padding-left: 16px !important; padding-right: 16px !important; }
}
@media (max-width: 768px) { html body.admin-app #cb-rows > tr > td:nth-child(3) { font-size: .72rem; margin-top: 2px; } }
@media (max-width: 768px) { html body.admin-app #cb-rows > tr > td:nth-child(3) { display: none !important; } }

/* From / To dates: inline in the top bar beside the period (not in the list box) */
html body.admin-app .fin-toolbar-left .fin-custom-row { display: inline-flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 10px; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
html body.admin-app .fin-toolbar-left .fin-custom-row label { flex-direction: row; align-items: center; gap: 6px; }
html body.admin-app .fin-toolbar-left .fin-custom-row input { min-width: 140px; }

/* Custom dates: a single range chip beside the period; the From / To pop up in a small card */
html body.admin-app .fin-range { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--admin-border); border-radius: 10px; background: var(--a-surface, #fff); font: 600 13px var(--font-body); color: var(--admin-ink); cursor: pointer; white-space: nowrap; }
html body.admin-app .fin-range svg { opacity: .55; }
html body.admin-app .fin-range:hover { background: var(--pearl-200, #f1ebe2); }
.fin-range-pop input[type="date"], .fin-range-pop .input { min-width: 190px; }

/* Cashbooks list header: the picker takes the place of the title */
html body.admin-app .cb-pick-wrap .fk-combo-btn { border: 0 !important; background: transparent !important; padding: 0 4px 0 0 !important; font: 600 1.05rem var(--font-body) !important; min-height: 30px; box-shadow: none !important; }
html body.admin-app .cb-pick-wrap .fk-combo { display: inline-flex; }

/* An empty list shows only its message, not a row of column titles */
html body.admin-app .workspace-body .data-table:has(> tbody > tr > td[colspan] .empty-state) > thead { display: none; }
html body.admin-app .page-toolbar > .in-toolbar:not(#fin-page-bar):not(#cb-bar) { margin: 0 0 0 auto !important; padding: 0 !important; flex: 0 1 auto; min-width: 0; }
@media (max-width: 768px) { html body.admin-app .page-toolbar > .in-toolbar:not(#fin-page-bar):not(#cb-bar) { margin: 0 auto 0 0 !important; } }

/* No filter chips (Status: All / Open / Pending ...) beside the period on any page */
html body.admin-app .fin-chips, html body.admin-app .fin-chip { display: none !important; }
html body.admin-app .stats-grid[hidden] { display: none !important; }

/* Top row (button + filters): one height, one baseline, nothing hanging below */
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar { margin: 0 !important; align-items: center !important; flex-wrap: nowrap; }
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-left { flex: 0 1 auto; width: auto; }
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-right:empty { display: none; }
html body.admin-app .page-toolbar > .in-toolbar .fin-period, html body.admin-app .page-toolbar > .in-toolbar .fin-range, html body.admin-app .page-toolbar > .in-toolbar .rpt-act { height: 38px; box-sizing: border-box; }
html body.admin-app .page-toolbar .page-toolbar-actions .btn { height: 38px; box-sizing: border-box; }
@media (max-width: 768px) {
  html body.admin-app .page-toolbar { align-items: center; justify-content: space-between; gap: 10px; }
  html body.admin-app .page-toolbar > .in-toolbar { margin: 0 0 0 auto !important; }
}
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar { gap: 0 !important; }
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-right:not(:empty) { margin-left: 8px; }
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-left { gap: 8px; }
html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-right:not(:has(*)) { display: none !important; margin: 0 !important; }
@media (max-width: 768px) { html body.admin-app .page-toolbar > .in-toolbar .fin-toolbar-right { margin: 0 !important; gap: 0 !important; } }
@media (max-width: 768px) {
  /* no main button on this page (it is hidden on a phone): the filter starts at the left edge like everything else */
  html body.admin-app .page-toolbar > .page-toolbar-actions:not(:has(.btn-primary)) { display: none !important; }
  html body.admin-app .page-toolbar:has(> .page-toolbar-actions:not(:has(.btn-primary))) > .in-toolbar { margin: 0 auto 0 0 !important; }
}

/* Front Desk and admin lists: the filter button in a list header is a small pill at the right of the title, never a full-width bar */
html body.admin-app .panel-head > .panel-tools { margin-left: auto; width: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
html body.admin-app .panel-head > .panel-tools .btn { width: auto !important; min-width: 0; height: 34px; padding: 0 12px; border-radius: 10px; font-weight: 600; box-shadow: none; }
html body.admin-app .panel-head > .panel-tools .btn:focus:not(:focus-visible) { outline: none; box-shadow: none; }
@media (max-width: 768px) {
  html body.admin-app .panel-head { flex-wrap: nowrap; align-items: center; }
  html body.admin-app .panel-head > .panel-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Phone: every other list that shows as cards uses a compact two-column card (label over value) instead of one long labelled column */
@media (max-width: 768px) {
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) {
    display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 12px 14px !important; align-items: start;
  }
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) > td {
    display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left !important; font-size: .88rem; overflow-wrap: anywhere;
  }
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) > td[data-label]::before {
    display: block !important; content: attr(data-label); margin: 0 0 1px; font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--a-ink-faint, #6b6256);
  }
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) > td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: .98rem; }
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) > td:empty { display: none !important; }
  html body.admin-app .workspace-body .data-table tbody tr:has(> td[data-label]):not([data-pk]):not([data-inv]):not([data-pm]):not(.ex-row):not([data-rc]) > td:not([data-label]) { grid-column: 1 / -1; }
}

/* Phone: Reports lists as compact two-column cards */
@media (max-width: 768px) {
  html body.admin-app #rpt-content .data-table tbody tr { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 12px 14px !important; align-items: start; }
  html body.admin-app #rpt-content .data-table tbody tr > td { display: block !important; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left !important; font-size: .88rem; justify-content: flex-start; overflow-wrap: anywhere; }
  html body.admin-app #rpt-content .data-table tbody tr > td[data-label]::before { display: block !important; margin: 0 0 1px; font-size: .62rem; font-weight: 500; text-align: left; }
  html body.admin-app #rpt-content .data-table tbody tr > td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: .98rem; }
  html body.admin-app #rpt-content .data-table tbody tr > td:first-child::before { display: none !important; }
  html body.admin-app #rpt-content .data-table tbody tr > td.rpt-blank, html body.admin-app #rpt-content .data-table tbody tr > td:empty { display: none !important; }
}
@media (max-width: 768px) {
  html body.admin-app #rpt-content .data-table tbody tr > td:not(:first-child):not(:last-child):not(.rpt-blank), html body.admin-app #rpt-content .data-table tbody tr > td:last-child:not(:first-child) {
    display: block !important; padding: 0 !important; text-align: left !important; justify-content: flex-start; gap: 0; font-size: .88rem;
  }
}

/* Phone Bills: flat rows inside the box (name + status, number and date, three figures, Pay) */
html body.admin-app .bl-cards { gap: 0 !important; padding: 0 !important; }
html body.admin-app .bl-card { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 14px 16px !important; gap: 10px !important; border-bottom: 1px solid var(--a-line, rgba(60, 45, 20, .12)) !important; }
html body.admin-app .bl-card:last-child { border-bottom: 0 !important; }
html body.admin-app .bl-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px 12px !important; padding: 0 !important; border-block: 0 !important; }
html body.admin-app .bl-card-grid > div:nth-child(4) { display: none; }
html body.admin-app .bl-card-grid .label { font-size: .6rem !important; margin-bottom: 1px !important; }
html body.admin-app .bl-card-grid > div { font-size: .86rem; min-width: 0; overflow-wrap: anywhere; }
html body.admin-app .bl-card-acts .btn { min-height: 36px !important; }

/* Booking ref never splits across lines */
.bk-ref{white-space:nowrap}

/* text for screen readers only (the header shows just the clinic name; the page's own name is still read out) */
body.admin-app .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* item lines in a gift or a package: price each (editable) x how many = total, then the total */
.gs-line{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(130px,1fr) 76px minmax(100px,.8fr) 34px;gap:12px;align-items:end;padding:14px 16px;border:1px solid color-mix(in srgb,var(--a-gold,#b98a2f) 26%,transparent);border-radius:18px;background:#fff;box-shadow:0 10px 24px -20px rgba(90,60,10,.5)}
.gs-add{padding:14px 16px;border-radius:18px;background:color-mix(in srgb,var(--a-gold,#b98a2f) 8%,transparent);margin-top:12px}
.gs-add-h{font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;opacity:.65;margin-bottom:10px;font-weight:600}
.gs-total{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:18px 22px;border-radius:20px;background:linear-gradient(135deg,color-mix(in srgb,var(--a-gold,#b98a2f) 20%,#fff),#fff);border:1px solid color-mix(in srgb,var(--a-gold,#b98a2f) 40%,transparent)}
.gs-total>div{display:grid;gap:2px}.gs-total small{opacity:.65;font-size:.78rem}.gs-total strong{font-size:1.7rem;font-weight:700;letter-spacing:-.01em}
.gs-name{align-self:center;min-width:0}.gs-f{display:grid;gap:4px;margin:0}.gs-f small{font-size:.68rem;letter-spacing:.06em;text-transform:uppercase;opacity:.6}
.gs-tot b{height:44px;display:flex;align-items:center}.gs-line .icon-btn{align-self:center}
.gp-money{position:relative}.gp-money i{position:absolute;left:14px;top:0;bottom:0;display:flex;align-items:center;font-style:normal;font-weight:700;font-size:.72rem;letter-spacing:.06em;color:var(--a-gold,#b98a2f);pointer-events:none;z-index:1}body.admin-app .gp-money input.input{padding-left:50px}
@media (max-width:640px){.gs-line{grid-template-columns:1fr 1fr 32px}.gs-name{grid-column:1/-1}.gs-tot{grid-column:1/3}}
