/* Veloria Salon OS - design system (no framework, no CDN).
   Tokens: charcoal #25252B, champagne gold #C4A777, warm ivory #FAF8F5, muted rose #DCC4C5, slate #62636A.
   Gold is used for accents and borders; text-on-ivory uses the darker --gold-ink for WCAG AA contrast.
   Fonts: drop Manrope/Inter .woff2 files into assets/fonts to use them; system fallbacks otherwise. */

@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Variable.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Variable.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --charcoal: #25252B;
  --gold: #C4A777;
  --gold-ink: #7A5F2E;
  --ivory: #FAF8F5;
  --rose: #DCC4C5;
  --rose-soft: #F4EAEA;
  --white: #FFFFFF;
  --slate: #62636A;

  --bg: var(--ivory);
  --surface: var(--white);
  --surface-2: #F3EFE9;
  --text: var(--charcoal);
  --text-muted: #5B5C63;
  --border: #E6E0D7;
  --border-strong: #CFC6B8;
  --accent: var(--gold);
  --accent-ink: var(--gold-ink);
  --primary-bg: var(--charcoal);
  --primary-fg: var(--ivory);
  --focus: #9A7A3F;

  --success: #2F6B4F; --success-bg: #E4F1EA;
  --warning: #7A5200; --warning-bg: #FBF0D9;
  --danger: #A33A3A;  --danger-bg: #F8E3E3;
  --info: #2D4E73;    --info-bg: #E5EDF6;

  --font-head: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(37, 37, 43, .05), 0 6px 20px rgba(37, 37, 43, .06);
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: #17171B;
  --surface: #202026;
  --surface-2: #26262D;
  --text: #F1EEE9;
  --text-muted: #B3B2B8;
  --border: #33333B;
  --border-strong: #45454F;
  --accent-ink: #D9C196;
  --primary-bg: var(--gold);
  --primary-fg: #1B1B20;
  --focus: #D9C196;
  --success: #8FD1AE; --success-bg: #1F3329;
  --warning: #F0C977; --warning-bg: #3A2F17;
  --danger: #F0A3A3;  --danger-bg: #3D2222;
  --info: #A9C6EA;    --info-bg: #1F2A38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; margin-top: 1.4em; }
p { margin: 0 0 .9em; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.muted { color: var(--text-muted); }
.lead { max-width: 70ch; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--charcoal) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--charcoal); color: #EDE8DF; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 22px; }
.sidebar .brand strong { display: block; font-family: var(--font-head); font-size: .98rem; color: var(--white); }
.sidebar .brand span { font-size: .78rem; color: #BDB6AA; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: #E4DED3; text-decoration: none; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: var(--white); }
.sidebar nav a[aria-current="page"] { background: rgba(196, 167, 119, .18); color: var(--white); box-shadow: inset 3px 0 0 var(--gold); }
.nav-switch { margin-top: 24px; padding: 0 12px; font-size: .85rem; }
.nav-switch a { color: var(--gold) !important; padding: 0 !important; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.topbar-title { font-family: var(--font-head); font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .who { color: var(--text-muted); font-size: .9rem; }
.content { padding: 28px; max-width: 1240px; width: 100%; }
/* salon management, stylist and client spaces use the full screen width */
[data-portal] .content { max-width: none; box-sizing: border-box; }
[data-portal="admin"] .kpis, [data-portal="staff"] .kpis, [data-portal="client"] .kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.btn-icon.menu-toggle { display: none; }
.banner { padding: 10px 28px; font-size: .92rem; }
.banner-warning { background: var(--warning-bg); color: var(--warning); }

[hidden] { display: none !important; }

/* ---------- icons (CSS masks, no icon font) ---------- */
.ico { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; flex: none; }
.ico-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
.ico-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21c0-4 3-6 7-6s7 2 7 6'/%3E%3Cpath d='M16 4a4 4 0 0 1 0 8M22 21c0-3-2-5-4-6'/%3E%3C/svg%3E"); }
.ico-shield { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 2l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V5z'/%3E%3C/svg%3E"); }
.ico-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 22s7-7 7-12a7 7 0 0 0-14 0c0 5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
.ico-sliders { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
.ico-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); }
.ico-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); }
.ico-menu { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
.ico-receipt { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M5 3h14v18l-3-2-2 2-2-2-2 2-2-2-3 2z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E"); }
.ico-inbox { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 13l3-8h12l3 8v6H3z'/%3E%3Cpath d='M3 13h5l1 3h6l1-3h5'/%3E%3C/svg%3E"); }
.ico-tag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 12V3h9l9 9-9 9z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E"); }
.ico-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 13A9 9 0 1 1 11 3a7 7 0 0 0 10 10z'/%3E%3C/svg%3E"); }

.ico-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico-scissors { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M20 4L8.1 15.9M14.5 14.5L20 20M8.1 8.1L12 12'/%3E%3C/svg%3E"); }
.ico-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ico-layers { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3l9 5-9 5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E"); }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.back { display: inline-block; font-size: .88rem; margin-bottom: 6px; text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 680px; }
.card-quiet { background: var(--surface-2); box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > .card:last-child { margin-bottom: 20px; }
.empty { color: var(--text-muted); padding: 8px 0; margin: 0; }
.card.flush .empty { padding: 22px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
a.kpi[href]:hover { border-color: var(--gold); }
.kpi-label { font-size: .82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; }
.kpi-def { font-size: .8rem; color: var(--text-muted); }
.kpi-warn { border-color: var(--warning); }

.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.checklist .is-done .check { background: var(--success); border-color: var(--success); box-shadow: inset 0 0 0 3px var(--surface); }
.checklist .is-done > span:not(.check):not(.sr-only) { color: var(--text-muted); }
.checklist .is-bad .check { background: var(--danger); border-color: var(--danger); box-shadow: inset 0 0 0 3px var(--surface); }
.feed { list-style: none; padding: 0; margin: 0 0 10px; }
.feed li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.feed li .muted { font-size: .82rem; }
.pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.meta dt { color: var(--text-muted); font-size: .9rem; }
.meta dd { margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table a { text-decoration: none; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-gold { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--accent-ink); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
label { font-weight: 600; font-size: .9rem; }
.opt { font-weight: 400; color: var(--text-muted); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%;
}
input[readonly] { background: var(--surface-2); color: var(--text-muted); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--charcoal); margin: 2px 0 0; flex: none; }
[data-theme="dark"] input[type="checkbox"], [data-theme="dark"] input[type="radio"] { accent-color: var(--gold); }
.help { font-size: .84rem; color: var(--text-muted); margin: 0; }
.field-error { font-size: .86rem; color: var(--danger); margin: 0; font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.check-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 400; cursor: pointer; margin-bottom: 8px; }
.check-card:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.perm-group { border: 0; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.perm-group legend { grid-column: 1 / -1; font-family: var(--font-head); color: var(--accent-ink); text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 200px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { width: auto; min-height: 36px; padding: 6px 8px; }
.w-xs { width: 70px !important; min-height: 36px !important; padding: 6px 8px !important; }
.pw { position: relative; }
.pw input { padding-right: 72px !important; }
.pw-toggle { position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; background: transparent; color: var(--accent-ink); font-weight: 600; cursor: pointer; padding: 0 10px; }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem !important; letter-spacing: .2em; }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem !important; }
.hours { display: flex; flex-direction: column; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: center; }
.hours-day { font-weight: 600; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; border-radius: var(--radius-sm); padding: 10px 18px; min-height: 44px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(1.15); color: var(--primary-fg); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--gold); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); color: #fff; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-icon { background: transparent; border: 0; color: var(--text); width: 40px; height: 40px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icon:hover { background: var(--surface-2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.actions-col { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.danger-zone { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.pager { display: flex; justify-content: space-between; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
@media (min-width: 900px) { .tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; } }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 700; padding: 5px 10px; cursor: pointer; min-height: 32px; }
.lang-switch button[aria-current="true"] { background: var(--charcoal); color: var(--ivory); }
[data-theme="dark"] .lang-switch button[aria-current="true"] { background: var(--gold); color: #1B1B20; }

/* ---------- auth / installer ---------- */
.auth-body { min-height: 100vh; background:
  radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--rose) 45%, transparent), transparent 70%),
  radial-gradient(900px 400px at -10% 110%, color-mix(in srgb, var(--gold) 25%, transparent), transparent 70%), var(--bg); }
.auth-wrap, .install-wrap { max-width: 460px; margin: 0 auto; padding: 40px 18px; }
.install-wrap { max-width: 760px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.brand-lg { display: inline-flex; gap: 10px; align-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-links { margin: 18px 0 0; text-align: center; font-size: .92rem; }
.auth-foot { text-align: center; color: var(--text-muted); font-size: .8rem; margin-top: 24px; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--text-muted); }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps span { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); font-weight: 700; font-size: .75rem; }
.steps .done span { background: var(--success); border-color: var(--success); color: #fff; }
.steps .now { color: var(--text); font-weight: 600; }
.steps .now span { background: var(--charcoal); border-color: var(--charcoal); color: var(--ivory); }
.portal-links { display: grid; gap: 10px; margin-top: 18px; }
.portal-link { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.portal-link:hover { border-color: var(--gold); color: var(--text); }
.portal-link span { color: var(--text-muted); font-size: .88rem; }
.error-card { text-align: center; }
.error-code { font-family: var(--font-head); font-size: 3rem; font-weight: 800; color: var(--gold); margin: 0; }
.debug { text-align: left; white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); font-size: .8rem; }
.howto { padding-left: 20px; }
.howto li { margin-bottom: 12px; }
.secret code { font-size: 1.05rem; letter-spacing: .08em; padding: 8px 12px; display: inline-block; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes code { font-size: 1rem; display: block; text-align: center; padding: 8px; }
.next-list { padding-left: 20px; color: var(--text-muted); }

/* ---------- Phase 2: operations ---------- */
.section-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 8px 0 12px; }
.padded { padding: 18px 22px 0; margin-bottom: 12px; }
.card-head.padded { padding: 16px 22px 0; }
.flush-top { margin-top: 0; }
.is-inactive td { opacity: .6; }
.badge-lg { font-size: .88rem; padding: 4px 12px; }
.quote { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; color: var(--text-muted); font-style: italic; margin: 8px 0; }
.link-btn { background: none; border: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.12); }
.swatch-C4A777 { background: #C4A777; }
.swatch-bg-C4A777 { --emp: #C4A777; }
.swatch-8FA9C4 { background: #8FA9C4; }
.swatch-bg-8FA9C4 { --emp: #8FA9C4; }
.swatch-C48F9A { background: #C48F9A; }
.swatch-bg-C48F9A { --emp: #C48F9A; }
.swatch-8FC4A4 { background: #8FC4A4; }
.swatch-bg-8FC4A4 { --emp: #8FC4A4; }
.swatch-B49AD0 { background: #B49AD0; }
.swatch-bg-B49AD0 { --emp: #B49AD0; }
.swatch-D0A97A { background: #D0A97A; }
.swatch-bg-D0A97A { --emp: #D0A97A; }
.swatch-7FB8B8 { background: #7FB8B8; }
.swatch-bg-7FB8B8 { --emp: #7FB8B8; }
.swatch-C7B46A { background: #C7B46A; }
.swatch-bg-C7B46A { --emp: #C7B46A; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-pick { cursor: pointer; display: inline-flex; }
.swatch-pick input { position: absolute; opacity: 0; }
.swatch-pick .swatch { width: 26px; height: 26px; }
.swatch-pick input:checked + .swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.swatch-pick input:focus-visible + .swatch { outline: 3px solid var(--focus); outline-offset: 3px; }
.sched { display: grid; gap: 6px; }
.sched-head, .sched-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px; align-items: center; }
.sched-head { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.pair { display: flex; gap: 6px; }
.pair input { min-height: 38px !important; padding: 6px 8px !important; }
.staff-row { display: grid; grid-template-columns: 1fr 110px 110px; gap: 8px; align-items: center; margin-bottom: 6px; }
.staff-row input:not([type="checkbox"]) { min-height: 36px !important; padding: 6px 8px !important; }
.appt-list { list-style: none; padding: 0; margin: 0; }
.appt-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.appt-list li > span:nth-child(2) { grid-column: 1; color: var(--text-muted); font-size: .9rem; }
.appt-list li > .badge, .appt-list li > .row-end { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.row-end { display: flex; gap: 8px; align-items: center; }
.appt-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.appt-card p { margin-bottom: 6px; }
.pick-list { list-style: none; padding: 0; margin: 0; }
.pick-list a { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; text-decoration: none; color: var(--text); }
.pick-list a:hover { border-color: var(--gold); }
.svc-pick { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 4px; }

/* booking flow */
.book-wrap { max-width: 720px; margin: 0 auto; padding: 32px 18px; }
.svc-group { border: 0; padding: 0; margin: 0 0 18px; }
.svc-group legend { font-family: var(--font-head); font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.svc-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; font-weight: 400; cursor: pointer; }
.svc-card:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); }
.svc-main { display: flex; flex-direction: column; }
.svc-main .muted { font-size: .86rem; }
.svc-meta { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; white-space: nowrap; }
.svc-meta .muted { font-weight: 400; font-size: .84rem; }
.staff-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.summary-line { color: var(--text-muted); }
.day-strip { position: relative; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.day { position: relative; flex: none; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.day.is-current { background: var(--charcoal); color: var(--ivory); border-color: var(--charcoal); }
[data-theme="dark"] .day.is-current { background: var(--gold); color: #1B1B20; }
.day.is-full { color: var(--text-muted); text-decoration: line-through; }
.slot-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { font: inherit; font-weight: 600; min-height: 46px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.slot:hover, .slot:focus-visible { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.summary-list .total { font-weight: 700; }
.policy { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; }
.policy h2 { font-size: .95rem; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* day calendar */
.cal-head { align-items: center; }
.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-toolbar input, .cal-toolbar select { min-height: 34px !important; padding: 5px 8px !important; width: auto; }
.cal { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; box-shadow: var(--shadow); }
.cal:not(.is-ready) .cal-col-body > * { position: static !important; }
.cal-times { flex: 0 0 64px; border-right: 1px solid var(--border); }
.cal-cols { display: flex; flex: 1; overflow-x: auto; }
.cal-col { flex: 1 0 170px; border-right: 1px solid var(--border); }
.cal-col:last-child { border-right: 0; }
.cal-col-head { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.cal-col-body { position: relative; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); }
.cal-times .cal-col-body { background: none; }
.cal-hour { position: absolute; right: 8px; font-size: .74rem; color: var(--text-muted); transform: translateY(-50%); }
.cal-hour:first-child { transform: none; }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.cal-work { position: absolute; left: 0; right: 0; background: var(--surface); }
.cal-appt { position: absolute; left: 4px; right: 4px; border-radius: 6px; padding: 4px 8px; font-size: .78rem; line-height: 1.3; overflow: hidden; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--emp, #C4A777) 26%, var(--surface)); border-left: 4px solid var(--emp, #C4A777); box-shadow: 0 1px 2px rgba(0,0,0,.08); z-index: 2; display: flex; flex-direction: column; }
.cal-appt strong { font-size: .82rem; }
.cal-appt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt-time { color: var(--text-muted); font-size: .72rem; }
.cal-appt.has-clean { background-image: linear-gradient(to top, var(--surface-2) var(--clean), transparent var(--clean)); }
.cal-appt[data-draggable="1"] { cursor: grab; touch-action: none; }
.cal-appt.is-dragging { cursor: grabbing; opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.2); z-index: 5; }
.cal-appt.st-completed { opacity: .7; }
.cal-appt.st-no_show { opacity: .55; text-decoration: line-through; }
.cal-appt.st-arrived, .cal-appt.st-checked_in, .cal-appt.st-in_progress { outline: 2px solid var(--success); }
.cal-appt.st-pending, .cal-appt.st-awaiting_deposit { border-left-style: dashed; }
.cal-appt.is-held { background: repeating-linear-gradient(45deg, var(--surface-2) 0 5px, var(--surface) 5px 10px); border-left-color: var(--text-muted); }
.cal-proc { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.55) 4px 8px); pointer-events: none; }
[data-theme="dark"] .cal-proc { background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(0,0,0,.35) 4px 8px); }
.cal-help { margin-bottom: 20px; }
.cal-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: var(--ivory); padding: 10px 16px; border-radius: var(--radius-sm); z-index: 50; box-shadow: var(--shadow); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .btn-icon.menu-toggle { display: inline-flex; }
  .shell { background: var(--bg); }
  .content { padding: 18px; }
  .topbar { padding: 10px 14px; }
  .topbar .who { display: none; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .sched-head { display: none; }
  .sched-row { grid-template-columns: 1fr; }
  .staff-row { grid-template-columns: 1fr 1fr; }
  .staff-row .check { grid-column: 1 / -1; }
  .svc-card { grid-template-columns: auto 1fr; }
  .svc-meta { grid-column: 2; align-items: flex-start; }
  .auth-card { padding: 22px; }
  .filters input, .filters select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ---------- Phase 3: POS, documents, inbox ---------- */
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.feed .badge { align-self: flex-start; }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--charcoal); font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; }
.form.compact { gap: 10px; margin-top: 10px; }
.form.compact .field { margin: 0; }
.card hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.line-edit summary, .card details > summary { cursor: pointer; color: var(--accent-ink); font-size: .85rem; font-weight: 600; margin-top: 4px; }
.table tfoot td { border-top: 1px solid var(--border); padding-top: 8px; padding-bottom: 8px; }
.table .total-row td, .doc-totals .total-row td { font-size: 1.05rem; border-top: 2px solid var(--border-strong); }
fieldset.pills { border: 0; margin: 0 0 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem; }
.pill:has(input:checked) { border-color: var(--gold); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--gold); }
.pill input { accent-color: var(--charcoal); }
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-list li { border-bottom: 1px solid var(--border); }
.conv-list li:last-child { border-bottom: 0; }
.conv-list a { display: flex; flex-direction: column; gap: 3px; padding: 14px 20px; color: var(--text); text-decoration: none; }
.conv-list a:hover { background: var(--surface-2); }
.conv-list .is-unread a { box-shadow: inset 3px 0 0 var(--gold); }
.conv-list .is-unread strong { font-weight: 800; }
.conv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conv-when { margin-left: auto; font-size: .82rem; }
.conv-subject { font-weight: 600; font-size: .92rem; }
.conv-preview { font-size: .88rem; overflow-wrap: anywhere; }
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.msg { max-width: 86%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.msg-in { align-self: flex-start; background: var(--surface-2); }
.msg-out { align-self: flex-end; border-color: var(--gold); }
.msg-note { align-self: center; max-width: 100%; width: 100%; background: var(--warning-bg); border-style: dashed; }
.msg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.msg-subject { font-weight: 600; margin: 0 0 4px; }
.msg-body { overflow-wrap: anywhere; line-height: 1.5; }
.doc { max-width: 760px; margin: 24px auto; padding: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.doc p { margin: 2px 0; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--charcoal); margin-bottom: 18px; }
.doc-salon { font-family: var(--font-head); font-size: 1.6rem; margin: 0 0 6px; }
.doc-meta { text-align: right; }
.doc-meta h2 { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 1.1rem; }
.doc-client { margin-bottom: 18px !important; }
.doc-table, .doc-totals { width: 100%; border-collapse: collapse; }
.doc-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); padding: 8px 6px; }
.doc-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-totals { width: auto; min-width: 320px; margin: 16px 0 0 auto; }
.doc-totals td { padding: 5px 6px; }
.doc-foot { margin-top: 28px !important; text-align: center; color: var(--text-muted); }
.print-body { background: var(--bg); }
@media (max-width: 640px) { .doc { padding: 20px; margin: 0; border: 0; } .doc-meta { text-align: left; } .doc-totals { min-width: 0; width: 100%; } .msg { max-width: 100%; } }

@media print {
  .sidebar, .topbar, .actions, .lang-switch, .no-print { display: none !important; }
  .card { box-shadow: none; border: 0; }
  .print-body { background: #fff; }
  .doc { border: 0; margin: 0; padding: 0; max-width: none; color: #000; }
}
.card fieldset.field + fieldset.field { margin-top: 16px; }

/* ---------- Phase 4: business management ---------- */
.ico-box { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 7l9-4 9 4v10l-9 4-9-4z'/%3E%3Cpath d='M3 7l9 4 9-4M12 11v10'/%3E%3C/svg%3E"); }
.ico-gift { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='8' width='18' height='13' rx='1.5'/%3E%3Cpath d='M3 12h18M12 8v13M12 8c-2-4-6-4-6-1.5S9 8 12 8zM12 8c2-4 6-4 6-1.5S15 8 12 8z'/%3E%3C/svg%3E"); }
.ico-mega { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10v4h4l8 5V5L7 10z'/%3E%3Cpath d='M19 9a4 4 0 0 1 0 6M7 14l1.5 6h3L10 15'/%3E%3C/svg%3E"); }
.ico-percent { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M19 5L5 19'/%3E%3Ccircle cx='7' cy='7' r='2.5'/%3E%3Ccircle cx='17' cy='17' r='2.5'/%3E%3C/svg%3E"); }
.ico-dollar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 2v20M17 6.5C16 5 14.3 4.5 12 4.5c-3 0-4.5 1.5-4.5 3.5 0 4.5 9.5 2.5 9.5 7.5 0 2-1.8 3.5-5 3.5-2.4 0-4.2-.8-5-2.5'/%3E%3C/svg%3E"); }
.ico-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M8 17v-5M13 17V8M18 17v-9'/%3E%3C/svg%3E"); }

.neg { color: var(--danger); }
.pos { color: var(--success); }
.label-spacer { display: block; height: 1.45em; }
.padded-alert { margin: 0 20px 12px; }
.tier-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.check-grid .pair { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.check-grid .pair input[type="number"], .check-grid .pair input[inputmode] { width: 80px; }
.benefit-use { margin-top: 6px; flex-wrap: wrap; }
.is-estimate td { font-style: italic; color: var(--text-muted); }

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.report-list li:last-child { border-bottom: 0; }
.report-note { margin-bottom: 12px; }
.report-table td, .report-table th { white-space: nowrap; }
.bar-cell { width: 28%; min-width: 120px; }
.bar { display: block; height: 10px; width: var(--w, 0); background: linear-gradient(90deg, var(--gold), var(--gold-dark, var(--gold))); border-radius: 5px; }
.doc-wide { max-width: 1100px; }

.gift-doc { max-width: 520px; margin: 32px auto; padding: 36px; text-align: center; border: 2px solid var(--gold); border-radius: 18px; background: var(--surface); color: var(--text); }
.gift-salon { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 4px; }
.gift-title { text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; color: var(--text-muted); margin: 0 0 22px; }
.gift-amount { font-family: var(--font-head); font-size: 2.8rem; font-weight: 700; margin: 0 0 18px; }
.gift-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.35rem; letter-spacing: .12em; padding: 10px 16px; border: 1px dashed var(--border-strong); border-radius: 8px; display: inline-block; margin: 0 0 16px; }
@media print {
  .gift-doc { border-color: #000; margin: 0 auto; }
  .bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.filters { align-items: center; }
.filters label { display: inline-block; width: auto; margin: 0; font-weight: 600; }
.filters input[type="date"] { min-width: 150px; flex: 0 1 auto; }
.filters input:not([type="checkbox"]):not([type="radio"]), .filters select { width: auto; }
.table th.t-right { text-align: right; }
.gift-doc .quote { border-left: 0; padding: 0; } .gift-doc .actions { justify-content: center; } .gift-code code { background: none; }

/* ---------- Phase 5: AI and insights ---------- */
.ico-spark { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%3E%3Cpath d='M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E"); }
.ico-trend { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M15 7h6v6'/%3E%3C/svg%3E"); }
.ai-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); margin-top: 8px; }
.ai-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; color: var(--text-muted); margin-right: 4px; }
.ai-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .ai-layout { grid-template-columns: 1fr; } .ai-history { order: 2; } }
.ai-history .feed li.is-current a { font-weight: 700; }
.ai-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ai-msg { padding: 12px 16px; border-radius: 14px; max-width: 92%; line-height: 1.55; }
.ai-msg p { margin: 0 0 8px; } .ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul, .ai-msg ol { margin: 4px 0 8px; padding-left: 20px; }
.ai-msg .md-h { font-weight: 700; margin-top: 6px; }
.ai-user { align-self: flex-end; background: var(--charcoal); color: #F4EFE6; }
.ai-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.ai-starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.slot-list { list-style: none; padding: 0; margin: 0; }
.slot-form { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.plain-list { margin: 0; padding-left: 18px; } .plain-list li { margin: 4px 0; }

/* Phase 6: plans, subscription, platform administration */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 14px 0 6px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.plan-card.is-current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.plan-card h3 { margin: 0; font-family: var(--font-head); }
.plan-price { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.plan-price small { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.plan-card ul { list-style: none; padding: 0; margin: 0; font-size: .92rem; display: flex; flex-direction: column; gap: 3px; }
.plan-card ul li::before { content: "✓ "; color: var(--gold-ink); font-weight: 700; }
.plan-card form { margin-top: auto; }
.interval-switch { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.meter > span { display: block; height: 100%; width: var(--w, 0); background: var(--gold); }
.meter.is-full > span { background: var(--danger); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); margin-right: 6px; vertical-align: middle; }
.status-dot.ok { background: var(--success); }
.status-dot.warn { background: #C08A1E; }
.status-dot.bad { background: var(--danger); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.check-list li:last-child { border-bottom: 0; }
.check-list .fix { color: var(--text-muted); font-size: .9rem; display: block; }
.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 26px; }
.narrow { max-width: 720px; }
.legal-wrap { max-width: 820px; margin: 0 auto; padding: 40px 18px; }

/* Sidebar groups that slide open and closed */
.nav-group { margin: 2px 0; }
.nav-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px 6px; background: none; border: 0; border-radius: var(--radius-sm); color: #BDB6AA; font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-align: left; }
.nav-group-head:hover { color: var(--white); background: rgba(255, 255, 255, .04); }
.nav-group-head:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav-group-head > span:first-child { flex: 1; }
.nav-count-head { margin-left: 0; font-size: .7rem; letter-spacing: 0; }
.nav-group.is-open .nav-count-head { display: none; }
.nav-chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s ease; margin-right: 4px; }
.nav-group.is-open .nav-chevron { transform: rotate(45deg); }
.nav-group-body { display: grid; grid-template-rows: 1fr; }
.nav-ready .nav-group-body { transition: grid-template-rows .28s ease, visibility 0s; }
.nav-group-body > ul { overflow: hidden; min-height: 0; }
.js .nav-group:not(.is-open) .nav-group-body { grid-template-rows: 0fr; visibility: hidden; }
.nav-ready .nav-group:not(.is-open) .nav-group-body { transition: grid-template-rows .28s ease, visibility 0s .28s; }
@media (prefers-reduced-motion: reduce) { .nav-ready .nav-group-body, .nav-ready .nav-group:not(.is-open) .nav-group-body, .nav-chevron { transition: none; } }
.demo-entry { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.demo-entry p { margin: 0 0 10px; }
.banner-demo { background: var(--info-bg); color: var(--info); }

/* Landing page: the four sign-in doors */
body.landing { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
body.landing > .alert { max-width: 1120px; margin: 16px auto 0; }
.lp-hero { position: relative; overflow: hidden; color: #F3EEE6; padding: 26px 24px 120px;
  background: radial-gradient(900px 420px at 85% -10%, rgba(196, 167, 119, .35), transparent 60%), radial-gradient(700px 380px at 0% 110%, rgba(220, 196, 197, .18), transparent 60%), linear-gradient(160deg, #1D1D22 0%, #25252B 55%, #2E2A26 100%); }
.lp-top { max-width: 980px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; letter-spacing: .14em; font-size: 1.05rem; }
.lp-hero .lang-switch button { color: #E4DED3; border-color: rgba(255, 255, 255, .2); background: transparent; }
.lp-hero .lang-switch button[aria-current="true"] { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
.lp-hero-text { max-width: 980px; margin: 64px auto 0; text-align: center; }
.lp-kicker { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border: 1px solid rgba(196, 167, 119, .5); border-radius: 999px; color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lp-hero h1 { margin: 0 auto; max-width: 760px; font-family: var(--font-head); font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.02em; color: #FFFFFF; }
.lp-lead { max-width: 640px; margin: 18px auto 0; font-size: 1.12rem; line-height: 1.55; color: #CFC8BC; }
.lp-main { flex: 1; width: 100%; max-width: 1028px; margin: -76px auto 0; padding: 0 24px 40px; box-sizing: border-box; position: relative; }
.lp-section { position: absolute; left: -9999px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 980px; margin: 0 auto; }
.lp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 20px 20px; box-shadow: 0 18px 40px -22px rgba(37, 37, 43, .45); transition: transform .18s ease, box-shadow .18s ease; }
.lp-card:hover { transform: translateY(-3px); box-shadow: 0 26px 50px -24px rgba(37, 37, 43, .55); }
.lp-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.lp-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, var(--gold), #A88A57); color: var(--charcoal); }
.lp-icon .ico { width: 22px; height: 22px; }
.lp-card-staff .lp-icon { background: linear-gradient(140deg, var(--rose), #C7A6A8); }
.lp-card-client .lp-icon { background: linear-gradient(140deg, #CFE0D6, #9FC2AE); }
.lp-card-platform .lp-icon { background: linear-gradient(140deg, #3A3A42, #25252B); color: var(--gold); }
.lp-step { font-family: var(--font-head); font-weight: 800; color: var(--border-strong); font-size: 1.1rem; }
.lp-card h3 { margin: 0 0 8px; font-family: var(--font-head); font-size: 1.22rem; }
.lp-does { margin: 0 0 18px; color: var(--text-muted); line-height: 1.5; font-size: .95rem; }
.lp-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.lp-who { margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); font-size: .9rem; line-height: 1.5; color: var(--text-muted); }
.lp-who strong { color: var(--text); }
.lp-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px auto 0; max-width: 760px; text-align: center; color: var(--text-muted); font-size: .92rem; }
.lp-note .ico { color: var(--gold-ink); }
.lp-foot { max-width: 980px; width: calc(100% - 48px); margin: 0 auto; padding: 18px 0 28px; box-sizing: border-box; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); }
.lp-foot a { color: var(--gold-ink); }
@media (max-width: 900px) { .lp-grid { grid-template-columns: 1fr; max-width: 460px; } }
@media (max-width: 560px) { .lp-grid { grid-template-columns: 1fr; } .lp-hero { padding-bottom: 100px; } .lp-hero-text { margin-top: 40px; } }
[data-theme="dark"] .lp-card { box-shadow: none; }
.lp-hero .lang-switch { border-color: rgba(255, 255, 255, .25); }

/* Landing page fits one screen: no vertical or horizontal scrolling on computers and tablets */
html:has(body.landing) { overflow-x: hidden; }
body.landing { overflow-x: hidden; }
@media (min-width: 901px) and (min-height: 521px) {
  html:has(body.landing) { overflow-y: auto; }
  body.landing { min-height: 100vh; min-height: 100dvh; }
  .lp-trial { margin-top: clamp(8px, 1.6vh, 18px); }
  .lp-trial .btn { min-height: clamp(36px, 4.6vh, 44px); padding-top: 6px; padding-bottom: 6px; }
  .lp-note { margin-top: clamp(10px, 2vh, 26px); }
  body.landing > .alert { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; margin: 0; width: min(720px, 92vw); }
  .lp-hero { flex: none; padding: clamp(12px, 2.6vh, 26px) 24px clamp(60px, 11.5vh, 120px); }
  .lp-hero-text { margin-top: clamp(10px, 4vh, 64px); }
  .lp-kicker { margin-bottom: clamp(6px, 1.4vh, 14px); }
  .lp-hero h1 { font-size: clamp(1.6rem, min(4.6vw, 5vh), 3.4rem); }
  .lp-lead { margin-top: clamp(6px, 1.8vh, 18px); font-size: clamp(.92rem, 1.5vh, 1.12rem); }
  .lp-main { flex: 1 1 auto; min-height: 0; margin-top: calc(-1 * clamp(48px, 9vh, 76px)); padding-bottom: clamp(8px, 2.6vh, 40px); }
  .lp-card { padding: clamp(12px, 2.3vh, 22px) 20px clamp(12px, 2vh, 20px); }
  .lp-card-head { margin-bottom: clamp(6px, 1.8vh, 18px); }
  .lp-icon { width: clamp(34px, 5vh, 46px); height: clamp(34px, 5vh, 46px); }
  .lp-card h3 { margin-bottom: clamp(4px, .8vh, 8px); font-size: clamp(1.05rem, 2vh, 1.22rem); }
  .lp-does { margin-bottom: clamp(8px, 1.8vh, 18px); font-size: clamp(.86rem, 1.4vh, .95rem); line-height: 1.45; }
  .lp-actions .btn { min-height: clamp(34px, 5vh, 44px); }
  .lp-who { margin-top: clamp(8px, 1.6vh, 16px); padding-top: clamp(6px, 1.4vh, 14px); font-size: clamp(.8rem, 1.35vh, .9rem); line-height: 1.45; }
  .lp-note { margin-top: clamp(8px, 2.4vh, 26px); font-size: clamp(.82rem, 1.4vh, .92rem); }
  .lp-foot { flex: none; padding: clamp(8px, 1.6vh, 18px) 0 clamp(8px, 2.4vh, 28px); }
}
@media (min-width: 901px) and (min-height: 521px) and (max-height: 820px) {
  .lp-kicker { display: none; }
}
@media (min-width: 901px) and (min-height: 521px) and (max-height: 690px) {
  .lp-lead { display: none; }
}
@media (min-width: 901px) and (min-height: 521px) and (max-height: 580px) {
  .lp-note { display: none; }
}

/* index.php: home page (what Veloria is) — scrolls; full-height hero */
body.homepage { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); }
body.homepage > .alert { max-width: 1120px; margin: 16px auto 0; }
.hp-hero { position: relative; overflow: hidden; color: #F3EEE6; padding: 26px 24px 56px; min-height: 100vh; min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column;
  background: radial-gradient(900px 480px at 85% -10%, rgba(196, 167, 119, .35), transparent 60%), radial-gradient(700px 420px at 0% 110%, rgba(220, 196, 197, .16), transparent 60%), linear-gradient(160deg, #1D1D22 0%, #25252B 55%, #2E2A26 100%); }
.hp-top { width: 100%; max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hp-top-right { display: inline-flex; align-items: center; gap: 12px; }
.hp-top-btn { min-height: 38px; padding: 8px 16px; }
.hp-hero .lang-switch { border-color: rgba(255, 255, 255, .25); }
.hp-hero .lang-switch button { color: #E4DED3; border-color: rgba(255, 255, 255, .2); background: transparent; }
.hp-hero .lang-switch button[aria-current="true"] { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
.hp-hero-text { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; max-width: 900px; margin: 0 auto; padding: 40px 0 0; }
.hp-hero h1 { margin: 0; font-family: var(--font-head); font-size: clamp(2.1rem, 5.2vw, 4rem); line-height: 1.06; letter-spacing: -.02em; color: #FFFFFF; }
.hp-lead { max-width: 680px; margin: 20px auto 0; font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.6; color: #CFC8BC; }
.hp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 30px 0 0; }
.hp-btn-lg { min-height: 50px; padding: 12px 26px; font-size: 1.02rem; }
.hp-hero .btn-secondary { background: transparent; color: #F3EEE6; border-color: rgba(255, 255, 255, .28); }
.hp-hero .btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.hp-points { list-style: none; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 34px 0 0; color: #CFC8BC; font-size: .92rem; }
.hp-points li { display: inline-flex; align-items: center; gap: 8px; }
.hp-points .ico { color: var(--gold); width: 18px; height: 18px; }
.hp-main { max-width: 1120px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.hp-section { padding: 72px 0 8px; text-align: center; }
.hp-section h2, .hp-band h2 { margin: 0 auto; max-width: 720px; font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.015em; }
.hp-eyebrow { margin: 0 0 10px; color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hp-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 36px; text-align: left; }
.hp-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.hp-ficon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(196, 167, 119, .14); color: var(--gold); margin-bottom: 14px; }
.hp-ficon .ico { width: 20px; height: 20px; }
.hp-feature h3, .hp-space h3 { margin: 0 0 6px; font-family: var(--font-head); font-size: 1.05rem; }
.hp-feature p, .hp-space p { margin: 0; color: var(--text-muted); font-size: .93rem; line-height: 1.55; }
.hp-spaces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; text-align: left; }
.hp-space { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.hp-space .lp-icon { margin-bottom: 16px; }
.hp-band { margin: 72px 0 56px; padding: 44px 24px; text-align: center; border-radius: 22px; border: 1px solid rgba(196, 167, 119, .35);
  background: radial-gradient(600px 260px at 50% -20%, rgba(196, 167, 119, .22), transparent 70%), var(--surface); }
.hp-band p { max-width: 620px; margin: 12px auto 24px; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 960px) { .hp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hp-spaces { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hp-features { grid-template-columns: 1fr; } .hp-top-btn { display: none; } .hp-section { padding-top: 56px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html:has(body.homepage) { scroll-behavior: smooth; }
a.lp-brand { color: inherit; text-decoration: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.steps-list { margin: 0; padding-left: 1.3em; line-height: 1.7; color: var(--text-muted); }
.steps-list li { margin-bottom: 6px; }
.lp-trial { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 18px 0 0; }
.lp-trial .btn { min-height: 44px; padding: 10px 22px; }
.lp-trial-note { color: #CFC8BC; font-size: .92rem; }

/* demo build progress */
.demo-progress { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.demo-progress .meter { height: 10px; margin: 0; }
.demo-progress .help { margin: 0; }
.demo-progress .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.demo-progress .actions .form { flex-direction: row; }

/* platform settings: room between fields, buttons sized to their text */
.settings-page .card { display: flex; flex-direction: column; gap: 16px; }
.settings-page .card > * { margin-top: 0; margin-bottom: 0; }
.settings-page .form { gap: 18px; }
.settings-page .form + .form { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 6px; }
.settings-page .form > .btn, .settings-page .form .actions .btn { align-self: flex-start; min-width: 160px; }
.settings-page .card + .card { margin-top: 20px; }

/* numbered pages */
.list-count { margin: 4px 0 10px; }
.pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.pages-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.pages-btn:hover { border-color: var(--gold); color: var(--gold); }
.pages-btn.is-current { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.pages-gap { padding: 0 4px; color: var(--text-muted); }

/* system check */
.check-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.check-list code, .table code { word-break: break-all; }
details.card > summary { cursor: pointer; font-weight: 600; }
.table .subtotal-row td { color: var(--text-muted); border-top: 1px solid var(--border); }
