:root {
  color-scheme: light;
  --paper: #f5f2ed;
  --surface: #fff;
  --surface-raised: #fffcf8;
  --surface-hover: #f9f4ed;
  --ink: #252220;
  --muted: #625953;
  --line: #e1d8ce;
  --control-line: #988879;
  --line-hover: #968178;
  --well: #fbf8f2;
  --red: #ab1d36;
  --link: #982038;
  --focus: #a22038;
  --error-ink: #982038;
  --error-border: #be3344;
  --error-bg: #fbe8eb;
  --neutral-ink: #543f48;
  --neutral-bg: #efe7e8;
  --neutral-border: #9b858d;
  --review-ink: #694608;
  --review-bg: #f8edd5;
  --review-border: #9e783f;
  --success-ink: #245840;
  --success-bg: #e2f2e8;
  --success-border: #638b74;
  --info-ink: #2c527a;
  --info-bg: #e5effa;
  --info-border: #6f87a3;
  --topbar: #fffcf7;
  --section-label: #80525c;
  --avatar-ink: #84243b;
  --avatar-bg: #f5e2e6;
  --avatar-border: #d5acb7;
  --menu-shadow: #45302a22;
  --dashboard-border: #e1c7c9;
  --dashboard-bg: radial-gradient(ellipse at 88% 130%, #efd0d6, transparent 64%), linear-gradient(110deg, #fffaf3, #faf1ed);
  --alert-border: #d9aeb8;
  --alert-bg: #f8e8ec;
  --brand-button: linear-gradient(110deg, #a71b32, #84172a);
  --brand-button-hover: linear-gradient(110deg, #92162c, #761425);
  --radius: 15px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.48; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 10px; }
h1, h2 { margin: 0; letter-spacing: -.025em; line-height: 1.12; }
h1 { font-size: clamp(2rem, 3.7vw, 3.15rem); font-weight: 760; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; font-weight: 700; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.muted { color: var(--muted); }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.skip-link { position: fixed; top: 5px; left: 5px; transform: translateY(-140%); z-index: 12; padding: 13px; border-radius: 7px; background: var(--surface); }
.skip-link:focus { transform: none; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131216;
  --surface: #1c1a20;
  --surface-raised: #242127;
  --surface-hover: #26232a;
  --well: #151419;
  --ink: #f8f4f1;
  --muted: #bdb4bd;
  --line: #363039;
  --control-line: #6d636e;
  --line-hover: #99616e;
  --red: #e74762;
  --link: #f6a4b0;
  --focus: #ff91a5;
  --neutral-ink: #d3ccd5;
  --neutral-bg: #2e2a34;
  --neutral-border: #71677a;
  --error-ink: #ffb4c0;
  --error-bg: #3b1d27;
  --error-border: #a45667;
  --review-ink: #f9d898;
  --review-bg: #382d20;
  --review-border: #816f47;
  --success-ink: #abe9c5;
  --success-bg: #20352e;
  --success-border: #54846d;
  --info-ink: #c0ddf8;
  --info-bg: #232f40;
  --info-border: #577b9f;
  --topbar: #17151a;
  --section-label: #e1c3b9;
  --avatar-ink: #f4b7bd;
  --avatar-bg: #41212c;
  --avatar-border: #663647;
  --menu-shadow: #0007;
  --dashboard-border: #4c3741;
  --dashboard-bg: radial-gradient(ellipse at 88% 130%, #50212e, transparent 64%), linear-gradient(110deg, #252127, #19161c 64%, #21191f);
  --alert-border: #744250;
  --alert-bg: #3b202b;
}
.app-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}
.sidebar {
  --ink: #f8f4f1;
  --muted: #bdb4bd;
  --surface-hover: #26232a;
  --focus: #ff91a5;
  color-scheme: dark;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 34px 16px 24px;
  overflow-y: auto;
  border-inline-end: 1px solid #363039;
  background: radial-gradient(ellipse at 0 0, #3a2430 0, transparent 225px), #17151a;
}
.brand { display: block; width: fit-content; margin: 0 12px 35px; }
.brand .wordmark { width: 145px; }
.brand-sub { display: block; font-size: .67rem; font-weight: 700; letter-spacing: .29em; color: #e1c3b9; margin: 7px 0 0 1px; }
.navigation { display: grid; gap: 6px; }
.navigation a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 620;
}
.navigation a:hover { background: var(--surface-hover); color: var(--ink); }
.navigation a[aria-current] {
  color: var(--ink);
  background: linear-gradient(100deg, #47202e, #251c26);
  border-color: #63303f;
  font-weight: 730;
}
.navigation a[aria-current]::before {
  content: "";
  position: absolute;
  inset: 11px auto 11px -1px;
  width: 2px;
  border-radius: 2px;
  background: #f25a68;
  box-shadow: 0 0 9px #f25a685c;
}
.workspace { min-width: 0; }
.topbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 clamp(18px, 3vw, 46px); background: var(--topbar); border-bottom: 1px solid var(--line); }
.app-name { flex-shrink: 0; font-size: .73rem; font-weight: 730; letter-spacing: .18em; text-transform: uppercase; color: var(--section-label); }
.account { position: relative; min-width: 0; max-width: 70%; font-size: .875rem; }
.account summary { display: flex; align-items: center; gap: 9px; list-style: none; min-height: 44px; border-radius: 8px; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 3px 3px; flex-shrink: 0; color: var(--muted); }
.account[open] summary::after { transform: rotate(225deg); margin-block: 3px 0; }
.account-dot { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; color: var(--avatar-ink); background: var(--avatar-bg); border: 1px solid var(--avatar-border); font-weight: 750; }
.account-name { font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { color: var(--muted); white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 5px); width: 218px; z-index: 6; padding: 8px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 35px var(--menu-shadow); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 9px 10px; color: var(--ink); }
.account-menu a:hover, .account-menu button:hover { background: var(--neutral-bg); }
.account-menu .theme-picker { margin-bottom: 6px; padding: 0 3px 8px; border-bottom: 1px solid var(--line); }

.content { max-width: 1490px; margin: 0 auto; padding: clamp(25px, 4vw, 52px) clamp(18px, 3vw, 46px) 48px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 25px; min-width: 0; }
.page-heading > div { min-width: 0; }
.page-heading p { margin-bottom: 0; margin-top: 6px; }
.page-heading .context-label { margin: 0 0 8px; }
.context-label { font-size: .89rem; color: var(--muted); }
.context-label a:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; min-height: 36px; font-weight: 620; color: var(--muted); font-size: .89rem; margin: -11px 0 9px; }
.back-link:hover, .text-link:hover { color: var(--link); text-decoration: underline; }
.text-link { display: inline-block; color: var(--link); font-weight: 650; font-size: .91rem; padding: 0; background: none; border: none; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; padding: 10px 15px; min-height: 44px; font-weight: 680; line-height: 1.25; text-align: center; }
.primary {
  background: var(--brand-button);
  border-color: #cf465d;
  color: #fff;
  box-shadow: 0 5px 12px #851b2f32;
}
.primary:hover { background: var(--brand-button-hover); }
.secondary { background: var(--surface); border-color: var(--control-line); color: var(--ink); }
.secondary:hover { border-color: var(--line-hover); background: var(--surface-hover); }
.button:disabled { color: var(--muted); background: var(--surface); border-color: var(--line); box-shadow: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  min-height: 184px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 19px;
  background: var(--dashboard-bg);
}
.dashboard-heading {
  place-self: center stretch;
  padding: clamp(22px, 3vw, 34px);
}
.dashboard-heading .button { margin-top: 16px; }
.dashboard-optics {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 26%);
  pointer-events: none;
}
.dashboard-optics .optical-rings {
  left: 69%;
  top: 88%;
  width: min(95%, 460px);
}

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 105px;
  gap: 8px;
  padding: 16px 34px 14px 17px;
  background: linear-gradient(150deg, var(--surface-raised), var(--surface) 80%);
}
.metric::after {
  content: "";
  position: absolute;
  bottom: 23px;
  right: 20px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border: solid var(--muted);
  border-width: 1.5px 1.5px 0 0;
}
.metric:hover, .salon-card:hover { border-color: var(--line-hover); }
.metric span { font-size: .885rem; color: var(--muted); font-weight: 650; }
.metric strong { font-size: 2.15rem; letter-spacing: -.055em; font-variant-numeric: tabular-nums; line-height: 1.18; }
.metric-alert { border-color: var(--alert-border); background: linear-gradient(140deg, var(--alert-bg), var(--surface) 85%); }
.metric-alert strong { color: var(--error-ink); }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; align-items: start; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-heading a, .assignment > a { text-align: right; color: var(--link); font-size: .86rem; font-weight: 670; }
.panel-heading a:hover, .assignment > a:hover { text-decoration: underline; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; min-height: 63px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row:hover { background: var(--surface-hover); }
.list-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.list-row:only-child { border-radius: var(--radius); }
.list-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.row-meta { display: block; font-size: .82rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.row-end { flex-shrink: 0; text-align: right; }
.empty { color: var(--muted); padding: 19px; margin: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 30px;
  width: max-content;
  padding: 4px 9px;
  line-height: 1.2;
  min-height: 24px;
  font-size: .78rem;
  font-weight: 690;
  color: var(--state-ink, var(--neutral-ink));
  background: var(--state-bg, var(--neutral-bg));
}
.status-issue, .status-rework, .choice[data-status="issue"], .message.error {
  --state-ink: var(--error-ink);
  --state-bg: var(--error-bg);
  --state-border: var(--error-border);
}
.status-review, .message.warning {
  --state-ink: var(--review-ink);
  --state-bg: var(--review-bg);
  --state-border: var(--review-border);
}
.status-ok, .status-done, .choice[data-status="ok"], .message.success {
  --state-ink: var(--success-ink);
  --state-bg: var(--success-bg);
  --state-border: var(--success-border);
}
.status-open, .message {
  --state-ink: var(--info-ink);
  --state-bg: var(--info-bg);
  --state-border: var(--info-border);
}
.messages { margin-bottom: 14px; }
.message { padding: 11px 13px; border: 1px solid var(--state-border); background: var(--state-bg); color: var(--state-ink); border-radius: 9px; margin-bottom: 10px; }
.salon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.salon-card { padding: 18px; overflow-wrap: anywhere; }
.salon-card p { margin: 8px 0 0; color: var(--muted); font-size: .885rem; }
.salon-card .pill { margin-top: 8px; }
.assignment { display: flex; justify-content: space-between; gap: 15px; padding: 17px 18px; margin-bottom: 17px; }
.assignment h2 { margin-bottom: 8px; }
.assignment p { margin-bottom: 3px; }
.assignment span { font-size: .88rem; margin-inline-start: 6px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; padding: 14px; }
.filter-bar label { flex: 0 1 245px; min-width: 0; font-size: .87rem; }
.filter-bar select { display: block; margin-top: 4px; }
.filter-bar .text-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 17px; font-size: .86rem; }
.form-panel, .detail-panel { padding: clamp(17px, 2.1vw, 24px); }
.form-panel { max-width: 680px; }
.stack > .form-panel { max-width: none; }
.form-panel h2, .detail-panel h2 { margin-bottom: 12px; }
.field { margin: 0 0 17px; min-width: 0; }
.field > label, fieldset legend { display: block; font-size: .9rem; font-weight: 690; margin-bottom: 5px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--control-line); padding: 9px 11px; border-radius: 8px; color: var(--ink); background: var(--well);
}
textarea { display: block; resize: vertical; }
textarea::placeholder { color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); }
.field fieldset label { display: flex; align-items: center; gap: 8px; min-height: 37px; }
input[type="file"] { width: 100%; max-width: 440px; min-height: 42px; color: var(--muted); font-size: .86rem; }
input::file-selector-button { cursor: pointer; background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: 7px; min-height: 42px; margin-right: 7px; padding: 8px 10px; color: var(--ink); font: inherit; }
.errorlist { list-style: none; margin: 6px 0; padding: 0; color: var(--error-ink); font-size: .88rem; }
.field-error :is(input, select, textarea) { border-color: var(--error-border); }
.help { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.help ul { margin: 4px 0; padding-inline-start: 1.25rem; }
.visit-progress { padding: 14px 18px 15px; margin: 0 0 16px; }
.progress-label { display: flex; justify-content: space-between; gap: 4px; flex-wrap: wrap; font-size: .95rem; }
progress { display: block; appearance: none; width: 100%; height: 7px; margin-top: 10px; border: 0; border-radius: 20px; background: var(--neutral-bg); overflow: hidden; accent-color: var(--red); }
progress::-webkit-progress-bar { background: var(--neutral-bg); }
progress::-webkit-progress-value { background: var(--red); }
progress::-moz-progress-bar { background: var(--red); }
.section-row { min-height: 50px; }
.finish-action { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-top: 18px; }
.finish-action .muted { font-size: .87rem; }
.visit-tasks { margin-top: 19px; }

.checklist { display: grid; grid-template-columns: 1fr; gap: 9px; }
.answer { border-radius: 11px; padding: 17px 19px; scroll-margin-top: 12px; }
.answer:target { border-color: var(--focus); }
.answer-grid { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: start; gap: 9px; }
.answer-body { min-width: 0; }
.item-index { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; padding-top: 2px; }
.answer h2 { font-size: 1rem; line-height: 1.45; letter-spacing: 0; font-weight: 650; margin-bottom: 10px; }
.choice-set { display: flex; flex-wrap: wrap; gap: 5px; align-items: stretch; }
.choice { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; position: relative; padding: 6px 9px; min-height: 38px; border: 1px solid var(--control-line); border-radius: 7px; color: var(--muted); cursor: pointer; font-size: .85rem; }
.choice:hover { background: var(--surface-hover); }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice:has(input:checked) {
  background: var(--state-bg, var(--neutral-bg));
  color: var(--state-ink, var(--neutral-ink));
  border-color: var(--state-border, var(--neutral-border));
  font-weight: 730;
}
.answer-details { margin-top: 6px; }
.answer-details summary { width: fit-content; padding: 7px 0; color: var(--muted); font-size: .88rem; font-weight: 610; }
.answer-details-body { padding-top: 8px; }
.answer-details .field { margin-bottom: 8px; }
.answer-task, .task-when-issue { margin-top: 8px; }
.answer:not(:has(input[value="issue"]:checked)) .task-when-issue { display: none; }
.answer .pill + p { margin-top: 8px; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.photos a { display: inline-flex; }
.photos img { display: block; border-radius: 7px; border: 1px solid var(--line); object-fit: cover; }
.savebar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: end; gap: 7px; margin-top: 12px; padding: 11px 0 max(10px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.savebar span { font-size: .82rem; }
.task-columns { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.task-heading h1 { font-size: clamp(1.7rem, 3.6vw, 2.64rem); }
.task-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.stack { display: grid; min-width: 0; gap: 16px; }
.detail-meta { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-bottom: 15px; font-size: .86rem; color: var(--muted); }
.detail-meta strong { color: var(--ink); }
.rule { border-top: 1px solid var(--line); margin: 15px 0; }
.detail-panel .text-link { margin-bottom: 7px; }
.history ol { list-style: none; margin: 15px 0 0; padding: 0 0 0 3px; }
.history li { position: relative; border-left: 1px solid var(--control-line); padding: 0 0 18px 15px; overflow-wrap: anywhere; }
.history li:last-child { padding-bottom: 0; }
.history li::before { content: ""; position: absolute; top: 6px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.history p { margin: 7px 0 0; }

@media (max-width: 1050px) {
  .app-body { grid-template-columns: 178px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .brand { margin-left: 13px; }
  .brand .wordmark { width: 124px; }
  .salon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-body { display: block; }
  .sidebar { position: static; height: auto; padding: 17px 14px 9px; border-inline-end: 0; border-bottom: 1px solid #363039; }
  .brand { margin: 0 4px 12px; }
  .brand .wordmark { width: 113px; }
  .brand-sub { font-size: .55rem; margin-top: 4px; }
  .navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
  .navigation a { min-height: 44px; font-size: .83rem; padding: 7px; }
  .navigation a[aria-current]::before { inset: auto 7px -1px 7px; width: auto; height: 2px; }
  .topbar { min-height: 47px; gap: 6px; padding: 0 14px; }
  .app-name { font-size: .64rem; }
  .account { max-width: 61%; font-size: .78rem; }
  .account-role { display: none; }
  .account-dot { width: 25px; height: 25px; border-radius: 6px; }
  .content { padding: 21px 14px 30px; }
  .page-heading { margin-bottom: 16px; }
  .dashboard-header { grid-template-columns: minmax(0, 1.15fr) minmax(0, .78fr); min-height: 148px; margin-bottom: 13px; }
  .dashboard-heading .button { margin-top: 12px; }
  .dashboard-optics .optical-rings { left: 68%; top: 79%; width: 170%; }
  .dashboard-optics { mask-image: linear-gradient(90deg, transparent, #000 34%); }
  .metrics { gap: 8px; margin-bottom: 14px; }
  .metric { min-height: 90px; padding: 11px 28px 11px 13px; }
  .metric::after { right: 15px; bottom: 19px; }
  .metric strong { font-size: 1.85rem; }
  .two-columns { gap: 11px; }
  .salon-grid { gap: 8px; }
  .salon-card { padding: 13px; }
  .answer { padding: 13px 11px; }
  .answer-grid { grid-template-columns: 24px minmax(0, 1fr); gap: 5px; }
  .choice { min-height: 44px; }
  .savebar { flex-wrap: wrap; }
  .savebar span:not(:empty) { flex: 0 0 100%; text-align: right; }
  .savebar .button { padding-inline: 10px; font-size: .86rem; }
  input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]), select, textarea { font-size: 16px; }
}
@media (max-width: 360px) {
  .navigation a { font-size: .76rem; padding-inline: 7px; }
  .salon-grid { grid-template-columns: 1fr; }
  .account-dot { display: none; }
  .page-heading .button { width: 100%; }
  .dashboard-header { grid-template-columns: minmax(0, 1.4fr) minmax(0, .65fr); }
  .dashboard-heading { padding-inline: 15px; }
}
