/* BookDesk styles. Sample software by ToolRank Studio. */
:root {
  --navy-950: #071530;
  --navy-900: #0b1f44;
  --navy-800: #0f2a5f;
  --navy-700: #1e3a8a;
  --blue-600: #1d4ed8;
  --blue-500: #2563eb;
  --blue-300: #93c5fd;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --border: #dde4ef;
  --border-strong: #c5d0e2;
  --text: #0f1b33;
  --muted: #55627a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #e6eeff;
  --on-primary: #ffffff;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #9a5b00;
  --warning-soft: #fff4dc;
  --closed: repeating-linear-gradient(135deg, rgba(15, 42, 95, .045) 0 6px, rgba(15, 42, 95, .085) 6px 12px);
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, .06), 0 1px 3px rgba(15, 27, 51, .05);
  --shadow: 0 4px 12px rgba(15, 27, 51, .08), 0 1px 3px rgba(15, 27, 51, .06);
  --shadow-lg: 0 20px 50px rgba(7, 21, 48, .25);
  --radius: 14px;
  --radius-sm: 9px;
  --hour: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #08122a;
  --surface: #0e1c3a;
  --surface-2: #112246;
  --surface-3: #162a54;
  --border: #20366a;
  --border-strong: #2d4683;
  --text: #e7eefb;
  --muted: #9fb0cf;
  --primary: #6ea8ff;
  --primary-hover: #93bfff;
  --primary-soft: #16305f;
  --on-primary: #061230;
  --danger: #ff8a8a;
  --danger-soft: #3a1520;
  --success: #6fdc95;
  --success-soft: #0f3326;
  --warning: #ffcb6b;
  --warning-soft: #3a2c0c;
  --closed: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 6px, rgba(255, 255, 255, .055) 6px 12px);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy-800); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
[data-theme="dark"] :focus-visible { outline-color: var(--blue-300); }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: linear-gradient(to right, var(--navy-950) 248px, transparent 248px); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #dbe6ff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: .2px; }
.brand-text small { color: #9fb6e6; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #c4d3f2; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(110, 168, 255, .16); color: #fff; box-shadow: inset 3px 0 0 #6ea8ff; }
.nav a:focus-visible { outline-color: #93c5fd; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.privacy-note { margin: 0; font-size: 12.5px; color: #9fb6e6; padding: 0 8px; }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; font-weight: 700; white-space: nowrap; }
.search {
  flex: 1; max-width: 460px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 10px;
  box-shadow: var(--shadow-sm);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 0; outline: none; }
.search kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.offline-badge { font-size: 12px; font-weight: 600; color: var(--warning); background: var(--warning-soft); padding: 4px 10px; border-radius: 99px; }
main { flex: 1; padding: 26px 28px 40px; outline: none; max-width: 1400px; width: 100%; }
.site-footer { padding: 18px 28px 26px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.site-footer a { color: var(--primary); }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="dark"] .btn-danger-solid { color: #2a0606; }
.btn-ghost-light { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.14); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--surface-3); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.input:user-invalid { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 16px; }
.card-head .spacer + * { margin-left: auto; }
.card-body { padding: 16px 20px; }
.section-title { font-size: 16px; margin-bottom: 12px; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .label .ic { color: var(--primary); }
.stat .value { font-size: 28px; font-weight: 750; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat.feature { background: linear-gradient(135deg, var(--navy-800), var(--blue-600)); border-color: transparent; color: #fff; }
.stat.feature .label, .stat.feature .sub { color: #cfe0ff; }
.stat.feature .label .ic { color: #fff; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-grid > .stack { gap: 20px; }

.appt-list { list-style: none; margin: 0; padding: 0; }
.appt-item {
  display: grid; grid-template-columns: 86px 4px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.appt-item:first-child { border-top: 0; }
.appt-item .time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.appt-item .time small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.appt-item .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c, var(--primary)); }
.appt-item .who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-item .what { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-item .open { all: unset; cursor: pointer; display: block; min-width: 0; border-radius: 6px; }
.appt-item .open:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 3px; }
.appt-item .open:hover .who { color: var(--primary); }
.price { font-weight: 650; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); text-transform: capitalize; }
.badge.completed { background: var(--success-soft); color: var(--success); }
.badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.booked { background: var(--primary-soft); color: var(--primary); }
.badge.noshow { background: var(--warning-soft); color: var(--warning); }

.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 170px; padding: 16px 20px 8px; }
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .barv { width: 100%; max-width: 38px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--blue-500), var(--navy-700)); min-height: 3px; }
[data-theme="dark"] .chart .barv { background: linear-gradient(180deg, #8ab9ff, #3b6fd8); }
.chart .col.today .barv { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.chart .amt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .day { font-size: 12px; font-weight: 600; color: var(--muted); }
.chart .col.today .day { color: var(--primary); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty .row { justify-content: center; margin-top: 14px; }
.welcome { padding: 32px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; border: 0; }
.welcome h2 { font-size: 24px; margin-bottom: 8px; }
.welcome p { color: #cfe0ff; margin: 0 0 16px; }
.welcome ol { margin: 0; padding-left: 20px; color: #dbe6ff; }
.welcome ol li { margin: 6px 0; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-toolbar h2 { font-size: 19px; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.cal-wrap { overflow-x: auto; border-radius: var(--radius); }
.cal { min-width: 0; background: var(--surface); }
.cal.week { min-width: 820px; }
.cal-head, .cal-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.cal-dayhead {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-left: 1px solid var(--border);
}
.cal-dayhead:focus-visible { outline: 3px solid var(--blue-500); outline-offset: -3px; }
.cal-dayhead span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.cal-dayhead strong { font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.cal-dayhead.is-today strong { background: var(--primary); color: var(--on-primary); }
.cal-dayhead small { font-size: 11px; color: var(--muted); }
.cal-body { position: relative; }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-times span:first-child { transform: none; }
.cal-col {
  position: relative; border-left: 1px solid var(--border);
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--border) 50%, transparent) 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
}
.cal-col.is-today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.cal-closed { position: absolute; left: 0; right: 0; background: var(--closed); pointer-events: none; }
.cal-slot { position: absolute; left: 0; right: 0; border: 0; background: transparent; cursor: pointer; padding: 0; }
.cal-slot:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.cal-slot:hover::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--primary); font-weight: 700; }
.cal-appt {
  position: absolute; z-index: 2; overflow: hidden; text-align: left; cursor: pointer;
  border: 0; border-left: 4px solid var(--c); border-radius: 8px; padding: 4px 8px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: var(--text); font-size: 12.5px; line-height: 1.3;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.cal-appt:hover { box-shadow: var(--shadow); z-index: 4; }
.cal-appt .t { font-weight: 700; font-variant-numeric: tabular-nums; display: block; }
.cal-appt .n { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt .s { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt.compact { display: flex; align-items: center; gap: 6px; padding: 2px 8px; }
.cal-appt.compact .t, .cal-appt.compact .n { display: inline; white-space: nowrap; }
.cal-appt.compact .n { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-appt.cancelled { opacity: .55; }
.cal-appt.cancelled .n { text-decoration: line-through; }
.cal-appt.completed .t::after { content: " ✓"; color: var(--success); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #e53935; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e53935; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
.client-name { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--c, var(--navy-700)); flex: none; }
.contact { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.contact a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.contact a:hover { color: var(--primary); text-decoration: underline; }
.contact .ic { width: 14px; height: 14px; color: var(--muted); }
.notes-cell { max-width: 280px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.filter { max-width: 320px; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.service-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--c); }
.service-card h3 { font-size: 16px; }
.service-card .meta { display: flex; gap: 14px; color: var(--muted); font-size: 13.5px; }
.service-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.service-card .meta .ic { width: 15px; height: 15px; }
.service-card .big { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.service-card .row { margin-top: auto; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hours { display: grid; grid-template-columns: 130px 1fr 1fr; gap: 8px 12px; align-items: center; }
.hours .day { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hours input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .card-head { border-bottom-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.danger-zone .card-head h2 { color: var(--danger); }

/* ---------- Search ---------- */
.results-group { margin-bottom: 20px; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.result-row:first-child { border-top: 0; }
.result-row button.open { all: unset; cursor: pointer; flex: 1; min-width: 0; border-radius: 6px; }
.result-row button.open:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 3px; }
.result-row .title { font-weight: 600; }
.result-row .desc { color: var(--muted); font-size: 13px; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
[data-theme="dark"] mark { background: #7a5a00; }

/* ---------- Modal ---------- */
.modal {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal-sm { width: min(440px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(5, 14, 33, .55); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; }
.modal-head .icon-btn { margin-left: auto; width: 36px; height: 36px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }
.alert { padding: 10px 12px; border-radius: 9px; font-size: 13.5px; }
.alert.warn { background: var(--warning-soft); color: var(--warning); }
.alert.info { background: var(--primary-soft); color: var(--primary); }
.history { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 10px; max-height: 210px; overflow-y: auto; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13.5px; }
.history li:first-child { border-top: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.swatches input:focus-visible + span { outline: 3px solid var(--blue-500); outline-offset: 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--navy-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 360px; animation: pop .2s ease-out; border-left: 4px solid #6ea8ff; }
.toast.error { border-left-color: #ff6b6b; }
.toast.success { border-left-color: #4ade80; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0;
    background: var(--navy-900); box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; min-height: 52px; justify-content: center; }
  .nav a[aria-current="page"] { box-shadow: inset 0 3px 0 #6ea8ff; }
  .nav .ic { width: 22px; height: 22px; }
  .content { padding-bottom: 72px; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .page-title { font-size: 18px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .search kbd { display: none; }
  .topbar-actions { margin-left: auto; }
  main { padding: 18px 14px 28px; }
  .site-footer { padding: 16px 14px 20px; }
  .hide-sm { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toasts { left: 14px; right: 14px; bottom: 84px; }
  .appt-item { grid-template-columns: 70px 4px minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .data-actions { grid-template-columns: 1fr; }
  .hours { grid-template-columns: 1fr 1fr 1fr; }
  table.data .hide-md { display: none; }
  .welcome { padding: 22px; }
}
@media (max-width: 520px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 22px; }
  .cal-toolbar h2 { min-width: 0; font-size: 17px; flex-basis: 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .site-footer, .toasts { display: none !important; }
  .app { display: block; }
}
