/* Chisto Plovdiv job tracker (fictional demo). Mobile first; tokens on :root, dark set below. No inline styles anywhere (strict CSP). */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --ink: #14212b; --muted: #4d5b66;
  --brand: #0b4f6c; --brand-ink: #ffffff; --accent: #8f5208; --accent-soft: #fbeedd;
  --line: #d9d4c8; --ok: #1d6b3a; --err: #a4231b; --focus: #8f5208;
  --radius: 14px; --gutter: 16px;
  --field: #807a70; /* edges of fields and chips: 4.2:1 on white, 3.9:1 on the page (WCAG 1.4.11 needs 3) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0f171d; --surface: #17232c; --ink: #eef2f4; --muted: #a9b7c1;
  --brand: #5fb3d6; --brand-ink: #0b1a22; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2c3b46; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a; --field: #7f8a94;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171d; --surface: #17232c; --ink: #eef2f4; --muted: #a9b7c1;
  --brand: #5fb3d6; --brand-ink: #0b1a22; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2c3b46; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a; --field: #7f8a94;
  color-scheme: dark;
}
.made svg .hat-line { stroke: var(--muted); }

* { box-sizing: border-box; }
p, ul, ol, dl { margin: 0 0 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }

.demo-bar { margin: 0; padding: 8px var(--gutter); background: var(--accent-soft); color: var(--ink); font-size: 16px; text-align: center; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter); max-width: 1040px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; min-height: 44px; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.logo-bg { fill: var(--brand); }
.logo-key { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; }
.tools { display: flex; gap: 8px; }
.chip { min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }

main { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 28px 0; }
h1 { font-size: clamp(30px, 7vw, 50px); line-height: 1.1; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 5vw, 32px); margin: 0 0 12px; }
h3 { margin: 0 0 8px; font-size: 19px; }
.kicker { color: var(--accent); font-weight: 700; margin: 0; }
.lead { font-size: 19px; color: var(--muted); max-width: 40em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.facts li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

.grid { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
.card p { margin: 0; color: var(--muted); }
.review blockquote { margin: 8px 0; font-style: italic; }
.review figcaption { color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent-soft); color: var(--ink); border-radius: 6px; padding: 2px 8px; }
.note { color: var(--muted); font-size: 15px; margin-top: -4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gutter); margin: 12px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: 18px; margin-bottom: 8px; padding: 0; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 15px; margin-right: 4px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 12px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
textarea { min-height: 110px; }
/* one height for every single-line field, so neighbours share a centre line; a button never touches the field above it */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 48px; padding-top: 8px; padding-bottom: 8px; }
input[type="checkbox"], input[type="radio"] { margin: 0; padding: 0; }
select + .btn, input + .btn { margin-top: 12px; }
.hint { color: var(--muted); font-size: 16px; margin: 8px 0 0; max-width: 68ch; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slots .hint { grid-column: 1 / -1; }
.slot { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.slot[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.msg { min-height: 1.5em; font-weight: 600; margin: 12px 0 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

.foot { max-width: 1040px; margin: 0 auto; padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 16px; }
.foot p { margin: 0; }
.made { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }


/* Owner view */
.owner table { width: 100%; border-collapse: collapse; font-size: 15px; }
.owner th, .owner td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.owner .table-wrap { overflow-x: auto; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  #reviews .grid { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
  .panel { padding: 28px; }
  #book-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  #book-form .btn.wide, #book-form .msg { grid-column: 1 / -1; }
}

/* ---- Pilot 07 dashboard additions ---- */
.dash h1 { font-size: clamp(26px, 6vw, 38px); margin: 8px 0 12px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-bottom: 16px; }
.range label { margin-top: 0; }
.range .quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.range .quick .chip { padding: 0 16px; }
.kpis { display: grid; gap: 12px; }
.kpi p { margin: 0; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 15px; }
.kpi-val { font-size: clamp(26px, 6vw, 34px); font-weight: 800; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 14px; }
.chart { margin: 16px 0; }
.chart h2 { font-size: 20px; }
.svg-chart { width: 100%; height: auto; display: block; }
.svg-chart .bar { fill: var(--brand); }
.svg-chart .axis { stroke: var(--line); }
.svg-chart .ax-t { fill: var(--muted); font-size: 22px; }
details { margin-top: 8px; color: var(--muted); }
details table { width: 100%; border-collapse: collapse; font-size: 14px; }
details th, details td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; max-height: 280px; overflow-y: auto; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: 1fr; gap: 4px; }
.hb-name { font-weight: 600; }
.hb-track { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.hb-fill { display: block; height: 100%; background: var(--accent); }
.hb-val { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
input[type=file] { padding: 12px; }
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .range { grid-template-columns: 180px 180px 1fr; }
  .range .quick { grid-column: auto; }
}

/* ---- Pilot 03 job tracker additions ---- */
:root { --st-planned: var(--brand); --st-in_progress: var(--accent); --st-done: var(--ok); --st-missed: var(--err); }
.weeknav { display: flex; align-items: center; gap: 8px; }
.week-label { margin: 0; font-weight: 700; flex: 1; text-align: center; }
.counts { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.counts li { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid; border-radius: 10px; padding: 8px 12px; }
.counts b { font-size: 22px; margin-right: 4px; }
.st-planned { border-left-color: var(--st-planned) !important; } .st-in_progress { border-left-color: var(--st-in_progress) !important; }
.st-done { border-left-color: var(--st-done) !important; } .st-missed { border-left-color: var(--st-missed) !important; }
.board { display: grid; gap: 12px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.day.today { outline: 2px solid var(--accent); }
.day h3, .day h2.day-h { font-size: 16px; margin: 0 0 8px; }
.job { border: 1px solid var(--line); border-left: 5px solid; border-radius: 8px; padding: 8px; margin-bottom: 8px; background: var(--bg); }
.job p { margin: 0; } .job .hint { margin-top: 2px; font-size: 14px; }
.job-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chip-st { font-size: 14px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
details.panel > summary { cursor: pointer; list-style: none; } details.panel > summary h2 { display: inline; font-size: 20px; }
details.panel > summary::before { content: "+ "; font-weight: 700; color: var(--accent); } details.panel[open] > summary::before { content: "– "; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } .two .full { grid-column: 1 / -1; }
.mini { margin-bottom: 16px; } .mini .btn { margin-top: 8px; }
table.rep { width: 100%; border-collapse: collapse; font-size: 15px; } table.rep th, table.rep td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
table.rep tr:last-child td { font-weight: 700; }
.cjob { border-left: 6px solid; margin-bottom: 16px; } .cjob h2 { font-size: 20px; margin: 8px 0 2px; }
.tick { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 500; margin: 0; border-bottom: 1px solid var(--line); }
.tick input { width: 26px; min-height: 26px; height: 26px; accent-color: var(--ok); }
@media (min-width: 720px) {
  .counts { grid-template-columns: repeat(4, 1fr); }
  .board { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .day { padding: 8px; } .job { font-size: 14px; }
}

/* ---- v2: cancelled status, back office, phone view ---- */
:root { --st-cancelled: var(--muted); }
.st-cancelled { border-left-color: var(--st-cancelled) !important; opacity: .85; }
.st-cancelled .chip-st { text-decoration: line-through; }
.made-row { display: flex; flex-direction: column; gap: 4px; }
.sig { font-style: italic; margin: 0; }
/* back-office menu: one line that scrolls sideways on phones and tablets (Sign out stays fixed on the right), a side column from 1024 px */
.adm-nav { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: 8px; align-items: center; }
.adm-nav ul { list-style: none; padding: 4px 0; margin: 0; display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.adm-nav li { flex: none; }
.adm-nav a { white-space: nowrap; }
.adm-nav form .btn { min-width: 96px; white-space: nowrap; }
@media (min-width: 1024px) {
  body.adm:has(> .adm-nav) { display: grid; grid-template-columns: 264px minmax(0, 1fr); align-items: start; max-width: 1280px; margin: 0 auto; }
  body.adm:has(> .adm-nav) > .top, body.adm:has(> .adm-nav) > .demo-bar { grid-column: 1 / -1; max-width: none; width: 100%; margin: 0; }
  body.adm:has(> .adm-nav) > .adm-nav { grid-column: 1; flex-direction: column; align-items: stretch; max-width: none; margin: 0; padding: 0 8px 24px var(--gutter); position: sticky; top: 0; }
  body.adm:has(> .adm-nav) > .adm-nav ul { flex-direction: column; gap: 4px; flex: none; overflow: visible; padding: 0; }
  body.adm:has(> .adm-nav) > .adm-nav a { display: flex; white-space: normal; border-radius: 10px; border-color: transparent; background: transparent; padding: 8px 12px; }
  body.adm:has(> .adm-nav) > .adm-nav a[aria-current="page"] { background: var(--brand); border-color: var(--brand); }
  body.adm:has(> .adm-nav) > .adm-nav form { margin: 16px 0 0; }
  body.adm:has(> .adm-nav) > .adm-nav form .btn { width: 100%; }
  body.adm:has(> .adm-nav) > main { grid-column: 2; max-width: 960px; width: 100%; margin: 0; padding: 0 var(--gutter) 24px 24px; }
  body.adm:has(> .adm-nav) > main > h1 { margin-top: 0; }
  body.adm:has(> .adm-nav) > .foot { grid-column: 2; max-width: 960px; width: 100%; margin: 0; padding-left: 24px; }
}
/* held in place, invisible, until the first data is drawn: lists arriving never push visible content around */
html.adm-loading main > :not(h1), html.adm-loading .foot { visibility: hidden; }
#jobs.first-load ~ *, main:has(#jobs.first-load) ~ .foot { visibility: hidden; }
/* the cleaner's name and the date arrive after the page: their lines are kept from the start */
#who { display: block; min-height: 1.1em; }
#cl-date { min-height: 1.6em; }
/* week board: it may use the full width, and in a narrow day column the status chip goes under the time instead of being cut off */
@media (min-width: 1024px) { body.adm:has(> .adm-nav):has(.board) { max-width: 1440px; } body.adm:has(> .adm-nav) > main:has(.board) { max-width: none; } }
.board .job-top { flex-wrap: wrap; justify-content: flex-start; }
.board .chip-st { white-space: nowrap; }
@media (min-width: 720px) {
  .counts { grid-template-columns: repeat(5, 1fr); }
  /* a select with its button: one row, the label above both */
  form:has(> select + .btn) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: end; }
  form:has(> select + .btn) > :not(select):not(.btn) { grid-column: 1 / -1; }
  form:has(> select + .btn) > select + .btn { margin-top: 0; }
}
table.data td a[download] { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; }
.adm-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.adm-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.adm-nav form { margin: 0; }
main:focus { outline: none; }
.kpi .kpi-val { margin: 4px 0; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.list > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.row-actions .btn { min-height: 44px; padding: 0 16px; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger.primary { background: var(--err); color: var(--surface); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 15px; }
.filters { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.filters input, .filters select, .two input, .two select { min-width: 0; max-width: 100%; }
@media (max-width: 380px) { .filters { grid-template-columns: minmax(0, 1fr); } }
.filters .full, .form-grid .full { grid-column: 1 / -1; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.field-err { color: var(--err); font-size: 15px; font-weight: 600; margin: 4px 0 0; }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.badge.off { color: var(--err); border-color: var(--err); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; max-width: 100%; }
.pin-once { font-size: 26px; font-weight: 800; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.note-box { margin-top: 12px; }
.note-box textarea { min-height: 80px; }
.notice p { margin: 12px 0 4px; } .notice p:first-child { margin-top: 0; }
.notice ul { margin: 0 0 4px; padding-left: 24px; } .notice li { margin: 4px 0; }
.end-hint { margin: 8px 0 0; }
.cjob .when { font-variant-numeric: tabular-nums; }
.inline-check { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 44px; }
.inline-check input { width: 24px; min-height: 24px; height: 24px; }
.job .job-edit { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }
.panel h2 { font-size: 22px; }
.counts-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; padding: 0; list-style: none; }
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  .adm-nav, .top, .demo-bar, .skip, form, .btn, .foot { display: none !important; }
  body { background: #fff; color: #000; }
}
.kpi h2.kpi-label { font-size: 15px; margin: 0; letter-spacing: 0; }
.list h3 { font-size: 18px; margin: 0 0 4px; }
.list h4 { font-size: 16px; margin: 12px 0 8px; }
details > summary { padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--ink); } /* ~44px tap target, keeps the native marker */
