:root {
  --brand: #4a7aa0;
  --brand-ink: #2f5d80;
  --brand-deep: #1d3d57;
  --brand-soft: #e8f0f6;
  --brand-softer: #f3f7fa;
  --ink: #17232e;
  --ink-2: #4b5a67;
  --ink-3: #7b8894;
  --line: #dde4ea;
  --line-2: #eef2f5;
  --bg: #f6f8fa;
  --card: #ffffff;
  --ok: #1f8a5b;
  --ok-soft: #e4f4ec;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --bad: #c0392b;
  --bad-soft: #fbe7e4;
  --wa: #1fa855;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23,35,46,.05), 0 6px 24px rgba(23,35,46,.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
main { flex: 1; outline: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hide { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); }
.brand-mark { width: 30px; height: 33px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 21px; letter-spacing: .06em; font-weight: 800; }
.brand-text small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--brand-softer); }
.nav a.on { background: var(--brand-soft); color: var(--brand-deep); }
.nav-staff { border: 1px solid var(--line); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand-deep) 0%, var(--brand-ink) 55%, var(--brand) 100%);
  color: #fff; padding: 44px 0 92px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 46px);
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.12; margin: 16px 0 12px; letter-spacing: -.02em; max-width: 720px; }
.hero p.lede { font-size: 17px; opacity: .88; max-width: 620px; margin: 0; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; font-size: 14px; font-weight: 600; opacity: .95; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 18px; height: 18px; flex: none; }

/* ---------- steps strip ---------- */
.steps-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0 8px; }
.steps-strip div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.steps-strip b { display: block; font-size: 12px; opacity: .75; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.booker { margin-top: -64px; position: relative; z-index: 2; padding: 0; overflow: hidden; }
.booker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.booker-head h2 { margin: 0; font-size: 19px; }
.progress { display: flex; gap: 6px; align-items: center; }
.progress i { width: 26px; height: 6px; border-radius: 99px; background: var(--line); display: block; }
.progress i.done { background: var(--brand); }
.progress i.now { background: var(--brand-ink); width: 40px; }
.progress span { font-size: 12.5px; color: var(--ink-3); margin-left: 6px; font-weight: 600; }
.booker-body { padding: 22px; }
.booker-foot { display: flex; justify-content: space-between; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); background: var(--brand-softer); }

h3.q { font-size: 16px; margin: 0 0 4px; }
p.hint { margin: 0 0 14px; color: var(--ink-3); font-size: 13.5px; }
.block + .block { margin-top: 24px; }

/* option tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tiles.sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  position: relative; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; width: 100%;
}
.tile:hover { border-color: #b8cbdb; }
.tile.sel { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 3px rgba(74,122,160,.15); }
.tile .t-title { font-weight: 700; display: block; }
.tile .t-sub { color: var(--ink-3); font-size: 13px; display: block; margin-top: 3px; }
.tile .t-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 10px; }
.tile .t-ico svg { width: 19px; height: 19px; }
.tile .tag { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 99px; }
.tiles.sm .tile { padding: 11px 13px; }
.tile .check { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); background: #fff; }
.tile.sel .check { background: var(--brand); border-color: var(--brand); }
.tile.sel .check::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* forms */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field label .opt { font-weight: 500; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: #fff; min-height: 44px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,122,160,.15); }
.input.err { border-color: var(--bad); }
.err-msg { color: var(--bad); font-size: 12.5px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--brand-softer); font-size: 20px; cursor: pointer; color: var(--brand-ink); }
.stepper output { min-width: 54px; text-align: center; font-weight: 700; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: #6b4300; border-radius: 10px; padding: 11px 13px; font-size: 13.5px; margin-top: 12px; }
.notice.info { background: var(--brand-soft); color: var(--brand-deep); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 15px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.day {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 2px 6px; text-align: center; cursor: pointer; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.day b { font-size: 16px; }
.day small { font-size: 10.5px; font-weight: 600; color: var(--ok); }
.day small.low { color: var(--warn); }
.day.off { background: var(--line-2); color: var(--ink-3); cursor: not-allowed; border-color: transparent; }
.day.off small { color: var(--ink-3); }
.day.sel { border-color: var(--brand); background: var(--brand); color: #fff; }
.day.sel small { color: #e6f0f7; }
.day.blank { visibility: hidden; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 16px; }
.slot { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 13px; cursor: pointer; text-align: left; }
.slot b { display: block; }
.slot small { color: var(--ink-3); font-size: 12.5px; }
.slot.sel { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 3px rgba(74,122,160,.15); }
.slot.full { opacity: .5; cursor: not-allowed; text-decoration: line-through; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 10px;
  padding: 11px 18px; font-weight: 700; cursor: pointer; min-height: 44px; text-decoration: none; white-space: nowrap; font-size: 14.5px;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand-ink); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:disabled { background: #a9bccb; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #b8cbdb; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(.95); }
.btn-danger { background: #fff; color: var(--bad); border-color: #efc4be; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 13px; border-radius: 8px; }

/* review + success */
.review { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14.5px; }
.review dt { color: var(--ink-3); font-weight: 600; }
.review dd { margin: 0; font-weight: 600; }
.success { text-align: center; padding: 34px 22px 10px; }
.success .big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.success .big-ok svg { width: 32px; height: 32px; }
.success h2 { margin: 0 0 6px; font-size: 24px; }
.ref { display: inline-block; font-size: 22px; font-weight: 800; letter-spacing: .06em; background: var(--brand-soft); color: var(--brand-deep); padding: 8px 18px; border-radius: 10px; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 6px; }
.next-list { text-align: left; max-width: 520px; margin: 18px auto 0; padding: 0; list-style: none; counter-reset: n; }
.next-list li { position: relative; padding: 8px 0 8px 40px; color: var(--ink-2); font-size: 14px; counter-increment: n; }
.next-list li::before { content: counter(n); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; }

/* info band under booker */
.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 40px; }
.band .card { padding: 18px; box-shadow: none; }
.band h4 { margin: 0 0 4px; font-size: 15px; }
.band p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* ---------- track ---------- */
.page-head { padding: 30px 0 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--ink-3); }
.track-form { padding: 20px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.timeline li.done .dot { background: var(--brand); border-color: var(--brand); }
.timeline li.done::before { background: var(--brand); }
.timeline li.now .dot { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(74,122,160,.18); }
.timeline b { display: block; }
.timeline small { color: var(--ink-3); }
.timeline li:not(.done):not(.now) b { color: var(--ink-3); font-weight: 600; }

/* ---------- staff ---------- */
.staff-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px 0 16px; }
.staff-head h1 { margin: 0; font-size: 24px; }
.staff-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13.5px; }
.demo-banner { background: var(--warn-soft); color: #6b4300; border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 600; margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; box-shadow: none; cursor: pointer; text-align: left; }
.stat:hover { border-color: #b8cbdb; }
.stat .n { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat.alert .n { color: var(--warn); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--ink-3); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand-ink); }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grp { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* schedule board */
.board { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.board table { border-collapse: collapse; width: 100%; min-width: 860px; }
.board th, .board td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); vertical-align: top; padding: 8px; }
.board th { font-size: 12.5px; text-align: left; background: var(--brand-softer); position: sticky; top: 0; }
.board th.today { background: var(--brand-soft); color: var(--brand-deep); }
.board th small { display: block; color: var(--ink-3); font-weight: 600; }
.board td.rowlab { width: 92px; font-size: 12px; font-weight: 700; color: var(--ink-3); background: #fbfcfd; white-space: nowrap; }
.board td.closed { background: repeating-linear-gradient(135deg, #f6f8fa 0 6px, #eef2f5 6px 12px); }
.chip {
  display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--brand); background: var(--brand-softer); border-radius: 7px;
  padding: 6px 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; line-height: 1.35;
}
.chip b { display: block; font-size: 12.5px; }
.chip.k-install { border-left-color: #7a4fb5; background: #f3eefa; }
.chip.k-service { border-left-color: var(--warn); background: var(--warn-soft); }
.chip.s-requested { outline: 1.5px dashed #d4a24a; outline-offset: -1.5px; }
.chip.s-cancelled { opacity: .45; text-decoration: line-through; }
.chip.s-completed { opacity: .65; }

/* pipeline */
.pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: #eef2f5; border-radius: 12px; padding: 10px; min-height: 140px; }
.col h5 { margin: 2px 4px 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); display: flex; justify-content: space-between; }
.pcard { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; }
.pcard:hover { border-color: #b8cbdb; }
.pcard b { display: block; font-size: 13.5px; }
.pcard small { display: block; color: var(--ink-3); font-size: 12px; }
.pcard .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 6px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; background: var(--brand-softer); border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafcfd; }
.tbl-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.p-requested { background: var(--warn-soft); color: var(--warn); }
.p-confirmed { background: var(--brand-soft); color: var(--brand-deep); }
.p-visited { background: #e6eef9; color: #2c4f86; }
.p-quoted { background: #f3eefa; color: #5d3a91; }
.p-install_booked { background: #ece8fb; color: #4a2fa0; }
.p-completed { background: var(--ok-soft); color: var(--ok); }
.p-cancelled { background: var(--line-2); color: var(--ink-3); }
.kind { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15,25,35,.38); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: #fff; z-index: 41; transform: translateX(100%);
  transition: transform .22s ease, visibility 0s linear .22s; display: flex; flex-direction: column; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: -10px 0 40px rgba(15,25,35,.18); }
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.drawer-head h3 { margin: 0; font-size: 18px; }
.drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.x { border: 0; background: var(--line-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; flex: none; }
.sec { margin-bottom: 18px; }
.sec h6 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 5px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.hist li { padding: 5px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.hist li span { color: var(--ink-3); }
.inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline .field { flex: 1; min-width: 120px; }

#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 11px 18px;
  border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { padding: 22px 16px 28px; text-align: center; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); background: #fff; }
.foot a { color: var(--ink-2); }
.foot-note { margin-top: 6px; font-size: 12px; }
.empty { text-align: center; color: var(--ink-3); padding: 30px 10px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .steps-strip { grid-template-columns: repeat(2, 1fr); }
  .band { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .brand-text small { display: none; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .hero { padding: 30px 0 84px; }
  .booker-body, .booker-head, .booker-foot { padding-left: 16px; padding-right: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .review { grid-template-columns: 1fr; gap: 2px; }
  .review dd { margin-bottom: 8px; }
  .track-form { grid-template-columns: 1fr; }
  .day { min-height: 52px; padding: 6px 0 4px; }
  .day b { font-size: 14.5px; }
  .day small { font-size: 9.5px; }
  .days { gap: 4px; }
  .booker-foot .btn { flex: 1; }
}
