/* =====================================================================
   MSE 91 — admin panel styles
   Plain CSS, no frameworks. Same design family as the public site:
   warm neutrals, burnt-orange accent, Bricolage Grotesque + Inter.
   ===================================================================== */

/* ------------------------------------------------------------- tokens */
:root {
  --bg: #F4F6F8;
  --login-bg: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #121822;
  --muted: #4B5563;
  --faint: #6B7280;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --accent: #0D8A43;
  --accent-hover: #096831;
  --accent-soft: #E9F6EF;
  --accent-softer: #D6EFDF;
  --green: #0D8A43;
  --green-soft: #E9F6EF;
  --red: #B91C1C;
  --red-soft: #FEF2F2;
  --red-line: #FECACA;
  --stone-soft: #F1F3F5;
  --dark: #121822;
  --dark-line: #2D3748;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 24, 34, .05), 0 10px 30px rgba(18, 24, 34, .08);
  --shadow-sm: 0 1px 2px rgba(18, 24, 34, .08);
  --font-head: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
::selection { background: var(--accent-softer); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================ login */
.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--login-bg);
  overflow-y: auto;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 32px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.login-card h1 {
  font: 800 1.65rem/1.1 var(--font-head);
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.login-sub { color: var(--muted); font-size: .875rem; margin: 0 0 26px; }
.login-card form { text-align: left; }
.login-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .8125rem;
  margin: 0 0 14px;
}
.login-back {
  display: inline-block;
  margin-top: 22px;
  font-size: .8125rem;
  color: var(--faint);
  text-decoration: none;
}
.login-back:hover { color: var(--accent); }

/* ====================================================== app layout */
.app { flex: 1; display: flex; min-height: 0; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.topbar {
  flex: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 600 1.05rem var(--font-head);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px;
  scroll-behavior: smooth;
}
.wrap { max-width: 940px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------- sidebar */
.sidebar {
  width: 240px;
  flex: none;
  background: var(--dark);
  display: flex;
  flex-direction: column;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 14px; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brand-name { display: block; font: 700 .95rem var(--font-head); color: #fff; }
.brand-sub {
  display: block;
  font-size: .625rem;
  color: #9CA3AF;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 1px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #2D3748 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2D3748; border-radius: 3px; }
.sidebar-foot {
  padding: 14px 18px;
  font-size: .6875rem;
  color: #6B7280;
  border-top: 1px solid var(--dark-line);
  letter-spacing: .03em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #D1D5DB;
  font: 500 .875rem var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #1E2633; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-ic { display: inline-flex; flex: none; }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  flex: none;
  background: var(--accent);
  color: #fff;
  font: 700 .6875rem/1 var(--font-body);
  padding: 5px 8px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}
.nav-item.active .nav-badge { background: #fff; color: var(--accent); }

.scrim { position: fixed; inset: 0; background: rgba(28, 25, 23, .5); z-index: 120; animation: fade-in .15s ease; }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font: 700 1.05rem var(--font-head); letter-spacing: -.01em; }
.card-head-note { font-size: .75rem; color: var(--faint); }

/* -------------------------------------------------------- dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.stat-ic {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stat-ic.accent { background: var(--accent-soft); color: var(--accent); }
.stat-ic.green { background: var(--green-soft); color: var(--green); }
.stat-ic.stone { background: var(--stone-soft); color: var(--muted); }
.stat-num { font: 800 1.7rem/1 var(--font-head); letter-spacing: -.02em; }
.stat-label { font-size: .8125rem; color: var(--muted); }

.latest-list { display: flex; flex-direction: column; gap: 4px; }
.latest-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.latest-row:hover { background: var(--login-bg); }
.latest-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.latest-name { font-weight: 600; font-size: .875rem; }
.latest-service {
  color: var(--faint);
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.latest-date { color: var(--faint); font-size: .75rem; white-space: nowrap; flex: none; }

.quick-row { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: 600 .875rem var(--font-body);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------- bookings */
.tabs {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  min-height: 38px;
  padding: 0 14px;
  font: 600 .8125rem var(--font-body);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .12s, color .12s;
}
.tab:hover { color: var(--ink); background: var(--stone-soft); }
.tab.active { background: var(--ink); color: #fff; }
.tab-count {
  background: var(--stone-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: .6875rem;
  font-weight: 700;
}
.tab.active .tab-count { background: rgba(255, 255, 255, .24); color: #fff; }

.booking-list { display: flex; flex-direction: column; gap: 12px; }
.booking-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.booking-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.booking-head:hover { background: var(--login-bg); }
.booking-who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.booking-name { font-weight: 600; font-size: .9375rem; }
.booking-phone { font-size: .8125rem; color: var(--accent); text-decoration: none; }
.booking-phone:hover { text-decoration: underline; }
.booking-date { color: var(--faint); font-size: .75rem; white-space: nowrap; flex: none; }
.booking-chevron { display: inline-flex; color: var(--faint); flex: none; transition: transform .18s ease; }
.booking-card.open .booking-chevron { transform: rotate(180deg); }
.booking-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 18px;
  background: #F8FAF9;
}
.booking-card.open .booking-body { display: block; animation: fade-in .18s ease; }
.booking-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px 26px;
  margin: 0 0 18px;
}
.booking-details dt {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 3px;
}
.booking-details dd { margin: 0; font-size: .875rem; line-height: 1.55; }
.booking-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.route { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.route-pt {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: .8125rem;
}
.route-arrow { color: var(--accent); display: inline-flex; flex: none; }
.pre { white-space: pre-line; }

/* -------------------------------------------------------------- pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 .6875rem/1 var(--font-body);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-new { background: var(--accent-soft); color: var(--accent); }
.pill-confirmed { background: var(--green-soft); color: var(--green); }
.pill-completed { background: var(--stone-soft); color: var(--muted); }
.pill-cancelled { background: var(--red-soft); color: var(--red); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: 600 .875rem var(--font-body);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 16px rgba(194, 65, 12, .28); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--faint); background: var(--login-bg); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #991B1B; }
.btn-danger-ghost { background: transparent; border-color: var(--red-line); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: #FCA5A5; }
.btn-sm { height: 38px; padding: 0 13px; font-size: .8125rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.is-busy, .btn[disabled] { pointer-events: none; opacity: .6; }
.btn:disabled { pointer-events: none; opacity: .55; }

.icon-btn {
  width: 38px; height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); background: var(--login-bg); }
.icon-btn.danger:hover:not(:disabled) { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.hamburger { display: none; }

/* ------------------------------------------------------------- inputs */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: 400 .9375rem var(--font-body);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.55; padding-top: 11px; }
input::placeholder, textarea::placeholder { color: #9CA3AF; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 138, 67, .14);
}
input:disabled, textarea:disabled, select:disabled { background: var(--stone-soft); color: var(--faint); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .lbl, .lbl { display: block; font: 600 .8125rem var(--font-body); color: var(--ink); }
.form-body { display: flex; flex-direction: column; gap: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.hint { font-size: .75rem; color: var(--faint); margin: 4px 0 0; line-height: 1.55; }
.note { font-size: .8125rem; color: var(--muted); margin: 0; line-height: 1.6; }

/* --------------------------------------------------------------- switch */
.switch-box {
  background: var(--stone-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  flex: none;
  width: 46px; height: 26px;
  border-radius: 999px;
  background: #D1D5DB;
  position: relative;
  transition: background .18s;
  margin-top: 1px;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 25, 23, .35);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: .875rem; font-weight: 500; color: var(--ink); line-height: 1.5; }
.switch-sub { display: block; font-size: .8125rem; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* -------------------------------------------------------- upload slots */
.upload-slot {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--login-bg);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px;
}
.upload-preview {
  width: 132px; height: 96px;
  flex: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview.contain img { object-fit: contain; padding: 8px; }
.upload-preview.img-missing { border-color: var(--red-line); }
.upload-preview.img-missing::after {
  content: "Couldn't load image";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .625rem;
  color: var(--red);
  background: var(--red-soft);
  padding: 4px;
  text-align: center;
}
.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: .625rem;
}
.upload-meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.upload-slot.is-busy { opacity: .55; pointer-events: none; }

/* ------------------------------------------------------------- gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gallery-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-thumb { aspect-ratio: 4 / 3; background: var(--stone-soft); position: relative; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.img-missing { background: var(--red-soft); }
.gallery-thumb.img-missing::after {
  content: "Couldn't load image";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6875rem;
  color: var(--red);
}
.gallery-meta { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.gallery-caption { min-height: 40px; }
.gallery-add-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

.upload-log { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.upload-log-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  font-size: .8125rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.upload-log-row:last-of-type { border-bottom: 0; }
.upload-log-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-log-row.ok .upload-log-status { color: var(--green); font-weight: 600; }
.upload-log-row.error .upload-log-status { color: var(--red); }
.upload-log-row.uploading .upload-log-status { color: var(--muted); }
.upload-log-foot { padding: 8px 14px; background: var(--login-bg); }

/* -------------------------------------------------------- list editors */
.service-card, .tstm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.service-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.svc-icon-wrap {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.svc-icon-field { display: flex; flex-direction: column; gap: 4px; width: 170px; }
.svc-icon-field .lbl { font-size: .6875rem; color: var(--faint); }
.svc-controls { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.svc-title { font-weight: 600; }
.svc-price { max-width: 240px; }

.tstm-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tstm-top input { flex: 1 1 170px; min-width: 0; }
.tstm-top .tstm-rating-field { flex: 0 1 130px; min-width: 120px; }
.tstm-text { min-height: 76px; }

.stat-cols {
  display: grid;
  grid-template-columns: 130px 1fr 38px;
  gap: 8px;
  font-size: .6875rem;
  color: var(--faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.stat-row { display: grid; grid-template-columns: 130px 1fr 38px; gap: 8px; margin-bottom: 8px; }
.stats-editor { margin-bottom: 10px; }

/* ------------------------------------------------------------ save bar */
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.savebar-hint {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 600;
}
.view.is-dirty .savebar-hint { display: inline-flex; }
.savebar .btn { margin-left: auto; }

/* ---------------------------------------------------------- empty state */
.empty {
  text-align: center;
  padding: 46px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .55);
}
.empty .empty-ic { color: var(--line-strong); display: inline-flex; }
.empty p { margin: 0; font-weight: 600; font-size: .9375rem; }
.empty .empty-sub { font-weight: 400; font-size: .8125rem; color: var(--faint); max-width: 360px; }

/* --------------------------------------------------------------- smtp */
.test-row { display: flex; gap: 10px; flex-wrap: wrap; }
.test-row input { flex: 1 1 220px; }
.test-row .btn { flex: none; }

/* ------------------------------------------------------------ settings */
.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; gap: 10px; align-items: baseline; font-size: .8125rem; color: var(--muted); flex-wrap: wrap; }
.file-list code {
  background: var(--stone-soft);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .75rem;
  color: var(--ink);
}
.note-box {
  margin-top: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-softer);
  border-radius: 12px;
  padding: 14px 16px;
}
.note-box h3 {
  margin: 0 0 4px;
  font: 700 .8125rem var(--font-head);
  color: var(--accent-hover);
  display: flex;
  gap: 8px;
  align-items: center;
}
.note-box p { margin: 0; font-size: .8125rem; color: #7C2D12; line-height: 1.55; }

/* -------------------------------------------------------------- toasts */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: toast-in .22s ease;
  pointer-events: auto;
}
.toast.is-out { animation: toast-out .22s ease forwards; }
.toast-ic {
  width: 26px; height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.toast-ok .toast-ic { background: var(--green-soft); color: var(--green); }
.toast-error .toast-ic { background: var(--red-soft); color: var(--red); }
.toast-msg { font: 500 .875rem/1.45 var(--font-body); color: var(--ink); flex: 1; padding-top: 2px; }
.toast-x {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--faint);
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  flex: none;
}
.toast-x:hover { color: var(--ink); background: var(--stone-soft); }

/* --------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, .55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in .15s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(28, 25, 23, .3);
  max-width: 430px;
  width: 100%;
  padding: 26px;
  animation: pop .18s ease;
}
.modal-title { font: 700 1.15rem var(--font-head); margin: 0 0 8px; letter-spacing: -.01em; }
.modal-text { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: 0 0 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------- animations */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------- responsive */
@media (pointer: coarse) {
  .btn-sm { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 1020px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 859px) {
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 270px;
    max-width: 84vw;
    z-index: 130;
    transform: translateX(-103%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s;
  }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 0 20px 60px rgba(28, 25, 23, .35); }
  .hamburger { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .view { padding: 16px; }
  .card { padding: 18px; }
  .booking-head { flex-wrap: wrap; row-gap: 6px; }
  .booking-date { order: 5; }
  .upload-slot { flex-direction: column; }
  .stat-cols, .stat-row { grid-template-columns: 100px 1fr 38px; }
  .svc-icon-field { width: 150px; }
}

@media (max-width: 560px) {
  .topbar-link-label { display: none; }
  .topbar-actions .btn-sm { padding: 0 11px; }
  .grid2 { grid-template-columns: 1fr; }
  .stats-grid { gap: 10px; }
  .test-row { flex-direction: column; align-items: stretch; }
  .booking-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
