/* admin.veebi.dev: the approved mockup's styles (team/mockups/admin - 28.10.2026/Admin 1.html), plus sign-in and states. */
@font-face { font-family: "Inter Tight"; font-weight: 400; font-display: swap; src: url(/fonts/intertight-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Inter Tight"; font-weight: 500; font-display: swap; src: url(/fonts/intertight-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Inter Tight"; font-weight: 600; font-display: swap; src: url(/fonts/intertight-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Inter Tight"; font-weight: 400; font-display: swap; src: url(/fonts/intertight-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Inter Tight"; font-weight: 500; font-display: swap; src: url(/fonts/intertight-latin-ext-500.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Inter Tight"; font-weight: 600; font-display: swap; src: url(/fonts/intertight-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
/* ---------- tokens ---------- */
:root {
  --bg: #fdf9f4; --panel: #ffffff; --sand: #f1ebe2; --sand-2: #f7f2eb; --line: #e6ded2; --line-2: #d6ccbd;
  --ink: #0b0b0b; --ink-2: #3a3631; --muted: #736c61;
  --red: #d8261c; --red-soft: #fbe3e0;
  --ok: #1f7a45; --ok-soft: #e1f1e6; --warn: #9a5b00; --warn-soft: #fbefd9; --late: #b3261e; --late-soft: #fbe3e0;
  --koristaja: #2e8a57; --haldus: #2350c8; --max: #7b4fd6; --veebi: #0b0b0b;
  --r-s: 8px; --r-m: 14px; --r-l: 20px; --pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 10px 22px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; }
.brand svg { width: 22px; height: 22px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; text-align: left; font-weight: 500; color: var(--ink-2); width: 100%; transition: background .15s; }
.nav-i svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-i:hover { background: var(--sand-2); }
.nav-i[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav-i .count { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 10px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.side-foot button { background: none; border: 0; padding: 0; text-align: left; color: var(--muted); }
.side-foot button:hover { color: var(--ink); }

/* unread badge: a small hand-cut blob */
.count { position: relative; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; font-size: 11.5px; font-weight: 600; color: #fff; isolation: isolate; }
.count::before { content: ""; position: absolute; inset: 0; background: var(--red); border-radius: 58% 42% 55% 45% / 52% 60% 40% 48%; z-index: -1; }
.nav-i[aria-current="page"] .count::before { background: var(--red); }

.main { min-width: 0; padding: 22px 40px 80px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--panel); color: var(--muted); font-size: 14px; text-align: left; }
.search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.search kbd { margin-left: auto; font: 500 11.5px var(--font); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.topbar .updated { margin-left: auto; font-size: 13px; color: var(--muted); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--ink); }

.tabbar { display: none; }

/* ---------- type ---------- */
.eyebrow { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
h1.big { font-size: clamp(40px, 6vw, 68px); font-weight: 500; letter-spacing: -.045em; line-height: .95; margin: 0 0 var(--s6); }
h1.page { font-size: 34px; font-weight: 500; letter-spacing: -.035em; line-height: 1; margin: 0 0 var(--s5); }
h2.sec { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 8px; }
h2.sec .muted { font-weight: 500; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); margin-bottom: 0; }
.sec-head a, .link { font-size: 13px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0; }
.sec-head a:hover, .link:hover { border-color: var(--ink); }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 15px; border-radius: var(--pill); border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, transform .1s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--late); border-color: #e7b8b3; }
.btn.danger:hover { border-color: var(--late); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip b { font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: #b9b1a5; }
.chip:hover:not([aria-pressed="true"]) { border-color: var(--ink); }
.seg { display: inline-flex; padding: 3px; background: var(--sand); border-radius: var(--pill); gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: var(--pill); font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(60,40,10,.12); }

/* product mark: tiny flat paint blob */
.pm { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pm i { width: 11px; height: 10px; flex: none; background: var(--c); border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%; }
.pm.k { --c: var(--koristaja); } .pm.h { --c: var(--haldus); } .pm.m { --c: var(--max); } .pm.v { --c: var(--veebi); }
.pm.m i { background: linear-gradient(90deg, var(--koristaja) 50%, var(--haldus) 50%); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.hot { background: var(--red); color: #fff; }
.tag.back { background: var(--ink); color: var(--bg); }
.tag.glance { background: var(--sand); }
.tag.none { border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.tag.booked { background: var(--ok); color: #fff; }
.tag.called { background: var(--ok-soft); color: var(--ok); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.wait { background: var(--sand); color: var(--ink-2); }
.tag.late { background: var(--late-soft); color: var(--late); }
.tag.paused { border: 1px solid var(--line-2); color: var(--muted); font-weight: 500; }
.tag.demo { background: #ece6fb; color: #5a3aa8; }

/* ---------- Täna ---------- */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s7); align-items: start; }
.block { margin-bottom: var(--s6); }
.rows { list-style: none; margin: 0; padding: 0; }
.rowi { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); transition: opacity .25s, transform .25s var(--ease); }
.rowi.leaving { opacity: 0; transform: translateX(16px); }
.rowi .t { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.rowi .t span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .s { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; }
.rowi.click { cursor: pointer; }
.rowi.click:hover .nm { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.when { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.side-stats { border-top: 1.5px solid var(--ink); }
.kpi { padding: 14px 0; border-bottom: 1px solid var(--line); }
.kpi b { display: block; font-size: 32px; font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cal-i { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cal-i time { font-weight: 600; }
.done { text-align: center; padding: 40px 0 20px; }
.done svg { width: 90px; height: 70px; }
.done p { font-size: 22px; font-weight: 500; letter-spacing: -.03em; margin: 8px 0 2px; }

/* ---------- Tugi ---------- */
.support { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); overflow: hidden; height: calc(100vh - 190px); min-height: 520px; }
.threads { border-right: 1px solid var(--line); overflow: auto; }
.threads-top { padding: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.th { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 2px 10px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; }
.th:hover { background: var(--sand-2); }
.th[aria-current="true"] { background: var(--sand); }
.th .av { grid-row: span 2; }
.th b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th .co { font-size: 12.5px; color: var(--muted); grid-column: 2 / span 2; display: flex; gap: 6px; min-width: 0; }
.th .co span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th .pv { grid-column: 2 / span 2; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; vertical-align: 2px; background: var(--red); border-radius: 55% 45% 50% 50%; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--sand); color: var(--ink-2); }
.conv { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.conv-head .who { min-width: 0; }
.conv-head .who b { display: block; font-weight: 600; }
.conv-head .who span { font-size: 13px; color: var(--muted); }
.conv-head .back { display: none; }
.msgs { overflow: auto; padding: 22px 22px 10px; display: flex; flex-direction: column; gap: 10px; background: var(--sand-2); }
.day { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; background: var(--panel); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-color: var(--ink); border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.msg time { display: block; font-size: 11.5px; opacity: .6; margin-top: 3px; }
.msg.enter { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.composer { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; background: var(--panel); }
.composer textarea { width: 100%; min-height: 64px; max-height: 220px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-m); padding: 11px 14px; font-size: 15px; background: var(--panel); }
.composer textarea:focus { outline: 0; border-color: var(--ink); }
.composer .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer .row .btn:last-child { margin-left: auto; }
.draft-note { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.ctx { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* ---------- tables / lists ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { position: sticky; top: 0; background: var(--bg); text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1.5px solid var(--ink); white-space: nowrap; z-index: 1; }
.tbl td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--sand-2); }
.tbl tbody tr[aria-selected="true"] { background: var(--sand); }
.tbl .nm { font-weight: 600; }
.tbl .sub { font-size: 12.5px; color: var(--muted); }
.tbl .dim td { opacity: .6; }
.cards { display: none; }
.bar { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; margin-left: 8px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar.warn i { background: var(--warn); }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1.5px solid var(--ink); margin-bottom: var(--s5); }
.summary > div { padding: 14px 16px 14px 0; }
.summary b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.summary span { font-size: 13px; color: var(--muted); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(30,22,10,.22); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg); border-left: 1px solid var(--line); z-index: 41; transform: translateX(102%); transition: transform .28s var(--ease); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.dr-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; }
.dr-head h3 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.dr-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.dr-body { flex: 1; overflow: auto; padding: 20px 22px 28px; }
.dr-foot { padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; background: var(--bg); }
.dr-foot .btn { flex: 1; min-height: 46px; font-size: 15px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 15px; }
.input:focus { outline: 0; border-color: var(--ink); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
.dl { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 8px 14px; font-size: 14px; margin: 0 0 22px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bill { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; margin-bottom: 22px; }
.bill .line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.bill .line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 600; font-size: 16px; }
.bill .line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); background: var(--panel); }
.stepper button { width: 38px; height: 36px; border: 0; background: none; font-size: 18px; }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.switch.sub { padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.danger-zone { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-zone p { flex-basis: 100%; margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.tl { list-style: none; margin: 0 0 22px; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 14px 22px; font-size: 14px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; background: var(--line-2); border-radius: 55% 45% 50% 50%; }
.tl li.k::before { background: var(--ink); }
.tl li.h::before { background: var(--red); }
.tl li::after { content: ""; position: absolute; left: 7px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl time { display: block; font-size: 12px; color: var(--muted); }
.copyline { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; font-size: 14px; }
.copyline code { font: 500 14px var(--font); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-top: 1.5px solid var(--ink); margin: 22px 0 28px; }
.stat-grid > div { padding: 14px 14px 0 0; }
.stat-grid b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.035em; line-height: 1.05; }
.stat-grid span { font-size: 13px; color: var(--muted); }
.stat-grid small { display: block; font-size: 12px; color: var(--muted); }
.vgrid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 36px 48px; }
.chart { width: 100%; height: auto; display: block; }
.chart .b { fill: var(--ink); }
.chart .b.we { fill: var(--line-2); }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .avg { stroke: var(--red); stroke-dasharray: 3 3; }
.takeaway { font-size: 14px; margin: 8px 0 0; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 8px 8px; font-size: 14px; border-bottom: 1px solid var(--line); isolation: isolate; }
.hbars li::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: var(--w); background: var(--sand); border-radius: 4px; z-index: -1; }
.hbars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars b { font-weight: 600; font-variant-numeric: tabular-nums; }
.vlist .rowi { grid-template-columns: 54px minmax(0,1fr) auto; }
.vlist .rowi time { grid-row: span 2; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; align-self: start; padding-top: 2px; }
.vlist .rowi .acts { grid-column: 3; }
.vlist .rowi .s { grid-column: 2; }

/* ---------- content / settings ---------- */
.narrow { max-width: 760px; }
.set-sec { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 16px 32px; }
.set-sec h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.set-sec h3 + p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ok-dot { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.ok-dot::before { content: ""; width: 9px; height: 8px; background: var(--ok); border-radius: 55% 45% 50% 50%; }
.log li { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log { list-style: none; padding: 0; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; }
.plan h4 { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.price-in { display: flex; align-items: baseline; gap: 6px; }
.price-in input { width: 70px; font-size: 26px; font-weight: 500; letter-spacing: -.03em; border: 0; border-bottom: 1.5px solid var(--line-2); background: none; padding: 0 0 2px; }
.price-in input:focus { outline: 0; border-color: var(--ink); }

/* ---------- palette, modal, toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(30,22,10,.25); }
.pal { width: min(560px, 100%); background: var(--panel); border-radius: var(--r-l); box-shadow: 0 20px 60px rgba(40,25,5,.22); overflow: hidden; animation: pop .2s var(--ease); }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 17px; }
.pal input:focus { outline: 0; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.pal li button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: none; border-radius: 10px; text-align: left; font-size: 15px; }
.pal li button[aria-selected="true"], .pal li button:hover { background: var(--sand); }
.pal li .k { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.sheet { width: min(620px, 100%); background: var(--bg); border-radius: var(--r-l); box-shadow: 0 20px 60px rgba(40,25,5,.22); padding: 22px; animation: pop .2s var(--ease); max-height: 80vh; overflow: auto; }
.sheet h3 { margin: 0 0 4px; font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.script-say { font-size: 19px; line-height: 1.4; letter-spacing: -.01em; margin: 16px 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); }
.script-hint { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.answers { display: grid; gap: 8px; }
.answers button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.answers button:hover { border-color: var(--ink); }
.answers button span { color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 12px 11px 18px; border-radius: var(--pill); font-size: 14px; display: flex; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: .22s var(--ease); z-index: 80; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { white-space: nowrap; flex: none; background: none; border: 0; color: #f3c9c4; font-weight: 600; padding: 4px 6px; }
.toast button:empty { display: none; }
.mock-note { font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 18px; }

.view { display: none; }
.view.on { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.empty { padding: 50px 0; text-align: center; color: var(--muted); }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 18px; }
  .topbar .updated { display: none; }
  .search { max-width: none; padding: 10px 14px; }
  .search kbd { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(253,249,244,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11.5px; font-weight: 500; color: var(--muted); position: relative; min-height: 52px; }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button[aria-current="page"] { color: var(--ink); }
  .tabbar button[aria-current="page"] svg { stroke-width: 2.1; }
  .tabbar .count { position: absolute; top: 1px; left: calc(50% + 6px); height: 18px; min-width: 20px; font-size: 11px; }
  h1.big { font-size: 46px; margin-bottom: 24px; }
  h1.page { font-size: 30px; margin-bottom: 16px; }
  .today { grid-template-columns: 1fr; gap: 0; }
  .today .aside { order: 2; }
  .rowi .acts .btn.ghost.hide-ph { display: none; }
  .rowi[data-lrow], .rowi[data-crow] { grid-template-columns: minmax(0,1fr); }
  .rowi[data-lrow] .acts, .rowi[data-crow] .acts { grid-row: auto; grid-column: 1; margin-top: 8px; }
  .rowi[data-lrow] .acts .btn:last-child, .rowi[data-crow] .acts .btn:last-child { flex: 1; min-height: 44px; }
  .rowi[data-lrow] .acts .btn.ghost:not(.hide-ph) { width: 52px; min-height: 44px; }
  .rowi .t { flex-wrap: wrap; }
  .rowi .acts .btn { min-height: 40px; padding: 0 14px; }
  .support { display: block; height: auto; min-height: 0; border-radius: var(--r-m); }
  .support.open .threads { display: none; }
  .support:not(.open) .conv { display: none; }
  .support .threads { border-right: 0; }
  .conv { height: calc(100vh - 180px); }
  .conv-head .back { display: grid; }
  .ctx { display: none; }
  .msg { max-width: 86%; }
  .composer .row .btn { min-height: 44px; }
  .tbl { display: none; }
  .cards { display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
  .card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
  .card .nm { font-weight: 600; font-size: 15.5px; min-width: 0; overflow-wrap: anywhere; }
  .card .sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .card .acts { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
  .card .acts .btn { flex: 1; min-height: 44px; }
  .summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary b { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); row-gap: 14px; }
  .vgrid { grid-template-columns: 1fr; }
  .toolbar .right { margin-left: 0; width: 100%; }
  .toolbar .right .btn { flex: 1; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .chips.scroll::-webkit-scrollbar { display: none; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 8px 6px; }
  .set-sec { grid-template-columns: 1fr; gap: 12px; }
  .plans { grid-template-columns: 1fr; }
  .drawer { width: 100vw; border-left: 0; }
  .dl { grid-template-columns: 110px minmax(0,1fr); }
  .modal { padding: 8vh 12px 12px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); border-radius: 16px; }
  .modal.bottom { place-items: end center; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .msgs { padding: 16px 12px 8px; }
}

/* ---------- sign-in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: min(380px, 100%); }
.login-box .brand { padding: 0 0 28px; }
.login-box h1.page { margin-bottom: 10px; }
.login-box p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-box .btn { width: 100%; min-height: 46px; font-size: 15px; }
.login-box .alt { display: block; margin: 16px auto 0; }
.login-box .err { color: var(--late); font-size: 13.5px; margin: -6px 0 14px; }
.code-in { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- states ---------- */
.loading { padding: 40px 0; color: var(--muted); font-size: 14px; }
.cal-i a { font-size: 13px; }
.cal-i .muted { font-size: 13px; }
.cal-day { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 0 0; text-transform: lowercase; }
.sort-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.sort-btn[aria-sort] { color: var(--ink); }
.upload-bar { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.upload-bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.phone-only { display: none; }
@media (max-width: 900px) { .phone-only { display: block; } .wide-only { display: none; } }

/* ---------- phase 2: support files, drafts, sorting, forms ---------- */
.msg .att { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: 8px; }
.msg .att-name { display: block; margin-top: 6px; font-size: .85em; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att-list:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 4px 4px 4px 12px; border-radius: 99px; background: var(--sand); font-size: 12.5px; }
.att-chip button { border: 0; background: none; font-size: 16px; line-height: 1; padding: 2px 6px; cursor: pointer; }
.draft-note { flex-wrap: wrap; justify-content: space-between; background: var(--sand-2); border-radius: var(--r-m); padding: 8px 10px; }
.draft-note svg { flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; margin-top: 2px; }
.draft-note > span:first-of-type { flex: 1; min-width: 200px; }
.draft-acts { display: flex; gap: 12px; font-size: 13px; }
.draft-dot { color: var(--red); font-weight: 500; }
.warn-line { background: var(--late-soft); color: var(--late); border-radius: var(--r-m); padding: 9px 12px; font-size: 13.5px; margin: 0 0 14px; }
.sorth { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.sorth:hover { color: var(--ink); }
.phone-chip { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.opt-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.opt-row [data-on] { grid-column: 1 / 3; }
.copyline + .copyline { margin-top: 6px; }
.rowi.click { cursor: pointer; }
@media (max-width: 900px) {
  .phone-chip { display: inline-flex; }
  .two { grid-template-columns: 1fr; }
  .msg .att { max-height: 200px; }
}

/* Müük > Külastajad: one row per person, tap for each visit (like admin.koristaja.app > Visits) */
.ppl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pp { border-bottom: 1px solid var(--line); }
.pp-row { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 12px 4px; cursor: pointer; }
.pp-row:hover { background: var(--sand-2); }
.pp-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.pp-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pp-top b.anon { font-weight: 500; color: var(--muted); }
.pp-top .when { margin-left: auto; flex: none; color: var(--muted); font-size: 13px; }
.pp-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 13.5px; }
.pp-place { color: var(--ink); font-weight: 500; } .pp-place.none { color: var(--muted); font-weight: 400; }
.pp-visits { list-style: none; margin: 0 0 12px; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.pp-vh { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: 14px; }
.pp-info { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pp-trail { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 6px; font-size: 13px; }
.pp-step { background: var(--sand); border-radius: 99px; padding: 2px 9px; }
.pp-trail .arr { color: var(--muted); }
