/* Parlour — "Bronze Energy" admin styles.
   Espresso menu, warm ivory work area, amber-to-orange actions with dark text (readable in daylight at the counter). */

:root {
  --ink: #1f1510;
  --ink-soft: #6e5f53;
  --paper: #fbf7f1;
  --card: #ffffff;
  --line: #eee4d6;
  --line-strong: #dccdb8;
  --side: #1a120c;
  --side-2: #2b1d13;
  --side-text: #e9dccb;
  --bronze: #b8935b;

  /* Energy: amber into orange. Text on it is espresso, never white. */
  --accent: #f59e0b;
  --accent-2: #f97316;
  --accent-dark: #b45309;
  --accent-soft: #fff4e0;
  --grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #f97316 100%);
  --grad-hover: linear-gradient(135deg, #f59e0b 0%, #f97316 60%, #ea580c 100%);

  --ok-bg: #dcfce7;
  --ok-ink: #166534;
  --err-bg: #fee2e2;
  --err-ink: #b91c1c;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
  --info-bg: #e0f2fe;
  --info-ink: #075985;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 6px 20px rgba(60, 35, 10, .06);
  --shadow-lift: 0 2px 4px rgba(60, 35, 10, .08), 0 14px 32px rgba(60, 35, 10, .12);
  --shadow-glow: 0 6px 18px rgba(249, 115, 22, .32);

  /* 4px spacing scale: every margin, padding and gap uses these */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* three text sizes, so no screen shows more than three */
  --fs-sm: 13px;
  --fs-md: 16px;
  --fs-lg: 26px;


  /* Surfaces and small parts, so the dark theme can change them */
  --ink-faint: #a39486;
  --input-bg: #ffffff;
  --input-hover: #c9b597;
  --row-hover: #fffaf2;
  --chip-bg: #f3ebdf;
  --chip-ink: #5c4a3c;
  --chip-off-bg: #eeeae5;
  --note-line: #fde4b8;
  --note-ink: #6b4a22;
  --free-bg: linear-gradient(180deg, #fbfefc, #fff);
  --free-line: #bfe3c9;
  --off-stripe: #fff1f1;
  --off-line: #fecaca;
  --queue-bg: #fffcf7;
  --pay-bg: #f7fdf9;
  --needs-bg: #fff7ed;
  --fieldset-bg: #fffdf9;
  --group-bg: #fbf3e6;
  --link-hover: #c2410c;
  --err-field-bg: #fffafa;
  color-scheme: light;

  accent-color: var(--accent-2);
}


/* ---------- Dark theme ----------
   Follows the device's setting; the sun/moon button in the menu picks one for this browser (html data-theme). */
:root[data-theme="dark"] {
  --ink: #f4ece1;
  --ink-soft: #b9a998;
  --ink-faint: #7f6f60;
  --paper: #120c08;
  --card: #1c140e;
  --line: #33261b;
  --line-strong: #4a3828;
  --side: #0b0704;
  --side-2: #1c1209;
  --side-text: #e9dccb;
  --accent-dark: #fbbf24;
  --accent-soft: #2b1d0e;
  --ok-bg: #12301d;
  --ok-ink: #86efac;
  --err-bg: #3b1515;
  --err-ink: #fca5a5;
  --warn-bg: #3a2a0b;
  --warn-ink: #fcd34d;
  --info-bg: #0c2a3a;
  --info-ink: #7dd3fc;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 14px 32px rgba(0, 0, 0, .5);
  --input-bg: #150f0a;
  --input-hover: #6b5440;
  --row-hover: #251a12;
  --chip-bg: #2e2219;
  --chip-ink: #e2d3c1;
  --chip-off-bg: #2a231d;
  --note-line: #4a3517;
  --note-ink: #f3d9a8;
  --free-bg: linear-gradient(180deg, #14201a, #1c140e);
  --free-line: #24553a;
  --off-stripe: #2e1414;
  --off-line: #5c2323;
  --queue-bg: #211710;
  --pay-bg: #13231a;
  --needs-bg: #33200d;
  --fieldset-bg: #18110c;
  --group-bg: #261b12;
  --link-hover: #fdba74;
  --err-field-bg: #2a1212;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4ece1;
    --ink-soft: #b9a998;
    --ink-faint: #7f6f60;
    --paper: #120c08;
    --card: #1c140e;
    --line: #33261b;
    --line-strong: #4a3828;
    --side: #0b0704;
    --side-2: #1c1209;
    --side-text: #e9dccb;
    --accent-dark: #fbbf24;
    --accent-soft: #2b1d0e;
    --ok-bg: #12301d;
    --ok-ink: #86efac;
    --err-bg: #3b1515;
    --err-ink: #fca5a5;
    --warn-bg: #3a2a0b;
    --warn-ink: #fcd34d;
    --info-bg: #0c2a3a;
    --info-ink: #7dd3fc;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 14px 32px rgba(0, 0, 0, .5);
    --input-bg: #150f0a;
    --input-hover: #6b5440;
    --row-hover: #251a12;
    --chip-bg: #2e2219;
    --chip-ink: #e2d3c1;
    --chip-off-bg: #2a231d;
    --note-line: #4a3517;
    --note-ink: #f3d9a8;
    --free-bg: linear-gradient(180deg, #14201a, #1c140e);
    --free-line: #24553a;
    --off-stripe: #2e1414;
    --off-line: #5c2323;
    --queue-bg: #211710;
    --pay-bg: #13231a;
    --needs-bg: #33200d;
    --fieldset-bg: #18110c;
    --group-bg: #261b12;
    --link-hover: #fdba74;
    --err-field-bg: #2a1212;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body { min-height: 100vh; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(251, 191, 36, .14), transparent 60%),
    radial-gradient(900px 400px at -10% 110%, rgba(249, 115, 22, .07), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font: var(--fs-md)/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Bengali", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-underline-offset: 3px; }

h1 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; margin: 0 0 var(--s-1); line-height: 1.15; }
h2 { font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--s-4); letter-spacing: -.005em; }
.lead { color: var(--ink-soft); margin: 0 0 var(--s-6); max-width: 64ch; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.side {
  background:
    radial-gradient(280px 220px at 0% 0%, rgba(245, 158, 11, .16), transparent 70%),
    linear-gradient(180deg, var(--side-2) 0%, var(--side) 38%);
  color: var(--side-text);
  padding: var(--s-5) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  /* Pinned to the screen with its own scroll: the owner's full menu and Sign out stay in reach on long pages. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.side__shop { padding: 0 var(--s-2); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-3); row-gap: 2px; align-items: center; }
.side__mark {
  grid-row: 1 / 3;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--grad);
  color: var(--side);
  font-weight: 800; font-size: 20px; letter-spacing: -.02em;
  box-shadow: var(--shadow-glow);
}
.side__shop strong { color: #fff; font-size: var(--fs-md); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.side__shop > span:not(.side__mark) { font-size: var(--fs-sm); opacity: .7; }
.side__nav { display: grid; gap: var(--s-4); }
.side__group { display: grid; gap: 2px; }
.side__heading { margin: 0 0 var(--s-1); padding: 0 var(--s-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--bronze); }
.side__nav a, .side__account {
  color: inherit;
  text-decoration: none;
  padding: 7px var(--s-3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 500;
  transition: background .15s, color .15s, transform .15s;
}
.side__nav svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.side__nav a:hover, .side__account:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side__nav a:hover svg { opacity: 1; }
.side__nav a.is-current, .side__account.is-current { background: var(--grad); color: var(--side); font-weight: 700; box-shadow: var(--shadow-glow); }
.side__nav a.is-current svg { opacity: 1; }
/* Account links sit under the signed-in name, so the menu below has the full height. */
.side__out { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-1) var(--s-4); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side__account { font-size: var(--fs-sm); padding: var(--s-1) var(--s-2); }
.side__out .btn { width: auto; padding: var(--s-1) var(--s-3); font-size: var(--fs-sm); }

.main { padding: var(--s-8) clamp(var(--s-4), 4vw, var(--s-12)) var(--s-16); min-width: 0; }

/* ---------- Bare pages (sign-in, setup) ---------- */
.bare {
  background:
    radial-gradient(700px 420px at 50% -5%, rgba(251, 191, 36, .28), transparent 65%),
    radial-gradient(600px 400px at 100% 100%, rgba(249, 115, 22, .12), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}
.bare .main { max-width: 460px; margin: 0 auto; padding-top: 9vh; }
.bare .card { padding: var(--s-8); box-shadow: var(--shadow-lift); position: relative; overflow: hidden; }
.bare .card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--grad); }

/* ---------- Cards and layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
  box-shadow: var(--shadow);
}
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: var(--s-5); align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-6); }
.tile {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-5) var(--s-4);
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: var(--s-1);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.tile:first-child { background: linear-gradient(160deg, #2b1d13, #1a120c); color: #fff; border-color: transparent; }
.tile:first-child span { color: #e9dccb; }
.tile:first-child b { color: #fbbf24; }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.tile b { font-size: clamp(20px, 1.9vw, var(--fs-lg)); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile span { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 500; }

.steps { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.steps .done { color: var(--ink-soft); text-decoration: line-through; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--s-2) * -1); padding: 0 var(--s-2); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
th, td { text-align: left; padding: var(--s-3) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
thead th { border-bottom: 2px solid var(--line); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--row-hover); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
tr.is-off td { color: var(--ink-faint); }
.sub { display: block; font-size: var(--fs-sm); color: var(--ink-soft); }
.empty { color: var(--ink-soft); margin: 0; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px var(--s-3); border-radius: 99px; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; line-height: 1.5; }
.tag--off { background: var(--chip-off-bg); color: var(--ink-faint); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 700; }
.field small { color: var(--ink-soft); font-size: var(--fs-sm); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 10px var(--s-3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(249, 115, 22, .18); }
td input[type=number] { width: 96px; text-align: right; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font: inherit;
  font-weight: 700;
  padding: 10px var(--s-5);
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--grad);
  color: var(--side);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .28);
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--grad-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn--plain { background: var(--input-bg); color: var(--ink); border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn--plain:hover { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.btn--small { padding: 5px var(--s-3); font-size: var(--fs-sm); font-weight: 600; }
.btn--quiet { background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: inherit; width: 100%; font-weight: 600; box-shadow: none; }
.btn--quiet:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.form-actions { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-1); flex-wrap: wrap; }

/* ---------- Messages ---------- */
.flash, .errors { border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-5); font-weight: 500; border-left: 4px solid currentColor; }
.flash--ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash--error, .errors { background: var(--err-bg); color: var(--err-ink); }
.errors ul { margin: 0; padding-left: var(--s-5); }
.note { background: var(--accent-soft); border: 1px solid var(--note-line); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); color: var(--note-ink); font-size: var(--fs-sm); margin: 0 0 var(--s-4); }

/* ---------- Small screens ---------- */
@media (max-width: 1320px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .card:last-child, .split > div:last-child { max-width: 560px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { min-width: 0; }
  .side__nav { min-width: 0; }
  .split > .card:last-child, .split > div:last-child { max-width: none; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: var(--s-3) var(--s-4); gap: var(--s-3); position: sticky; top: 0; z-index: 30; height: auto; overflow: visible; box-shadow: 0 6px 20px rgba(26, 18, 12, .25); }
  .side__shop { flex: 1 1 0; min-width: 0; padding: 0; }
  .side__mark { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
  .side__out { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: var(--s-2); }
  .side__out .btn { width: auto; }
  .side__account { white-space: nowrap; }
  .side__nav { order: 3; flex: 1 1 100%; display: flex; gap: var(--s-1); overflow-x: auto; padding-bottom: var(--s-1); scrollbar-width: none; }
  /* On a phone the groups sit in one scrolling row, split by a thin line instead of headings. */
  .side__group { display: flex; gap: var(--s-1); }
  .side__group + .side__group { border-left: 1px solid rgba(255, 255, 255, .15); padding-left: var(--s-2); margin-left: var(--s-1); }
  .side__heading { display: none; }
  .side__nav a { white-space: nowrap; padding: var(--s-2) var(--s-3); gap: var(--s-2); }
  .main { padding-top: var(--s-6); }
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-1); }
.page-head .lead { margin-bottom: var(--s-5); }
.page-head h1 .tag { vertical-align: middle; margin-left: var(--s-2); }
.card--narrow { max-width: 620px; }
.tag--good { background: var(--ok-bg); color: var(--ok-ink); }
.tag--bad { background: var(--err-bg); color: var(--err-ink); }
.btn--danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; box-shadow: 0 2px 8px rgba(185, 28, 28, .28); }
.btn--danger:hover { background: linear-gradient(135deg, #dc2626, #991b1b); box-shadow: 0 6px 18px rgba(185, 28, 28, .32); }
.btn--wide { width: 100%; padding: var(--s-4); font-size: var(--fs-md); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Floor ---------- */
.floor__today { margin: 0 0 var(--s-4); color: var(--ink-soft); }
.floor__today b { color: var(--ink); }
.floor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "chairs wait" "chairs pay"; gap: var(--s-5); align-items: start; }
.floor__chairs { grid-area: chairs; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-4); }
.floor__col:nth-of-type(2) { grid-area: wait; }
.floor__col:nth-of-type(3) { grid-area: pay; }
.floor__col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow); }
.floor__col h2 { font-size: var(--fs-md); margin-bottom: var(--s-3); display: flex; justify-content: space-between; align-items: center; }
.floor__col:nth-of-type(2) h2 .tag { background: var(--warn-bg); color: var(--warn-ink); }
.floor__col:nth-of-type(3) h2 .tag { background: var(--ok-bg); color: var(--ok-ink); }

.chair {
  position: relative;
  display: grid;
  gap: var(--s-1);
  align-content: start;
  min-height: 132px;
  padding: var(--s-4);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chair:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.chair b { font-size: var(--fs-md); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.chair__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.chair__label::after { font-size: 10px; letter-spacing: .08em; padding: 2px var(--s-2); border-radius: 99px; }
.chair__foot { margin-top: auto; padding-top: var(--s-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.chair--free { border-style: dashed; border-color: var(--free-line); color: var(--ink-soft); background: var(--free-bg); box-shadow: none; }
.chair--free b { color: var(--ok-ink); }
.chair--free .chair__label::after { content: "Free"; background: var(--ok-bg); color: var(--ok-ink); }
.chair--free:hover { border-color: var(--ok-ink); border-style: solid; }
.chair--busy { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border-width: 2px; }
.chair--busy .chair__label::after { content: "In station"; background: var(--grad); color: var(--side); }
.chair--busy .chair__foot { color: var(--accent-dark); }
/* Blocked by out-of-order equipment: not seatable. The tile opens the property list to see why. */
.chair--off { background: repeating-linear-gradient(135deg, var(--card), var(--card) 10px, var(--off-stripe) 10px, var(--off-stripe) 14px); color: var(--ink-soft); border-color: var(--off-line); }
.chair--off b { color: var(--err-ink); }
.chair--off .chair__label::after { content: "Off"; background: var(--err-bg); color: var(--err-ink); }
.chair:focus-visible, .queue:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.queue { display: grid; gap: 2px; padding: var(--s-3); border-radius: var(--radius-sm); text-decoration: none; color: inherit; border: 1px solid var(--line); border-left: 4px solid var(--accent); margin-top: var(--s-2); font-size: var(--fs-sm); background: var(--queue-bg); transition: transform .12s, box-shadow .15s; }
.queue:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.queue b { font-size: var(--fs-md); }
.queue span { color: var(--ink-soft); }
.queue--pay { border-left-color: #22c55e; background: var(--pay-bg); }

/* ---------- Bill ---------- */
.split--bill { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.inline-form { display: flex; gap: var(--s-2); align-items: center; }
.inline-form select { min-width: 130px; }
select.needs { border-color: var(--accent-2); background: var(--needs-bg); }
.add-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--s-3); align-items: end; }
.add-row--two { grid-template-columns: minmax(0, 1fr) auto; margin-top: var(--s-1); }
.add-row .btn { margin-bottom: var(--s-4); }
.add-row + .add-row, .add-row + .note { border-top: 1px solid var(--line); padding-top: var(--s-4); }
.form-actions--spread { justify-content: space-between; border-top: 1px solid var(--line); padding-top: var(--s-4); }
.below { margin-top: var(--s-3); }

.totals { margin: 0; display: grid; gap: var(--s-2); }
.totals div { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.totals dt { color: var(--ink-soft); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.totals__due { margin-top: var(--s-2); padding: var(--s-4) !important; border-radius: var(--radius-sm); background: linear-gradient(160deg, #2b1d13, #1a120c); color: #fff; }
.totals__due dt { color: #e9dccb; font-weight: 700; }
.totals__due dd { font-size: var(--fs-lg); font-weight: 800; color: #fbbf24; letter-spacing: -.02em; }

.pay-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.pay-row label { font-weight: 700; font-size: var(--fs-sm); }
.pay-row input[data-pay] { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-left { min-height: 22px; margin: var(--s-1) 0 var(--s-3); font-size: var(--fs-sm); }
.pay-left--off { color: var(--err-ink); font-weight: 700; }

/* ---------- Receipt (printed: plain black on white) ---------- */
.receipt { width: 302px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: var(--s-5) var(--s-4); font-size: var(--fs-sm); line-height: 1.4; color: #000; position: relative; }
.receipt p { margin: 0; }
.receipt__shop { text-align: center; font-size: var(--fs-md); font-weight: 700; }
.receipt__meta, .receipt__foot { text-align: center; }
.receipt__rule { border-top: 1px dashed #000; margin: var(--s-2) 0; }
.receipt__row { display: flex; justify-content: space-between; gap: var(--s-3); }
.receipt__row span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt__part { padding-left: var(--s-3); font-size: var(--fs-sm); color: #333; }
.receipt__total { font-size: var(--fs-md); font-weight: 700; margin: var(--s-1) 0; }
/* A titled group of fields inside a form, such as the daily bonus in Shop settings. */
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s-5) var(--s-4) var(--s-4); margin: 0 0 var(--s-5); background: var(--fieldset-bg); }
.fieldset legend { font-size: var(--fs-sm); font-weight: 800; padding: 2px var(--s-3); border-radius: 99px; background: var(--side); color: #fbbf24; letter-spacing: .02em; }
.fieldset .note { margin-top: 0; }
.provider[hidden] { display: none; }

/* Stock: the add-usage row has a service, an amount and its button on one line. */
.row--add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; margin-top: var(--s-4); }
.field--end { align-self: end; }
@media (max-width: 480px) {
  .row--add { grid-template-columns: 1fr; }
}
.form-gap { margin-top: var(--s-6); }
.floor__low { margin: 0 0 var(--s-2); padding: var(--s-2) var(--s-4); border-left: 4px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.floor__low + :not(.floor__low) { margin-top: var(--s-5); }
.floor__low a { font-weight: 700; }

/* Walk-in slip: the token is the one thing the customer must read across the room, so it is the only text above --fs-lg. */
.slip__label { text-align: center; margin-top: var(--s-3) !important; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .2em; }
.slip__token { text-align: center; font-size: calc(var(--fs-lg) * 2.5); font-weight: 700; line-height: 1; margin-bottom: var(--s-2) !important; font-variant-numeric: tabular-nums; }
.token { display: inline-block; min-width: 2em; padding: 0 var(--s-1); border-radius: 6px; background: var(--side); color: #fbbf24; font-size: var(--fs-sm); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.page-head h1 .token { vertical-align: middle; font-size: var(--fs-md); padding: var(--s-1) var(--s-2); }
.receipt__void { text-align: center; font-size: var(--fs-lg); font-weight: 700; letter-spacing: .2em; border: 2px solid #000; margin-bottom: var(--s-2) !important; }

@media (max-width: 1320px) {
  .split--bill { grid-template-columns: minmax(0, 1fr); }
  .split--bill > div:last-child { max-width: 560px; }
}
@media (max-width: 1000px) {
  .floor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chairs" "wait" "pay"; }
}
@media (max-width: 860px) {
  .split--bill > div:last-child { max-width: none; }
}
@media (max-width: 560px) {
  .floor__chairs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .card { padding: var(--s-4); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .tiles .tile:first-child { grid-column: 1 / -1; }
  .tile { padding: var(--s-4) var(--s-4) var(--s-3); }
  .tile b { font-size: 22px; }
  .add-row, .add-row--two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .add-row .btn { justify-self: start; }
  .inline-form select { min-width: 0; width: 100%; }
  .inline-form { width: 100%; }
  /* Bill lines stack: service and price on top, barber and remove below. */
  .lines thead { display: none; }
  .lines, .lines tbody { display: block; }
  .lines tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  .lines tr:last-child { border-bottom: 0; }
  .lines td { border: 0; padding: 0; }
  .lines td:nth-child(1) { grid-area: 1 / 1; }
  .lines td:nth-child(3) { grid-area: 1 / 2; }
  .lines td:nth-child(2) { grid-area: 2 / 1; }
  .lines td:nth-child(4) { grid-area: 2 / 2; align-self: center; }
}

@media print {
  .side, .no-print, .flash, .demo-bar { display: none !important; }
  body, .shell { display: block; background: #fff; }
  .main { padding: 0; }
  .receipt { border: 0; box-shadow: none; width: 72mm; padding: 0; font-size: var(--fs-sm); }
  @page { margin: 4mm; }
}

/* ---------- Search, customers, closing ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.search input[type=text] { width: min(320px, 100%); }
.search input[type=date] { width: auto; }
textarea { resize: vertical; min-height: 90px; }
div.tile b { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.pay-left--ok { color: var(--ok-ink); font-weight: 700; }
.note.below { margin: var(--s-4) 0 0; }
form.below .note { margin-bottom: var(--s-3); }

/* ---------- Reports, payroll ---------- */
.quick { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-5); }
.quick .tag { text-decoration: none; padding: 6px var(--s-4); font-size: var(--fs-sm); background: var(--input-bg); border: 1.5px solid var(--line-strong); color: var(--ink); }
.quick .tag:hover { border-color: var(--accent); background: var(--accent-soft); }
.tag--on, .quick .tag--on { background: var(--grad); border-color: transparent; color: var(--side); }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
tfoot th { border-top: 2px solid var(--line-strong); border-bottom: 0; font-size: var(--fs-md); text-transform: none; letter-spacing: 0; color: var(--ink); padding-top: var(--s-3); font-weight: 800; }
.check { display: flex; gap: var(--s-2); align-items: center; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; }
.search input[type=month] { width: auto; font: inherit; padding: 10px var(--s-3); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--input-bg); color: inherit; }
.main > .form-actions { flex-wrap: wrap; }
@media (max-width: 1320px) {
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .split--even > .card:last-child { max-width: none; }
}
@media print {
  .card, .tile, .chair { border: 0; padding: 0; box-shadow: none; }
  .tag { background: none; padding: 0; }
  .tile::before { display: none; }
  .tile:first-child { background: none; color: #000; }
}
@media (max-width: 1320px) {
  .split--summary-first > div:last-child { order: -1; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  th, td { padding-left: var(--s-2); padding-right: var(--s-2); }
}

/* ---------- Lounges ---------- */
.floor__lounge { grid-column: 1 / -1; margin: var(--s-2) 0 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-dark); display: flex; align-items: center; gap: var(--s-3); }
.floor__lounge::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(245, 158, 11, .5), transparent); }
.floor__lounge:first-child { margin-top: 0; }
.tag--lounge { background: var(--side); color: #fbbf24; }
tr.group-row th { background: var(--group-bg); color: var(--ink); font-size: var(--fs-sm); padding-top: var(--s-2); padding-bottom: var(--s-2); }
input[type=file] { font: inherit; width: 100%; }
table.compact th, table.compact td { padding-left: var(--s-2); padding-right: var(--s-2); }
table.compact td.actions .btn { padding-left: var(--s-2); padding-right: var(--s-2); }
.row { align-items: start; }


/* ---------- Brand colour in place of browser defaults ---------- */
::selection { background: #fbbf24; color: var(--side); }
html { -webkit-tap-highlight-color: rgba(245, 158, 11, .25); }
input, select, textarea, button { accent-color: var(--accent-2); }

/* ---------- Hover and focus on every link and button ---------- */
a { transition: color .15s; }
a:where(:not(.btn, .tile, .chair, .queue, .tag)):hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.side__nav a:hover { color: #fff; }
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}
.side a:focus-visible, .side button:focus-visible { outline-color: #fbbf24; }
.btn:active { transform: translateY(1px); }
a.tile:focus-visible, .chair:focus-visible, .queue:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
input:hover, select:hover, textarea:hover { border-color: var(--input-hover); }

/* ---------- Inline field errors ---------- */
.field-error { display: block; color: var(--err-ink); font-size: var(--fs-sm); font-weight: 700; }
.field .field-error { margin-top: 0; }
.field:has(.field-error) input, .field:has(.field-error) select, .field:has(.field-error) textarea { border-color: var(--err-ink); background: var(--err-field-bg); }

/* ---------- Empty lists ---------- */
.empty-state { display: grid; gap: var(--s-3); justify-items: start; padding: var(--s-2) 0; color: var(--ink-soft); }
.empty-state p { margin: 0; }
.floor__col .empty-state { padding: 0; }
.floor__col .empty-state .btn { padding: 5px var(--s-3); font-size: var(--fs-sm); }

/* ---------- Loading and busy states ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: var(--s-4);
  height: var(--s-4);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin .7s linear infinite;
}
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .spinner { margin-right: var(--s-2); }
.live { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); font-weight: 700; color: var(--ok-ink); background: var(--ok-bg); padding: 6px var(--s-3); border-radius: 99px; }
.live::before { content: ""; width: var(--s-2); height: var(--s-2); border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.live.is-loading::before { background: none; border: 2px solid var(--accent-2); border-right-color: transparent; animation: spin .7s linear infinite; box-shadow: none; }
.live.is-offline { color: var(--err-ink); background: var(--err-bg); }
.live.is-offline::before { background: var(--err-ink); animation: none; }
#floor.is-first-load { min-height: 240px; background: linear-gradient(100deg, var(--chip-bg) 30%, var(--row-hover) 50%, var(--chip-bg) 70%) 0 0 / 200% 100%; border-radius: var(--radius); animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* Content arriving: a short rise, so the screen feels alive without getting in the way. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main > * { animation: rise .28s ease-out both; }
.main > *:nth-child(2) { animation-delay: .03s; }
.main > *:nth-child(3) { animation-delay: .06s; }
.main > *:nth-child(n+4) { animation-delay: .09s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; } }

/* Form controls take the page's font and size instead of the browser's own */
input, button, select, textarea, optgroup { font: inherit; }

/* Lines an import could not take, listed under its result. */
.problems { margin: 0; padding-left: var(--s-5); font-size: var(--fs-sm); color: var(--err-ink); }

/* Messages: the preview under the message form, a message as the customer sees it, and a copyable command. */
.preview { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.preview h3 { margin: 0 0 var(--s-2); font-size: var(--fs-md); }
.preview__msg { margin: var(--s-3) 0; padding: var(--s-3) var(--s-4); background: #dcf8c6; border-radius: 14px 14px 14px 4px; white-space: normal; box-shadow: var(--shadow); max-width: 46ch; }
.code { padding: var(--s-3) var(--s-4); background: var(--side); color: #fde68a; border-radius: var(--radius-sm); font-size: var(--fs-sm); white-space: pre-wrap; word-break: break-all; }

/* Bookings: a request still to confirm, and the public booking page (no menu, phone first). */
.tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.book { max-width: 640px; margin: 0 auto; padding: var(--s-6) var(--s-4); }
.book h1 { margin-bottom: var(--s-1); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s-2); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; }
.slot span { display: block; text-align: center; padding: 10px var(--s-2); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; transition: border-color .12s, transform .12s; }
.slot span:hover { border-color: var(--accent); transform: translateY(-1px); }
.slot input:checked + span { background: var(--grad); border-color: transparent; color: var(--side); font-weight: 800; box-shadow: var(--shadow-glow); }
.slot input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.slot--full span { color: var(--ink-soft); text-decoration: line-through; background: transparent; cursor: not-allowed; opacity: .55; transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checks { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
/* A group of choices laid out like any other field (booking times, closed days): no browser border. */
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--s-4); min-width: 0; background: none; }
fieldset.field > legend.label { padding: 0; margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 700; background: none; color: inherit; }

/* ---------- Waiting-area TV screen ----------
   Read from across the room, so sizes follow the screen (vw) instead of the app's three text sizes. */
.tv { position: fixed; inset: 0; display: flex; flex-direction: column; background: radial-gradient(60vw 40vw at 100% 0%, rgba(245, 158, 11, .18), transparent 70%), #140d08; color: #f4ede2; padding: 2.5vw 3vw; overflow: hidden; }
.tv__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-bottom: 1.2vw; margin-bottom: 2vw; }
.tv__shop { font-size: 2.6vw; font-weight: 800; letter-spacing: .01em; }
.tv__clock { font-size: 2.2vw; color: #fbbf24; font-variant-numeric: tabular-nums; font-weight: 700; }
.tv__body { flex: 1; display: grid; grid-template-columns: 2.2fr 1fr; gap: 3vw; min-height: 0; }
.tv h2 { margin: 0 0 1.4vw; font-size: 1.6vw; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #fbbf24; }
.tv__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4vw; }
.tv__card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.6vw 1vw; border-radius: 1.2vw; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.tv__token { font-size: 6vw; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tv__chair { margin-top: .6vw; font-size: 1.8vw; color: #d9cfc0; }
.tv__card.is-new { background: linear-gradient(135deg, #fbbf24, #f97316); color: #1a120c; border-color: #fde68a; animation: tv-call 1.2s ease-in-out 6; }
.tv__card.is-new .tv__chair { color: #1a120c; }
@keyframes tv-call { 50% { transform: scale(1.06); box-shadow: 0 0 0 .6vw rgba(251, 191, 36, .35); } }
.tv__queue { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1vw; }
.tv__queue li { font-size: 3.4vw; font-weight: 800; text-align: center; padding: .8vw 0; border-radius: .8vw; background: rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.tv__queue li.is-next { grid-column: 1 / -1; font-size: 4.6vw; background: rgba(251, 191, 36, .22); color: #fff; }
.tv__empty, .tv__more { font-size: 1.8vw; color: #b9ab98; margin: 0; }
.tv__more { margin-top: 1vw; }
@media (prefers-reduced-motion: reduce) { .tv__card.is-new { animation: none; } }
@media (max-aspect-ratio: 1/1) {
  .tv__body { grid-template-columns: 1fr; }
  .tv__shop { font-size: 5vw; } .tv__clock { font-size: 4.4vw; } .tv h2 { font-size: 3.4vw; }
  .tv__token { font-size: 12vw; } .tv__chair, .tv__empty, .tv__more { font-size: 3.6vw; } .tv__queue li { font-size: 7vw; }
}

/* Demo: the bar on every screen of the demo shop, and the card under the sign-in form. */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: calc(var(--s-4) * -1) 0 var(--s-5); padding: var(--s-2) var(--s-4); border-radius: var(--radius-sm); background: linear-gradient(90deg, #2b1d13, #1a120c); color: #f1e7d8; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.demo-bar form { display: inline-flex; align-items: center; gap: var(--s-1); margin: 0; }
.demo-bar button { font: inherit; color: inherit; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 99px; padding: 2px var(--s-3); cursor: pointer; }
.demo-bar button:hover { background: rgba(255, 255, 255, .16); }
.demo-bar button.is-current { background: var(--grad); border-color: transparent; color: var(--side); font-weight: 700; }
.demo-bar a { color: #fbbf24; }
.demo-bar__links { display: inline-flex; align-items: center; gap: var(--s-3); margin-left: auto; }
.demo-card { margin-top: var(--s-4); }
.demo-pick { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.demo-pick .btn { flex: 1 1 10rem; }

/* Customer suggestions under the mobile or name field. */
.field { position: relative; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: var(--s-1); list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); max-height: 280px; overflow-y: auto; }
.suggest li { display: grid; gap: 2px; padding: var(--s-2) var(--s-3); cursor: pointer; border-radius: 8px; }
.suggest li span { font-size: var(--fs-sm); color: var(--ink-soft); }
.suggest li:hover, .suggest li.is-active { background: var(--accent-soft); }

/* Cash book and money: money in reads plainly, money out in red. */
.cashbook td.neg, b.neg { color: var(--err-ink); }
.cashbook td.pos { color: var(--ok-ink); }

/* Shop logo: in the menu (in place of the letter), on the sign-in page, and its preview in Shop settings. */
.side__mark--logo { width: 52px; height: 52px; object-fit: cover; padding: 0; background: var(--side); border-radius: 50%; box-shadow: 0 0 0 2px rgba(251, 191, 36, .55), var(--shadow-glow); }
.sign-logo { display: block; width: 112px; height: 112px; margin: 0 auto var(--s-4); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px rgba(251, 191, 36, .5), var(--shadow-lift); }
.logo-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-5); }
.logo-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--side); box-shadow: var(--shadow); }
.pin-input { width: 96px; text-align: center; font-weight: 700; }

/* Dark theme details: the dark highlight panels get an amber edge so they stand out from the dark page. */
:root[data-theme="dark"] .tile:first-child, :root[data-theme="dark"] .totals__due { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35), var(--shadow); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile:first-child, :root:not([data-theme="light"]) .totals__due { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35), var(--shadow); }
}
/* The receipt and slip stay black on white: they are paper. */
.receipt { color-scheme: light; }

/* The light/dark switch in the menu. */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: var(--side-text); cursor: pointer; }
.theme-toggle:hover { background: rgba(255, 255, 255, .1); color: #fbbf24; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.bare .theme-toggle { position: fixed; top: var(--s-4); right: var(--s-4); border-color: var(--line-strong); color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
@media print { .theme-toggle { display: none !important; } }

/* Printing is always light: paper is white. (#_ only raises the rule above the dark theme's.) */
@media print {
  :root:not(#_) {
    --ink: #1f1510; --ink-soft: #6e5f53; --ink-faint: #a39486; --paper: #fff; --card: #fff; --line: #e5dccd; --line-strong: #cbbba4;
    --chip-bg: #f3ebdf; --chip-ink: #5c4a3c; --input-bg: #fff; --row-hover: #fff; --group-bg: #f6efe4; --fieldset-bg: #fff;
    --ok-ink: #166534; --err-ink: #b91c1c; --warn-ink: #92400e; --accent-dark: #b45309; --note-ink: #6b4a22; --accent-soft: #fff;
    color-scheme: light;
  }
}
.side__out { flex-wrap: nowrap; }
.side__account, .side__out .btn { white-space: nowrap; }
.side__out .theme-toggle { margin-left: auto; flex: none; }
@media print {
  .tile { padding: var(--s-2) var(--s-3) !important; overflow: visible; }
  :root:not(#_) .tile:first-child { background: none; box-shadow: none; border: 1px solid #ccc; }
  :root:not(#_) .tile:first-child b, :root:not(#_) .tile:first-child span, :root:not(#_) .totals__due dd, :root:not(#_) .totals__due dt { color: #000; }
  :root:not(#_) .totals__due { background: none; color: #000; box-shadow: none; border: 1px solid #ccc; }
  .main > * { animation: none !important; }
}
.msg-reply { font-size: 12px; opacity: .85; overflow-wrap: anywhere; }
.totals dd form.below { margin-top: var(--s-1); }

/* ---------- Appointment letter: A4 paper, black on white in both themes ---------- */
.letter { color-scheme: light; display: grid; gap: var(--s-6); justify-content: center; }
.letter__page {
  position: relative; width: 210mm; min-height: 297mm; max-width: 100%; padding: 18mm 18mm 22mm;
  background: #fff; color: #1a1a1a; box-shadow: var(--shadow-lift); border-radius: 4px;
  font-family: "Nirmala UI", "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "Segoe UI", sans-serif; font-size: 14.5px; line-height: 1.75;
}
.letter__page p { margin: 0 0 6px; }
.letter__page h3 { font-size: 16px; margin: 16px 0 6px; color: #1a1a1a; }
.letter__head { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; border-bottom: 2px solid #33405a; padding-bottom: 10px; }
.letter__logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.letter__brand { font-size: 22px; color: #33405a; margin: 0 !important; font-family: "Segoe UI", system-ui, sans-serif; }
.letter__brand b { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.letter__addr { margin: 2px 0 0 !important; font-size: 14px; }
.letter__title { text-align: center; font-size: 24px; text-decoration: underline; text-underline-offset: 6px; margin: 18px 0 14px; color: #1a1a1a; }
.letter__title--annex { text-decoration: none; margin: 2px 0 2px; font-size: 21px; }
.letter__annex { text-align: center; font-weight: 700; font-size: 18px; margin: 0 !important; }
.letter__sub { text-align: center; font-size: 13.5px; }
.letter__page hr { border: 0; border-top: 1.5px solid #333; margin: 8px 0 12px; }
.letter__meta { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 14px; padding: 0 8px; }
.letter__h { font-weight: 700; margin-top: 12px !important; }
.letter__just { text-align: justify; }
.letter__table { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-size: 14.5px; }
.letter__table th, .letter__table td { border: 1px solid #bfc6d1; padding: 6px 10px; text-align: left; text-transform: none; letter-spacing: 0; color: #1a1a1a; font-size: 14.5px; vertical-align: top; }
.letter__table th { width: 38%; background: #eef2f8; font-weight: 700; }
.letter__table td { height: 34px; }
.letter tbody tr:hover { background: none; }
.letter__rules { margin: 0; padding-left: 2.4em; }
.letter__rules li { margin: 0 0 5px; padding-left: .4em; text-align: justify; }
.letter__rules li::marker { font-variant-numeric: normal; }
.letter__signs { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 26px; }
.letter__signs p { margin: 0 0 14px !important; }
.letter__accept { margin-top: 22px !important; font-size: 17px !important; }
.letter__foot { position: absolute; left: 0; right: 0; bottom: 9mm; text-align: center; font-size: 11px; color: #888; margin: 0 !important; }
.fill { display: inline-block; min-width: 46%; border-bottom: 1px dotted #555; height: 1.1em; vertical-align: baseline; }
.fill--short { min-width: 7em; }
@media print {
  .letter { display: block; }
  .letter__page { width: auto; min-height: 0; height: 297mm; padding: 16mm 16mm 20mm; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; overflow: hidden; }
  .letter__page:last-child { break-after: auto; page-break-after: auto; }
  .main:has(.letter) > .flash { display: none !important; }
}
/* A4 only for the letter's pages (a named page), so receipts keep printing on the 80 mm roll. */
.letter__page { page: a4letter; }
@page a4letter { size: A4; margin: 0; }
.letter__rules { list-style-type: bengali; }
.letter__table { table-layout: fixed; border: 1px solid #b5bdca; }
.letter__table th, .letter__table td { border-color: #b5bdca; }

/* ---------- Counter sale ---------- */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); align-items: start; margin-bottom: var(--s-5); }
.sale__search input { max-width: 420px; }
.sale__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); }
.product { display: grid; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, transform .15s; }
.product[hidden] { display: none; }
.product:hover { transform: translateY(-2px); }
.product.is-in-cart { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border-width: 2px; }
.product__tap { display: grid; gap: 2px; text-align: left; padding: var(--s-4) var(--s-4) var(--s-3); border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.product__tap b { font-size: var(--fs-md); line-height: 1.25; }
.product__price { font-size: 20px; font-weight: 800; color: var(--accent-dark); letter-spacing: -.01em; }
.product__stock { font-size: var(--fs-sm); color: var(--ink-soft); }
.product--out .product__stock { color: var(--err-ink); font-weight: 600; }
.product__qty { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-2); align-items: center; padding: 0 var(--s-3) var(--s-3); }
.product__qty input { text-align: center; font-weight: 700; padding: 6px; }
.product__qty .btn { width: 36px; height: 36px; padding: 0; font-size: 18px; justify-content: center; }
.sale__cart { position: sticky; top: var(--s-4); margin-bottom: 0; }
.cart { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: grid; gap: var(--s-2); }
.cart li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-2); align-items: center; padding: var(--s-2) 0; border-bottom: 1px dashed var(--line); }
.cart__empty { display: block !important; color: var(--ink-soft); border: 0 !important; }
.cart__remove { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--input-bg); color: var(--ink-soft); cursor: pointer; line-height: 1; }
.cart__remove:hover { color: var(--err-ink); border-color: var(--err-ink); }
input[type=search] { width: 100%; font: inherit; color: inherit; padding: 10px var(--s-3); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--input-bg); }
@media (max-width: 1000px) { .sale { grid-template-columns: minmax(0, 1fr); } .sale__cart { position: static; } }
@media (max-width: 560px) { .sale__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- New walk-in: several services at once ---------- */
.picker { border: 0; padding: 0; margin: 0 0 var(--s-4); min-width: 0; }
.picker > legend.label { display: block; margin-bottom: var(--s-2); }
.picker__search { margin-bottom: var(--s-2); }
.picker__list { max-height: 360px; overflow-y: auto; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--input-bg); padding: var(--s-1) 0; }
.picker__cat { margin: 0; padding: var(--s-3) var(--s-3) var(--s-1); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-dark); }
.picker__cat[hidden], .picker__item[hidden] { display: none; }
.picker__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); cursor: pointer; border-radius: 8px; margin: 0 var(--s-1); }
.picker__item:hover { background: var(--row-hover); }
.picker__item.is-on { background: var(--accent-soft); }
.picker__item.is-on .picker__name { font-weight: 700; }
.picker__item input { width: 18px; height: 18px; }
.picker__item.is-off { opacity: .45; cursor: not-allowed; }
.picker__price { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: var(--fs-sm); white-space: nowrap; }
.picker__total { margin: var(--s-2) 0 0; font-weight: 700; color: var(--accent-dark); }
.add-row--four { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr) minmax(0, 1fr) auto; }
.inline-form.below { margin-top: var(--s-1); }
.inline-form .sub { white-space: nowrap; }
@media (max-width: 560px) { .add-row--four { grid-template-columns: minmax(0, 1fr); } }
td.actions.actions--wrap { white-space: normal; text-align: right; min-width: 150px; }
.actions--wrap .btn, .actions--wrap form { margin: 2px 0 2px 2px; }
.statement td:nth-child(3) { min-width: 220px; }
.warn-box { background: var(--err-bg); color: var(--err-ink); border-left: 4px solid var(--err-ink); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); margin: 0 0 var(--s-4); }
.purge-staff { border-top: 1px solid var(--line); padding-top: var(--s-4); }

/* ---------- Team status: floor strip and Website team (same states as the website) ---------- */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.state--free::before, .state--soon::before, .state--duty::before { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.state--free, .state--soon, .state--duty { color: var(--ok-ink); }
.state--busy::before { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }
.state--busy, .state--reserved { color: var(--warn-ink); }
.state--reserved::before { background: var(--accent); }
.team-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-2); margin: 0 0 var(--s-4); }
.team-now__item { display: grid; gap: var(--s-1); align-content: start; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.team-now__item.state-card--free, .team-now__item.state-card--soon { border-color: var(--ok-bg); }
.team-now__item.state-card--busy { border-color: var(--warn-bg); }
.team-now__item.state-card--off, .team-now__item.state-card--closed { opacity: .6; }
.team-now__item progress { width: 100%; height: 4px; appearance: none; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; }
.team-now__item progress::-webkit-progress-bar { background: var(--line); }
.team-now__item progress::-webkit-progress-value { background: var(--grad); }
.team-now__item progress::-moz-progress-bar { background: var(--grad); }
.team-now__link { align-self: center; font-size: var(--fs-sm); font-weight: 600; padding: var(--s-3); }
.team-list { list-style: none; margin: 0; padding: 0; }
.team-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row.is-off .avatar, .team-row.is-off b { opacity: .55; }
.team-row__main { display: grid; gap: 2px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-soft); }
.avatar--initials { display: inline-grid; place-items: center; font-weight: 800; color: var(--accent-dark); }
.avatar--big { width: 72px; height: 72px; font-size: var(--fs-lg); }
.team-edit__head { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); }
.team-edit__head h2 { margin: 0; }
@media (max-width: 560px) { .team-row { grid-template-columns: auto minmax(0, 1fr); } .team-row .actions { grid-column: 1 / -1; text-align: left; } }
