/* ==========================================================================
   RentScooter — design system
   ========================================================================== */
:root {
  --bg: #f3f4fa;
  --surface: #ffffff;
  --surface-2: #f7f7fc;
  --surface-3: #eef0f7;
  --border: #e5e6ef;
  --border-2: #d9dbe7;
  --text: #161a2e;
  --text-2: #3a3f58;
  --muted: #6b7089;
  --primary: #6342f5;
  --primary-600: #5130e3;
  --primary-50: #f1edff;
  --primary-100: #e3dbff;
  --green: #16a34a; --green-50: #e7f8ee; --green-100: #c9f0d8; --green-700: #13643a;
  --red: #dc2626; --red-50: #fdeeee; --red-100: #fbd5d5; --red-700: #b42318;
  --amber: #d97706; --amber-50: #fff5df; --amber-700: #9a5300;
  --indigo: #4f46e5; --indigo-50: #eef0ff;
  --teal: #0d9488; --teal-50: #e3f7f4;
  --side: #121430; --side-2: #1b1e46; --side-text: #c9cbe6;
  --we: rgba(239, 68, 68, .045);
  --grid-line: #eceef5;
  --today-col: rgba(99, 66, 245, .07);
  --r: 14px; --r-sm: 10px; --r-xs: 8px;
  --sh-1: 0 1px 2px rgba(22, 26, 60, .05), 0 2px 10px rgba(22, 26, 60, .04);
  --sh-2: 0 10px 40px rgba(22, 26, 60, .16), 0 2px 8px rgba(22, 26, 60, .08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --side-w: 252px;
  --tabbar-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.locked { overflow: hidden; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
small { font-size: 12px; }
b { font-weight: 650; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-3); padding: 3px 7px; border-radius: 6px; display: inline-block; margin-top: 6px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.danger-text { color: var(--red) !important; }
.ok-text { color: var(--green) !important; }
.spacer { flex: 1; }
.pad { padding: 16px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--surface-3); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none; color: var(--text); user-select: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(99, 66, 245, .3); }
.btn-primary:hover { background: var(--primary-600); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(22, 163, 74, .25); }
.btn-success:hover { background: #12873d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-soft { background: var(--primary-50); color: var(--primary-600); }
.btn-soft:hover { background: var(--primary-100); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; height: auto; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-lg { height: 48px; font-size: 15px; }
.btn.tg { color: #229ed9; } .btn.wa { color: #16a34a; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); flex: none; transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.round { border-radius: 50%; }
.icon-btn.tg { color: #229ed9; } .icon-btn.wa { color: #16a34a; }
.btn-link.danger-text, .btn.danger-text { color: var(--red); }

/* ---------- pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; }
.pill-violet { background: var(--primary-50); color: var(--primary-600); }
.pill-green { background: var(--green-50); color: var(--green-700); }
.pill-red { background: var(--red-50); color: var(--red-700); }
.pill-amber { background: var(--amber-50); color: var(--amber-700); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.status .ic { width: 14px; height: 14px; }
.status-active { background: var(--green-50); color: var(--green-700); }
.status-booked, .status-pickup { background: var(--primary-50); color: var(--primary-600); }
.status-completed { background: var(--surface-3); color: var(--muted); }
.status-cancelled { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.status-overdue { background: var(--red-50); color: var(--red-700); }
.status-maint { background: var(--amber-50); color: var(--amber-700); }
.status-free { background: var(--teal-50); color: var(--teal); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--muted); }
.dot-active { background: var(--green); } .dot-booked { background: var(--primary); } .dot-completed { background: #a3a8bc; }
.dot-cancelled { background: #d4d6e0; } .dot-overdue { background: var(--red); }
b .dot { margin-left: 6px; vertical-align: middle; }

.avatar { --av: #7c5cff; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; color: #fff; background: var(--av); background-image: linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.08)); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* ---------- forms ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[type=date], input[type=time] { padding-right: 6px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7089' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px !important; }
.select-sm { height: 40px !important; width: auto !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.check span { display: inline-flex; align-items: center; gap: 6px; }
.check.danger { color: var(--red-700); }
.check.danger input { accent-color: var(--red); }
.input-ic { position: relative; display: block; }
.input-ic .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ic input { padding-left: 38px !important; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-item { position: relative; flex: 1; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span, .seg-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; border: 0; background: none; }
.seg-item input:checked + span, .seg-btn.on { background: var(--surface); color: var(--primary-600); box-shadow: var(--sh-1); }
.seg-item input:focus-visible + span { outline: 2px solid var(--primary); }
.seg-item .ic { width: 15px; height: 15px; }
.seg-sm .seg-btn { height: 32px; padding: 0 12px; }
.seg-btn .sm { display: none; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: var(--border-2); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ---------- layout ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; color: #fff; }
.logo-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #8b6cff 0%, #5b3df5 55%, #3f22c9 100%); color: #fff; box-shadow: 0 6px 18px rgba(99, 66, 245, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.logo-mark .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: #9ea1c9; font-size: 12.5px; }
.side-new { margin: 0 2px 18px; height: 44px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 13px; height: 46px; padding: 0 14px; border-radius: 12px; color: var(--side-text); font-weight: 550; font-size: 15px; transition: background .15s, color .15s; }
.nav-item .ic { width: 21px; height: 21px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: linear-gradient(135deg, #7b5cff, #5b3df5); color: #fff; box-shadow: 0 6px 16px rgba(91, 61, 245, .35); }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.nav-badge:empty { display: none; }
.nav-badge.danger { background: var(--red); }
.side-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.07); }
.side-foot .nav-item { height: 40px; font-size: 14px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; }
.side-user-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-name b { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-name small { color: #9ea1c9; }
.side-user .icon-btn { background: transparent; border-color: rgba(255,255,255,.1); color: var(--side-text); }
.side-user .icon-btn:hover { background: rgba(255,255,255,.08); }
.main { margin-left: var(--side-w); min-height: 100vh; }
.view { padding: 26px 30px 40px; max-width: 1760px; margin: 0 auto; animation: fadeIn .25s ease; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-head p:first-letter { text-transform: uppercase; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabbar { display: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-1); }
.card-flat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--primary); }
.card-head .muted { font-size: 12.5px; }
.pad-lg { padding: 22px; }
.card-h { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.card-h .ic { color: var(--primary); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-1); min-width: 0; }
.kpi > div { display: flex; flex-direction: column; min-width: 0; }
.kpi small { color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.kpi-money b { font-size: 22px; line-height: 1.5; }
.kpi-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi-ic .ic { width: 24px; height: 24px; }
.kpi-violet .kpi-ic { background: var(--primary-50); color: var(--primary); }
.kpi-green .kpi-ic { background: var(--green-50); color: var(--green); }
.kpi-indigo .kpi-ic { background: var(--indigo-50); color: var(--indigo); }
.kpi-red .kpi-ic { background: var(--red-50); color: var(--red); }
.kpi-teal .kpi-ic { background: var(--teal-50); color: var(--teal); }
.kpi-amber .kpi-ic { background: var(--amber-50); color: var(--amber); }

/* ==========================================================================
   Timeline
   ========================================================================== */
.tl-card { padding: 0; overflow: hidden; margin-bottom: 18px; }
.tl-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tl-title h2 { font-size: 18px; white-space: nowrap; }
.tl-nav { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.tl-period { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border: 0; background: none; font-size: 17px; font-weight: 650; min-width: 210px; justify-content: center; border-radius: 10px; }
.tl-period:hover { background: var(--surface-2); }
.tl-period .ic { color: var(--primary); }
.tl-today { margin-left: 4px; }
.tl-tools { display: flex; align-items: center; gap: 10px; }
.tl-search { position: relative; display: block; }
.tl-search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.tl-search input { height: 36px !important; width: 170px !important; padding-left: 32px !important; font-size: 13px; }
.tl-scroll { overflow: auto; max-height: min(72vh, 900px); position: relative; overscroll-behavior: contain; }
.tl-grid { position: relative; min-width: 100%; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 6; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tl-corner { position: sticky; left: 0; z-index: 7; background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 700; font-size: 14px; border-right: 1px solid var(--border); flex: none; }
.tl-corner small { background: var(--surface-3); color: var(--muted); border-radius: 99px; padding: 1px 7px; font-weight: 650; }
.tl-days { position: relative; flex: none; }
.tl-day { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--grid-line); line-height: 1.15; }
.tl-day b { font-size: 14px; font-weight: 700; }
.tl-day small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.tl-day.we b, .tl-day.we small { color: #dc2626; }
.tl-day.today { background: var(--primary); color: #fff; border-radius: 10px 10px 0 0; }
.tl-day.today b, .tl-day.today small { color: #fff; }
.tl-day.m1 { border-left: 2px solid var(--border-2); }
.tl-mon { position: absolute; top: 1px; left: 3px; font-size: 9.5px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; }
.tl-day.today .tl-mon { color: #fff; }
.tl-body { position: relative; }
.tl-cols { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 0; background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px); background-size: var(--cell) 100%; background-position: -1px 0; }
.tl-col { position: absolute; top: 0; bottom: 0; }
.tl-col.we { background: var(--we); }
.tl-col.today { background: var(--today-col); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 3; margin-left: -1px; }
.tl-now::before { content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.tl-now span { position: absolute; bottom: 4px; left: 4px; font-size: 10px; font-weight: 700; color: var(--red); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.tl-row { display: flex; border-bottom: 1px solid var(--border); position: relative; }
.tl-row:hover .tl-bike { background: var(--surface-2); }
.tl-bike { position: sticky; left: 0; z-index: 4; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border-right: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.tl-thumb { width: 66px; height: 44px; flex: none; display: grid; place-items: center; }
.tl-thumb svg, .tl-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tl-bike-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tl-bike-info b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bike-info span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bike-info small { font-size: 11.5px; color: var(--muted); }
.tl-lane { position: relative; flex: none; z-index: 1; cursor: cell; touch-action: pan-x pan-y; }
.tl-empty { padding: 40px; text-align: center; color: var(--muted); }

.bar { position: absolute; top: 50%; height: 34px; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 9px; border: 1px solid; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 2; transition: box-shadow .15s, filter .15s; user-select: none; }
.bar:hover { box-shadow: 0 4px 14px rgba(22, 26, 60, .16); z-index: 3; }
.bar-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.7); }
.bar-ic .ic { width: 13px; height: 13px; stroke-width: 2.3; }
.bar-txt { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.bar-meta { font-size: 11px; opacity: .7; font-weight: 700; }
.bar-debt { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.bar-active { background: linear-gradient(90deg, #d5f5e1, #e4f9ec); border-color: #9fdfb6; color: var(--green-700); }
.bar-booked { background: linear-gradient(90deg, #e6e0ff, #efebff); border-color: #c5b8ff; color: #4426d6; }
.bar-completed { background: #eef0f5; border-color: #d8dbe5; color: #5f6478; }
.bar-completed .bar-ic { background: rgba(255,255,255,.9); }
.bar-overdue { background: linear-gradient(90deg, #fde2e2, #fdeaea); border-color: #f5a3a3; color: var(--red-700); }
.bar-maint { background: repeating-linear-gradient(-45deg, #fff1e0 0 7px, #ffe4c4 7px 14px); border-color: #f6c58e; color: var(--amber-700); }
.bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.bar-tail { position: absolute; top: 50%; height: 34px; transform: translateY(-50%); border-radius: 0 9px 9px 0; background: repeating-linear-gradient(-45deg, rgba(220, 38, 38, .14) 0 6px, rgba(220, 38, 38, .05) 6px 12px); border: 1px dashed #f5a3a3; border-left: 0; z-index: 1; cursor: pointer; }
.bar-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.bar-handle::after { content: ''; position: absolute; right: 3px; top: 30%; bottom: 30%; width: 3px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .15s; }
.bar:hover .bar-handle::after { opacity: .35; }
.bar.movable { cursor: grab; }
.bar.dragging-src { opacity: .35; }
.bar-ghost { background: rgba(99, 66, 245, .12); border: 2px dashed var(--primary); color: var(--primary-600); pointer-events: none; z-index: 5; justify-content: center; }
.bar-ghost.bad { background: rgba(220, 38, 38, .1); border-color: var(--red); color: var(--red-700); }
body.tl-dragging, body.tl-dragging * { cursor: grabbing !important; user-select: none !important; }

.tl-legend { display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.tl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.tl-legend i { width: 22px; height: 12px; border-radius: 4px; border: 1px solid; }
.lg-active { background: #d5f5e1; border-color: #9fdfb6 !important; }
.lg-booked { background: #e6e0ff; border-color: #c5b8ff !important; }
.lg-completed { background: #eef0f5; border-color: #d8dbe5 !important; }
.lg-overdue { background: #fde2e2; border-color: #f5a3a3 !important; }
.lg-maint { background: repeating-linear-gradient(-45deg, #fff1e0 0 3px, #ffe4c4 3px 6px); border-color: #f6c58e !important; }
.lg-hint { margin-left: auto; color: var(--muted); }
.lg-hint .ic { width: 15px; height: 15px; }

.tl-tip { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; background: #171a2e; color: #fff; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; max-width: 280px; box-shadow: var(--sh-2); opacity: 0; transition: opacity .12s; display: flex; flex-direction: column; gap: 3px; }
.tl-tip.on { opacity: 1; }
.tl-tip b { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.tl-tip .muted { color: #a8abc7; }
.tl-tip .ic { width: 14px; height: 14px; opacity: .8; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-status { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.tip-active { color: #6ee7a0; } .tip-booked { color: #b9a8ff; } .tip-completed { color: #a8abc7; } .tip-overdue { color: #fca5a5; }
.tip-debt { color: #fcd34d; }

/* ---------- ops (today) ---------- */
.ops-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ops { display: flex; flex-direction: column; min-width: 0; }
.ops-list { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.op { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; border: 0; background: none; text-align: left; width: 100%; min-width: 0; }
button.op:hover { background: var(--surface-2); }
.op-time { font-weight: 750; font-size: 13px; min-width: 64px; padding: 5px 8px; border-radius: 8px; background: var(--surface-3); text-align: center; white-space: nowrap; color: var(--text-2); }
.op-time.now { background: var(--primary-50); color: var(--primary-600); }
.op-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.op-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-place { color: var(--muted); }
.op > .ic:last-child { color: var(--muted); width: 16px; }
.op-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.op-overdue .op-ic, .op-missed .op-ic { background: var(--red-50); color: var(--red); }
.op-overdue b, .op-missed b { color: var(--red-700); }
.op-debt .op-ic { background: var(--amber-50); color: var(--amber); }
.ops-empty { display: flex; align-items: center; gap: 10px; padding: 18px 10px; color: var(--muted); }
.ops-empty .ic { color: var(--green); }

/* ---------- modals & drawers ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(16, 18, 40, .42); backdrop-filter: blur(3px); display: flex; opacity: 0; transition: opacity .2s; }
.overlay.in { opacity: 1; }
.overlay-modal { align-items: center; justify-content: center; padding: 24px; }
.overlay-drawer { justify-content: flex-end; }
.modal, .drawer { background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--sh-2); max-height: 100%; }
.modal { border-radius: 18px; width: 100%; transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.2, .9, .3, 1); max-height: calc(100vh - 48px); }
.overlay.in .modal { transform: none; }
.modal-sm { max-width: 460px; } .modal-md { max-width: 640px; } .modal-lg { max-width: 860px; } .modal-xl { max-width: 1120px; }
.drawer { width: min(480px, 100%); height: 100%; transform: translateX(30px); transition: transform .22s cubic-bezier(.2, .9, .3, 1); }
.overlay.in .drawer { transform: none; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.panel-title { flex: 1; min-width: 0; }
.panel-title p { margin-top: 3px; font-size: 13px; }
.panel-close { border: 0; background: var(--surface-3); }
.panel-body { padding: 20px 22px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.panel-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.confirm-text { color: var(--text-2); }

.toasts { position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: #171a2e; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-2); font-weight: 550; transform: translateY(12px); opacity: 0; transition: all .25s; }
.toast.in { transform: none; opacity: 1; }
.toast-ok .ic { color: #6ee7a0; } .toast-error .ic { color: #fca5a5; } .toast-info .ic { color: #a5b4fc; }
.toast-error { background: #4a1414; }

.popmenu { position: fixed; z-index: 1500; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-2); padding: 6px; animation: pop .14s ease; }
.popmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; text-align: left; font-weight: 550; }
.popmenu-item:hover { background: var(--surface-2); }
.popmenu-item .ic { color: var(--muted); }
.popmenu-item.danger { color: var(--red); } .popmenu-item.danger .ic { color: var(--red); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.callout > .ic { margin-top: 1px; color: var(--primary); }
.callout > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.callout span { color: var(--text-2); font-size: 13px; }
.callout.danger { background: var(--red-50); border-color: var(--red-100); } .callout.danger > .ic, .callout.danger b { color: var(--red-700); }
.callout.warn { background: var(--amber-50); border-color: #fde3b0; } .callout.warn > .ic { color: var(--amber); }
.callout.violet { background: var(--primary-50); border-color: var(--primary-100); }
.callout.success { background: var(--green-50); border-color: var(--green-100); } .callout.success > .ic { color: var(--green); }

/* ---------- booking form ---------- */
.bf { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; }
.bf-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.bf-sec { display: flex; flex-direction: column; gap: 12px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 15px; flex-wrap: wrap; }
.sec-title .num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: none; }
.sec-title .switch { margin-left: auto; }
.bf-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.bf-arrow { height: 42px; display: grid; place-items: center; color: var(--muted); }
.dt { display: grid; grid-template-columns: 1fr 96px; gap: 6px; }
.bike-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; padding: 2px; }
.bike-pick-meta { grid-column: 1 / -1; font-size: 12.5px; }
.bp { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; transition: border-color .15s, background .15s; min-width: 0; }
.bp:hover { border-color: var(--primary-100); background: var(--primary-50); }
.bp.on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-100); }
.bp.busy { opacity: .5; cursor: not-allowed; background: var(--surface-2); }
.bp.busy em { color: var(--red); font-style: normal; font-weight: 600; }
.bp-img { width: 58px; height: 38px; flex: none; }
.bp-img svg, .bp-img img { width: 100%; height: 100%; object-fit: contain; }
.bp-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.bp-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-info span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-info small { color: var(--muted); font-size: 11.5px; }
.bp-price { font-weight: 750; font-size: 13px; text-align: right; white-space: nowrap; }
.bp-price small { color: var(--muted); font-weight: 500; }
.bp-check { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; display: none; place-items: center; }
.bp-check .ic { width: 12px; height: 12px; stroke-width: 3; }
.bp.on .bp-check { display: grid; }
.bf-side { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; align-self: start; }
.bf-tariff { font-size: 12px; margin-top: -4px; }
.bf-total { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tot-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.tot-line.warn { color: var(--amber-700); font-weight: 650; }
.tot-line.ok { color: var(--green-700); font-weight: 600; }
.tot-line .ic { width: 16px; height: 16px; }
.tot-sum { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; margin: 2px 0; border-top: 1px dashed var(--border-2); border-bottom: 1px dashed var(--border-2); }
.tot-sum b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.tot-fx { text-align: right; font-size: 12.5px; color: var(--muted); margin: -2px 0 4px; font-variant-numeric: tabular-nums; }
.bf-warn { margin-right: auto; color: var(--red); font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.client-chip { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--primary); background: var(--primary-50); border-radius: 12px; }
.client-chip.bad { border-color: var(--red); background: var(--red-50); }
.client-chip > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.client-chip small { display: flex; align-items: center; gap: 4px; }
.client-chip .ic { width: 14px; height: 14px; }
.csearch { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.csearch .input-ic { width: 100%; }
.csearch-list { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.csearch-hint { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; }
.csearch-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0; background: none; text-align: left; width: 100%; }
.csearch-item:hover { background: var(--surface-2); }
.csearch-item > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.csearch-item small { color: var(--muted); }
.csearch-item.create { color: var(--primary); }
.csearch-item.create > .ic { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--primary-50); }
.csearch-item.bad b { color: var(--red-700); }
.new-client { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.new-client .grid2 { width: 100%; }

/* ---------- booking drawer ---------- */
.bd-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bd { display: flex; flex-direction: column; gap: 16px; }
.bd-bike { display: flex; align-items: center; gap: 14px; }
.bd-bike-img { width: 108px; height: 70px; flex: none; background: var(--surface-2); border-radius: 12px; display: grid; place-items: center; padding: 4px; }
.bd-bike-img svg, .bd-bike-img img { width: 100%; height: 100%; object-fit: contain; }
.bd-bike > div:last-child { display: flex; flex-direction: column; }
.bd-bike b { font-size: 17px; }
.bd-bike small { color: var(--muted); }
.bd-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.bd-dates > div { display: flex; flex-direction: column; }
.bd-dates > div:last-child { text-align: right; }
.bd-dates small { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.bd-dates b { font-size: 20px; font-weight: 800; }
.bd-dates span { color: var(--text-2); font-size: 13px; }
.bd-dur { display: flex !important; flex-direction: column; align-items: center; color: var(--primary); }
.bd-dur span { font-weight: 700; color: var(--primary-600); font-size: 12.5px; white-space: nowrap; }
.bd-client { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.bd-client:hover { border-color: var(--primary-100); }
.bd-client-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bd-client-info span { color: var(--text-2); font-size: 13px; }
.bd-client-info small { color: var(--muted); display: flex; gap: 4px; align-items: center; }
.bd-client-info small .ic { width: 13px; height: 13px; }
.bd-contact { display: flex; gap: 6px; }
.bd-money { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.bd-deposit { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.bd-deposit .ic { width: 16px; color: var(--muted); }
.bd-deposit .pill { margin-left: auto; }
.bd-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.bd-meta dt { color: var(--muted); }
.bd-meta dd { margin: 0; text-align: right; font-weight: 550; }
.bd-notes { display: flex; gap: 10px; padding: 12px; background: #fffbea; border: 1px solid #fbe8a6; border-radius: 12px; font-size: 13.5px; }
.bd-notes .ic { color: var(--amber); }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-actions .btn { flex: 1 1 auto; }
.bd-actions.secondary .btn { flex: 1 1 auto; }
.sub-h { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; }
.sub-h small { color: var(--muted); font-weight: 600; }

/* client drawer */
.cd { display: flex; flex-direction: column; gap: 16px; }
.cd-head { display: flex; gap: 14px; align-items: center; }
.cd-head > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cd-head h3 { font-size: 19px; }
.cd-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.mini-stats small { color: var(--muted); font-weight: 600; }
.mini-stats b { font-size: 17px; font-weight: 800; }
.mini-stats .bad { background: var(--red-50); border-color: var(--red-100); } .mini-stats .bad b { color: var(--red-700); }
.hist { display: flex; flex-direction: column; gap: 4px; }
.hist-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; width: 100%; }
.hist-item:hover { border-color: var(--primary-100); background: var(--primary-50); }
.hist-main, .hist-side { display: flex; flex-direction: column; min-width: 0; }
.hist-main { flex: 1; }
.hist-side { text-align: right; }
.hist-item small { color: var(--muted); }

/* ---------- tables / lists ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; background: none; border-radius: 9px; font-weight: 600; color: var(--muted); white-space: nowrap; font-size: 13.5px; }
.tab span { font-size: 11.5px; background: var(--surface-3); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.tab.on { background: var(--primary-50); color: var(--primary-600); }
.tab.on span { background: var(--primary); color: #fff; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px !important; height: 42px; }
.list-card { overflow: hidden; }
.tbl { display: flex; flex-direction: column; }
.tr { display: grid; align-items: center; gap: 14px; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; width: 100%; min-width: 0; }
.tr > span { display: flex; flex-direction: column; min-width: 0; }
.tr > span b, .tr > span small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr small { color: var(--muted); }
button.tr:hover { background: var(--surface-2); }
.tr:last-child { border-bottom: 0; }
.th { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 10px; }
.r { text-align: right; align-items: flex-end; }
.cell-client { flex-direction: row !important; align-items: center; gap: 10px; }
.cell-client > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cell-status { flex-direction: row !important; flex-wrap: wrap; gap: 4px; align-items: center; }
.bk-tbl .tr { grid-template-columns: 52px minmax(180px, 1.5fr) minmax(150px, 1.2fr) minmax(130px, 1fr) 120px minmax(150px, 1fr); }
.cl-tbl .tr { grid-template-columns: minmax(200px, 1.6fr) minmax(150px, 1.1fr) minmax(120px, 1.2fr) 70px 130px 100px; }
.more-btn { margin: 12px auto; display: flex; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 20px; color: var(--muted); }
.empty > .ic { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--primary-50); color: var(--primary); }
.empty h3 { color: var(--text); }

/* ---------- bikes ---------- */
.bike-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.bike-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--sh-1); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.bike-card:hover { box-shadow: 0 10px 30px rgba(22, 26, 60, .1); transform: translateY(-2px); }
.bike-card.archived { opacity: .65; }
.bc-img { --tint: #888; position: relative; height: 160px; display: grid; place-items: center; cursor: pointer; background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--tint) 16%, #fff) 0%, #f7f7fc 60%); padding: 18px 26px 10px; }
.bc-img svg, .bc-img img { width: 100%; height: 100%; object-fit: contain; }
.bc-img img { border-radius: 10px; }
.bc-img .status { position: absolute; top: 12px; right: 12px; box-shadow: var(--sh-1); }
.bc-code { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 750; background: rgba(255,255,255,.9); border: 1px solid var(--border); padding: 3px 8px; border-radius: 8px; }
.bc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bc-body h3 { font-size: 17px; }
.bc-body > p { margin-top: -6px; }
.bc-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 0; text-align: left; font-size: 13px; color: var(--text-2); width: 100%; }
button.bc-line:hover { background: var(--primary-50); }
.bc-line .ic { width: 16px; color: var(--muted); }
.bc-line em { margin-left: auto; font-style: normal; font-weight: 650; color: var(--text); }
.bc-prices { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bc-prices > div { display: flex; flex-direction: column; align-items: center; padding: 7px 4px; }
.bc-prices > div + div { border-left: 1px solid var(--border); }
.bc-prices small { color: var(--muted); font-size: 11px; }
.bc-prices b { font-size: 14px; }
.bc-stats { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bc-stats > div { display: flex; align-items: center; gap: 10px; }
.bc-stats small { color: var(--muted); font-size: 12.5px; flex: 1; }
.bc-stats .meter { width: 80px; }
.bc-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); align-items: center; }
.bc-foot .btn:first-child { flex: 1; }
.meter { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b6cff, #5b3df5); }
.meter.hi i { background: linear-gradient(90deg, #34d399, #16a34a); }
.meter.lo i { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.archived { margin-top: 22px; }
.archived .bike-grid { margin-top: 12px; }

.bike-form { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; }
.bike-form-preview { display: flex; flex-direction: column; gap: 12px; }
.bfp-img { height: 150px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; padding: 12px; }
.bfp-img svg, .bfp-img img { width: 100%; height: 100%; object-fit: contain; }
.bfp-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--border-2); padding: 0; position: relative; }
.sw.on { box-shadow: 0 0 0 2px var(--primary); }
.sw-custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; cursor: pointer; }
.sw-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- reports ---------- */
.kpis-rep { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis-rep .kpi b { font-size: 22px; line-height: 1.5; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { min-width: 150px; text-align: center; font-size: 16px; }
.rep-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.rep-grid .card { min-width: 0; padding-bottom: 12px; }
.chart { width: 100%; height: 230px; display: block; padding: 0 12px; }
.chart .grid-l { stroke: var(--grid-line); }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .ax.val { font-weight: 700; fill: var(--text-2); }
.bar-r { fill: #8b74ff; }
.bar-r.b-we { fill: #a593ff; }
.bar-r.b-today { fill: var(--primary); }
.bar-r.b-future { fill: #d9d0ff; }
.bar-r:hover { fill: var(--primary-600); }
.chart-legend { display: flex; gap: 16px; padding: 0 18px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: #8b74ff; }
.chart-legend i.b-future { background: #d9d0ff; }
.hbars { display: flex; flex-direction: column; gap: 12px; padding: 6px 18px 8px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 12px; font-size: 13px; }
.hbar .meter { width: 100%; height: 10px; }
.hbar b { text-align: right; }
.rep-bikes .tr { grid-template-columns: minmax(150px, 1.5fr) 120px minmax(140px, 1fr); }
.util { flex-direction: row !important; align-items: center; gap: 10px; }
.util .meter { flex: 1; height: 9px; }
.util b { width: 40px; text-align: right; }
.top-cl { display: flex; flex-direction: column; padding: 0 10px; }
.top-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.top-item:hover { background: var(--surface-2); }
.rank { width: 22px; text-align: center; font-weight: 800; color: var(--muted); }
.rep-wide { grid-column: span 1; }
.rep-full { grid-column: 1 / -1; }
.rep-full .hbars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.link-box { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.link-box:last-child { border-bottom: 0; }
.link-box p { font-size: 13px; margin-top: 3px; }
.link-actions { display: flex; gap: 6px; flex: none; }
.roadmap { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.roadmap li { display: flex; gap: 10px; align-items: flex-start; }
.set-grid .callout { margin-bottom: 12px; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(90% 70% at 20% 10%, #3a2bb0 0%, transparent 60%), radial-gradient(80% 60% at 90% 90%, #6d28d9 0%, transparent 60%), linear-gradient(160deg, #121430, #1b1e46); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand b { font-size: 19px; font-weight: 800; display: block; }
.login-brand small { color: #b5b8e0; font-size: 13px; }
.login-hero { margin: auto 0; max-width: 520px; }
.login-hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -.03em; }
.login-hero p { margin-top: 16px; font-size: 17px; color: #c9cbe6; line-height: 1.5; }
.login-bikes { display: flex; gap: 10px; align-items: flex-end; margin-top: 30px; }
.login-bikes svg { width: 32%; max-width: 220px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.login-bikes svg:nth-child(2) { width: 36%; max-width: 250px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-form > p { margin-top: -8px; }
.login-err { color: var(--red); font-weight: 600; min-height: 20px; font-size: 13.5px; }
.demo-hint { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--primary-50); border-radius: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.demo-hint .ic { color: var(--primary); }
.demo-hint .btn-link { margin-left: auto; }
.shake { animation: shake .4s; }
.fatal { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.fatal > .ic { width: 48px; height: 48px; color: var(--red); }

/* ---------- scooter illustration ---------- */
.scooter { display: block; }

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ==========================================================================
   TV board (dark, large)
   ========================================================================== */
body.board-mode {
  --bg: #0c0e22; --surface: #15183a; --surface-2: #1b1f47; --surface-3: #252a5a; --border: #262b5c; --border-2: #323873;
  --text: #f1f2ff; --text-2: #c7cae9; --muted: #8f93bd; --grid-line: #22275a; --we: rgba(239, 68, 68, .07); --today-col: rgba(124, 92, 255, .16);
  --primary-50: rgba(124, 92, 255, .18); --green-50: rgba(22, 163, 74, .2); --indigo-50: rgba(79, 70, 229, .25); --red-50: rgba(220, 38, 38, .2); --teal-50: rgba(13, 148, 136, .22); --amber-50: rgba(217, 119, 6, .22);
  --sh-1: none; color-scheme: dark; font-size: 16px;
}
.view-board { padding: 0 !important; max-width: none !important; }
.board { min-height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 20px 26px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.board-brand { display: flex; align-items: center; gap: 14px; }
.board-brand b { font-size: 24px; font-weight: 800; display: block; }
.board-brand small { color: var(--muted); font-size: 15px; }
.board-clock { text-align: center; }
.board-clock b { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.board-clock span { color: var(--muted); font-size: 17px; }
.board-clock span:first-letter { text-transform: uppercase; }
.board-btns { display: flex; gap: 8px; }
.board-btns .icon-btn { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.board-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.board-kpis .kpi { padding: 18px 22px; }
.board-kpis .kpi b { font-size: 44px; }
.board-kpis .kpi small { font-size: 16px; }
.board-kpis .kpi-sub { font-size: 14px; }
.board-kpis .kpi-ic { width: 64px; height: 64px; }
.board-kpis .kpi-ic .ic { width: 30px; height: 30px; }
.board-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; flex: 1; min-height: 0; }
.board-tl { padding: 0; overflow: hidden; }
.board-tl .tl-scroll { max-height: none; }
.board-mode .tl-bike-info b { font-size: 16px; }
.board-mode .tl-bike-info span { font-size: 14px; }
.board-mode .tl-bike { overflow: hidden; }
.board-mode .tl-bike-info { line-height: 1.25; gap: 2px; }
.board-mode .tl-bike-info small { font-size: 13px; }
.board-mode .tl-dense .tl-bike-info b { font-size: clamp(13px, calc(var(--row, 60px) * .27), 16px); }
.board-mode .tl-dense .tl-bike-info small { font-size: clamp(11px, calc(var(--row, 60px) * .22), 13.5px); color: var(--text-2); }
.board-mode .tl-dense .tl-thumb { height: min(44px, calc(var(--row, 60px) - 12px)); width: min(66px, calc((var(--row, 60px) - 12px) * 1.5)); }
.board-mode .tl-day b { font-size: 16px; }
.board-mode .tl-day small { font-size: 12px; }
.board-mode .bar { height: min(42px, calc(var(--row, 70px) - 14px)); font-size: 15px; }
.board-mode .bar-tail { height: min(42px, calc(var(--row, 70px) - 14px)); }
.board-mode .bar-active { background: linear-gradient(90deg, #11613a, #157a49); border-color: #22a35f; color: #e3ffef; }
.board-mode .bar-booked { background: linear-gradient(90deg, #3b2b9e, #4a37bf); border-color: #6d58ee; color: #f0ecff; }
.board-mode .bar-completed { background: #2a2f5e; border-color: #3a4078; color: #b2b6dc; }
.board-mode .bar-overdue { background: linear-gradient(90deg, #7f1d1d, #9b2424); border-color: #ef4444; color: #ffe4e4; }
.board-mode .bar-maint { background: repeating-linear-gradient(-45deg, #5c3a0c 0 8px, #6e470f 8px 16px); border-color: #d97706; color: #ffe7c2; }
.board-mode .bar-ic { background: rgba(255,255,255,.18); }
.board-mode .tl-now span { background: var(--bg); }
.board-mode .tl-head, .board-mode .tl-corner { background: var(--surface-2); }
.board-mode .op-time { font-size: 15px; }
.board-mode .op-main b { font-size: 16px; }
.board-mode .op-main small { font-size: 13.5px; }
.board-mode .card-head h3 { font-size: 18px; }
.board-mode .bar-debt { display: none; }
.board-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.board-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1720px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-ic { width: 40px; height: 40px; }
  .kpi-ic .ic { width: 20px; height: 20px; }
  .kpi small { font-size: 12.5px; }
  .kpi b { font-size: 25px; }
  .kpi-money b, .kpis-rep .kpi b { font-size: 19px; line-height: 1.6; }
}
@media (max-width: 1500px) {
  .lg-hint { display: none !important; }
}
@media (max-width: 1400px) and (min-width: 1281px), (max-width: 1150px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  :root { --side-w: 78px; }
  .sidebar { padding: 18px 12px; align-items: center; }
  .brand-txt, .nav-item span, .side-new span, .side-user-name, .side-foot .nav-item span { display: none; }
  .brand { padding: 4px 0 18px; }
  .side-new { width: 46px; padding: 0; margin: 0 0 18px; }
  .nav-item { width: 52px; justify-content: center; padding: 0; }
  .nav-badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; font-size: 10.5px; }
  .side-user { flex-direction: column; padding: 12px 0 0; }
  .view { padding: 22px 22px 36px; }
  .bf { grid-template-columns: minmax(0, 1fr) 320px; }
  .rep-grid { grid-template-columns: 1fr; }
  .board-main { grid-template-columns: 1fr; }
  .board-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .tl-nav { margin: 0; }
  .tl-toolbar { gap: 10px; }
  .tl-tools { width: 100%; justify-content: space-between; }
  .tl-search input { width: 100% !important; }
  .tl-search { flex: 1; }
  .ops-grid { grid-template-columns: 1fr 1fr; }
  .ops-grid .ops:last-child { grid-column: 1 / -1; }
  .set-grid { grid-template-columns: 1fr; }
  .bf { grid-template-columns: 1fr; }
  .bf-side { align-self: stretch; }
  .bk-tbl .tr { grid-template-columns: 44px minmax(160px, 1.5fr) minmax(130px, 1fr) minmax(110px, 1fr) 110px minmax(120px, 1fr); }
}

/* tablets portrait & phones: bottom tab bar */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--border); align-items: center; justify-content: space-around; }
  .tabbar > a, .tabbar > button:not(.tab-fab) { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; color: var(--muted); font-size: 11px; font-weight: 600; border: 0; background: none; }
  .tabbar .ic { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--primary); }
  .tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; background: var(--primary); }
  .tab-fab { width: 56px; height: 56px; border-radius: 18px; border: 0; background: linear-gradient(135deg, #7b5cff, #5b3df5); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(91, 61, 245, .4); margin-top: -22px; flex: none; }
  .tab-fab .ic { width: 28px; height: 28px; stroke-width: 2.2; }
  .view { padding: 18px 16px 28px; }
  .hide-sm { display: none !important; }
  h1 { font-size: 23px; }
  .page-head { margin-bottom: 14px; align-items: center; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; gap: 10px; }
  .kpi-ic { width: 40px; height: 40px; }
  .kpi-ic .ic { width: 20px; height: 20px; }
  .kpi b { font-size: 24px; }
  .kpi-money b { font-size: 18px; }
  .bike-form { grid-template-columns: 1fr; }
  .bike-form-preview { display: grid; grid-template-columns: 160px 1fr; align-items: start; }
  .bfp-img { grid-row: span 3; height: 110px; }
  .board { padding: 14px; }
  .board-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-side { grid-template-columns: 1fr; }
  .board-clock b { font-size: 36px; }
}

/* phones */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .page-head .page-actions .btn-primary { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi-money { grid-column: 1 / -1; }
  .kpis-rep .kpi b { font-size: 18px; }
  .kpi small { font-size: 12px; }
  .ops-grid { grid-template-columns: 1fr; }
  .tl-card { margin: 0 -16px 16px; border-radius: 0; border-left: 0; border-right: 0; }
  .tl-toolbar { padding: 12px 14px; }
  .tl-title { display: none; }
  .tl-nav { width: 100%; justify-content: space-between; }
  .tl-period { min-width: 0; font-size: 15.5px; flex: 1; padding: 0 6px; }
  .tl-today { display: none; }
  .tl-tools { flex-direction: column-reverse; align-items: stretch; }
  .tl-views { display: flex; width: 100%; }
  .seg-btn { flex: 1; }
  .seg-btn .lg { display: none; } .seg-btn .sm { display: inline; }
  .tl-scroll { max-height: 64vh; }
  .tl-bike { padding: 0 8px; gap: 6px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .tl-thumb { display: none; }
  .tl-bike-info b { font-size: 12.5px; }
  .tl-bike-info span { font-size: 11px; }
  .tl-legend { gap: 10px 14px; padding: 10px 14px; font-size: 11.5px; }
  .bar { height: 30px; font-size: 12px; padding: 0 6px; gap: 4px; }
  .bar-tail { height: 30px; }
  .bar-ic { width: 17px; height: 17px; }
  .overlay-modal { padding: 0; align-items: flex-end; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 94vh; transform: translateY(40px); }
  .panel-foot { border-radius: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .panel-foot .btn { flex: 1; }
  .panel-foot .bf-warn { flex-basis: 100%; }
  .panel-foot .spacer { display: none; }
  .panel-head { padding: 16px 16px 12px; }
  .panel-body { padding: 16px; }
  .overlay-drawer { align-items: flex-end; }
  .drawer { width: 100%; height: 94vh; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .grid2, .grid3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bf-dates { grid-template-columns: 1fr; }
  .bf-arrow { display: none; }
  .dt { grid-template-columns: 1fr 108px; }
  .bike-pick { grid-template-columns: 1fr; max-height: 280px; }
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { font-size: 16px; } /* no iOS zoom */
  .search { max-width: none; min-width: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .select-sm { width: 100% !important; }
  /* table rows → cards */
  .th { display: none !important; }
  .tr { grid-template-columns: 1fr auto !important; gap: 6px 12px; padding: 12px 14px; }
  .bk-tbl .tr > span:first-child { display: none; }
  .bk-tbl .tr > .cell-client { grid-column: 1 / -1; }
  .bk-tbl .tr > span:nth-child(3) { grid-column: 1; }
  .bk-tbl .tr > span:nth-child(5) { grid-column: 2; grid-row: 2 / span 2; }
  .bk-tbl .tr > span:nth-child(4) { grid-column: 1; }
  .bk-tbl .cell-status { grid-column: 1 / -1; }
  .cl-tbl .tr > span:nth-child(3), .cl-tbl .tr > span:nth-child(6) { display: none; }
  .cl-tbl .tr > .cell-client { grid-column: 1; }
  .cl-tbl .tr > span:nth-child(2) { grid-column: 1; }
  .cl-tbl .tr > span:nth-child(4) { display: none; }
  .cl-tbl .tr > span:nth-child(5) { grid-column: 2; grid-row: 1 / span 2; }
  .rep-bikes .tr { grid-template-columns: 1fr auto !important; }
  .rep-bikes .util { grid-column: 1 / -1; }
  .bike-grid { grid-template-columns: 1fr; }
  .bc-img { height: 150px; }
  .bd-dates b { font-size: 17px; }
  .month-label { min-width: 120px; }
  .page-actions { width: 100%; }
  .view-reports .page-actions { justify-content: center; }
  .hbar { grid-template-columns: 90px 1fr 30px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 24px; min-height: auto; }
  .login-hero { margin: 26px 0 0; }
  .login-hero h1 { font-size: 30px; }
  .login-hero p { font-size: 15px; }
  .login-bikes { display: none; }
  .login-form-wrap { padding: 28px 22px 40px; place-items: start center; }
  .board-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-kpis .kpi b { font-size: 30px; }
  .board-head { flex-wrap: wrap; }
  .board-brand { display: none; }
  .link-box { flex-direction: column; }
  .set-grid .pad-lg { padding: 18px; }
}
@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpi-ic { display: none; }
}

/* very large screens / TVs */
@media (min-width: 2200px) {
  body.board-mode { font-size: 20px; }
  .board-kpis .kpi b { font-size: 60px; }
  .board-clock b { font-size: 72px; }
  .board-main { grid-template-columns: minmax(0, 1fr) 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .tabbar, .page-actions { display: none !important; }
  .main { margin: 0; }
}

/* booking form: nearest free suggestions */
.suggest { grid-column: 1 / -1; border: 1px dashed var(--primary-100); background: linear-gradient(180deg, var(--primary-50), transparent); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.suggest-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--primary-600); padding: 2px 4px 6px; }
.suggest-h .ic { width: 16px; height: 16px; }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; }
.suggest-item:hover { border-color: var(--primary); }
.suggest-item .grow { display: flex; flex-direction: column; min-width: 0; }
.suggest-item small { color: var(--muted); font-size: 11.5px; }
.suggest-date { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.suggest-date b { color: var(--primary-600); font-size: 13px; }

/* phones: compact KPI tiles (3 x 2) so the timeline stays near the top */
@media (max-width: 720px) {
  .view-home .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .view-home .kpis .kpi-money { grid-column: auto; }
  .view-home .kpi { padding: 10px 10px 9px; border-radius: 12px; }
  .view-home .kpi-ic { display: none; }
  .view-home .kpi small { font-size: 11px; white-space: normal; line-height: 1.2; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .view-home .kpi b { font-size: 22px; }
  .view-home .kpi-money b { font-size: 15px; line-height: 1.75; }
  .view-home .kpi-sub { display: none; }
  .view-home .kpi-green .kpi-sub { display: block; font-size: 10.5px; }
  .view-home .kpi-green .kpi-sub:not(:has(.danger-text)) { display: none; }
  .view-home .page-head p { font-size: 13px; }
}

/* TV board fills exactly one screen */
.board { height: 100vh; overflow: hidden; }
.board-main { min-height: 0; }
.board-tl { display: flex; flex-direction: column; min-height: 0; }
.board-tl .tl-scroll { flex: 1; min-height: 0; }
.board-side { overflow: hidden; }
.board-side .ops { min-height: 0; overflow: hidden; }
.board-side .ops-list { overflow: hidden; }
@media (max-width: 1280px) { .board { height: auto; overflow: visible; } .board-tl .tl-scroll { max-height: 70vh; } }

/* Board on smaller / lower screens (laptop, 720p TV): one KPI row, tighter spacing, more room for the timeline */
@media (min-width: 1101px) { .board-mode .board-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1101px) and (max-height: 920px), (min-width: 1101px) and (max-width: 1600px) {
  .board { gap: 10px; padding: 12px 18px; }
  .board-brand b { font-size: 20px; }
  .board-brand small { font-size: 13px; }
  .board-clock b { font-size: 38px; }
  .board-clock span { font-size: 14px; }
  .board-kpis .kpi { padding: 10px 14px; gap: 12px; }
  .board-kpis .kpi b { font-size: 30px; }
  .board-kpis .kpi small { font-size: 14px; }
  .board-kpis .kpi-sub { font-size: 12.5px; }
  .board-kpis .kpi-ic { width: 44px; height: 44px; }
  .board-kpis .kpi-ic .ic { width: 22px; height: 22px; }
  .board-main { grid-template-columns: minmax(0, 1fr) 330px; gap: 10px; }
  .board-side { gap: 10px; }
  .board-mode .card-head h3 { font-size: 16px; }
  .board-foot { font-size: 12px; }
}
.board-side .ops { flex: 0 1 auto; }
.board-side .ops:last-child { flex: 1 1 0; }
.board-side .ops-empty { padding-top: 6px; padding-bottom: 6px; }
.board-side .ops:last-child .ops-list { -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); }
.fx-rows { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 6px; }
.fx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 120px auto; align-items: center; gap: 8px; }
.fx-eq, .fx-base { color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
@media (max-width: 720px) { .fx-row { grid-template-columns: minmax(0, 1fr) auto 90px auto; gap: 6px; } }

/* ===== Rental agreement (preview + print) ===== */
.ct-preview { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.ct-doc { background: #fff; color: #111; font-size: 12.5px; line-height: 1.4; padding: 26px 30px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.12); max-width: 820px; margin: 0 auto; }
.ct-doc small { display: block; color: #666; font-size: .82em; font-weight: 400; }
.ct-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; }
.ct-head > div { display: flex; flex-direction: column; }
.ct-head b { font-size: 16px; }
.ct-head span { color: #555; }
.ct-no { text-align: right; align-items: flex-end; }
.ct-doc h1 { font-size: 19px; text-align: center; margin: 16px 0 12px; text-transform: uppercase; letter-spacing: .02em; }
.ct-doc h1 small { text-transform: none; letter-spacing: 0; font-size: 12px; }
.ct-doc h2 { font-size: 13px; margin: 14px 0 6px; text-transform: uppercase; display: flex; gap: 6px; align-items: baseline; }
.ct-doc h2 small { display: inline; text-transform: none; }
.ct-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ct-doc table { width: 100%; border-collapse: collapse; }
.ct-doc th, .ct-doc td { border-bottom: 1px solid #ddd; padding: 4px 6px; text-align: left; vertical-align: top; }
.ct-doc th { width: 42%; font-weight: 600; }
.ct-wide th { width: 30%; }
.ct-blank { display: inline-block; min-width: 120px; }
.ct-fx { color: #666; font-size: .9em; }
.ct-terms { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ct-boxes { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ct-check p { margin: 8px 0 0; }
.ct-lines i { display: block; border-bottom: 1px solid #999; height: 22px; }
.ct-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.ct-sign div { display: flex; flex-direction: column; gap: 4px; color: #555; font-size: 11.5px; }
.ct-sign span { border-bottom: 1px solid #111; height: 34px; }
@media (max-width: 720px) {
  .ct-preview { padding: 6px; }
  .ct-doc { padding: 14px; font-size: 11.5px; }
  .ct-cols { grid-template-columns: 1fr; gap: 0; }
}
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff !important; }
  body.printing .ct-doc { box-shadow: none; padding: 0; max-width: none; font-size: 11px; }
  @page { margin: 12mm; }
}
.terms-area { width: 100%; font-size: 13px; line-height: 1.45; resize: vertical; min-height: 160px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== Quick search ===== */
.side-search { display: flex; align-items: center; gap: 10px; margin: -8px 2px 16px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13.5px; text-align: left; }
.side-search:hover { border-color: var(--primary); color: var(--text-2); }
.side-search span { flex: 1; }
.side-search .ic { width: 17px; height: 17px; }
kbd { font: 600 11px/1 inherit; font-family: inherit; padding: 3px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
@media (max-width: 1280px) { .side-search { width: 44px; justify-content: center; padding: 0; } .side-search span, .side-search kbd { display: none; } }
.qs { display: flex; flex-direction: column; gap: 12px; }
.qs-input input { height: 46px !important; font-size: 15px; }
.qs-res { display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.qs-hint { color: var(--muted); text-align: center; padding: 26px 8px; margin: 0; }
.qs-sec h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; background: none; text-align: left; color: inherit; }
.qs-item:hover, .qs-item:focus { background: var(--surface-2); border-color: var(--border); outline: none; }
.qs-item > .ic { color: var(--muted); width: 16px; height: 16px; flex: none; }
.qs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qs-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-thumb { width: 48px; height: 32px; flex: none; display: grid; place-items: center; }
.qs-thumb svg, .qs-thumb img { width: 100%; height: 100%; object-fit: contain; }
.qs-item .status { flex: none; }

/* overdue tail: ends at the "now" line, shows what has accrued */
.bar-tail { border-radius: 0 4px 4px 0; display: flex; align-items: center; overflow: hidden; }
.bar-tail span { padding: 0 8px 0 10px; font-size: 11.5px; font-weight: 700; color: var(--red-700); white-space: nowrap; }
.board-mode .bar-tail span { color: #ffb4b4; font-size: 13px; }

/* ===== 4 price tiers, service ===== */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.bc-prices-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.bc-prices-4 b { font-size: 13.5px !important; }
.bc-prices-4 small { font-size: 10.5px !important; white-space: nowrap; }
.tier-on { color: var(--primary-600); font-weight: 700; }
.bc-svc { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); text-align: left; }
.bc-svc .ic { width: 15px; height: 15px; color: var(--muted); }
.bc-svc span { flex: 1; }
.bc-svc em { font-style: normal; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.bc-svc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bc-svc.soon { border-color: #f5c46b; background: var(--amber-50); color: var(--amber-700); }
.bc-svc.due { border-color: #f5a3a3; background: var(--red-50); color: var(--red-700); font-weight: 650; }
.bc-svc.soon .ic, .bc-svc.due .ic { color: currentColor; }
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.work { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.work:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.work input { margin: 0; accent-color: var(--primary); }
.m-last-box { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--text-2); height: 100%; }
.m-last-box > div { display: flex; flex-direction: column; gap: 1px; }
.m-last-box b { font-size: 12.5px; color: var(--text); }
.m-last-box .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.svc-next { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.svc-next .ic { width: 16px; height: 16px; }
.svc-next.soon { background: var(--amber-50); color: var(--amber-700); }
.svc-next.due { background: var(--red-50); color: var(--red-700); }
.svc-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.svc-item { display: grid; grid-template-columns: 92px 1fr; gap: 2px 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.svc-item small { grid-column: 2; color: var(--muted); }
@media (max-width: 720px) { .works { grid-template-columns: 1fr 1fr; } .work { font-size: 12px; padding: 6px 8px; } }

/* ===== client documents ===== */
.req { font-style: normal; font-weight: 500; color: var(--amber-700); margin-left: 6px; font-size: 11.5px; }
.docs-ed, .docs-gal { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-th { position: relative; width: 112px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.doc-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-th > span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.doc-th a { display: block; width: 100%; height: 100%; }
.doc-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
.doc-del .ic { width: 14px; height: 14px; }
.doc-add { width: 112px; height: 84px; border: 1.5px dashed var(--border-2); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; font-size: 11.5px; color: var(--text-2); cursor: pointer; padding: 6px; }
.doc-add:hover { border-color: var(--primary); color: var(--primary-600); }
.doc-add.need { border-color: #f5c46b; background: var(--amber-50); color: var(--amber-700); font-weight: 600; }
.doc-add.busy { opacity: .5; pointer-events: none; }
.doc-add .ic { width: 20px; height: 20px; }
.doc-need { width: 100%; text-align: left; border: 0; cursor: pointer; margin-top: 4px; }
.docs-gal + .doc-need { margin-top: 8px; }
.issue-docs > span { color: var(--amber-700); display: flex; align-items: center; gap: 6px; }
.issue-docs > span .ic { width: 15px; height: 15px; }
.issue-docs.shake { animation: shake .4s; }
.warn-text { color: var(--amber-700); font-weight: 600; }

/* ===== KPI links, bike filters, order ===== */
a.kpi-link { color: inherit; text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; cursor: pointer; }
a.kpi-link:hover { border-color: var(--primary-100); box-shadow: 0 6px 18px rgba(30, 27, 75, .08); transform: translateY(-1px); }
.kpi-go { position: absolute; right: 10px; top: 10px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.kpi-go .ic { width: 15px; height: 15px; }
a.kpi-link:hover .kpi-go { opacity: 1; }
@media (hover: none) { .kpi-go { display: none; } }
.bike-filters { margin: -6px 0 14px; }
.bike-filters .chip small { color: var(--muted); font-weight: 650; margin-left: 2px; }
.bike-filters .chip.on small { color: inherit; opacity: .8; }
.tl-order { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 3px 8px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.tl-order:hover { border-color: var(--primary); color: var(--primary-600); }
.tl-order .ic { width: 13px; height: 13px; }
@media (max-width: 720px) { .tl-order span { display: none; } .tl-order { padding: 3px 5px; } }
.ord-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ord-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.ord-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ord-row.dragging { opacity: .4; }
.ord-row.over { border-color: var(--primary); box-shadow: 0 -2px 0 var(--primary); }
.ord-grip { color: var(--muted); cursor: grab; display: grid; }
.ord-grip .ic { width: 16px; height: 16px; }
.ord-n { width: 20px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ord-img { width: 52px; height: 34px; flex: none; display: grid; place-items: center; }
.ord-img svg, .ord-img img { width: 100%; height: 100%; object-fit: contain; }
.ord-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ord-main b { font-size: 13.5px; }
.ord-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-row [data-up] .ic { transform: rotate(90deg); }
.ord-row [data-down] .ic { transform: rotate(90deg); }
.ord-row .icon-btn[disabled] { opacity: .3; }

/* ===== contract templates ===== */
.ct-doc h1, .ct-doc h2 { font-size: 17px; margin: 6px 0 10px; text-transform: none; letter-spacing: 0; display: block; }
.ct-doc h3 { font-size: 13.5px; margin: 14px 0 6px; text-transform: none; display: block; }
.ct-doc p { margin: 0 0 6px; }
.ct-doc ol, .ct-doc ul { margin: 0 0 8px; padding-left: 22px; }
.ct-doc li { margin-bottom: 3px; }
.ct-doc table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.ct-doc td, .ct-doc th { border: 1px solid #cfcfcf; padding: 4px 8px; vertical-align: top; }
.ct-doc td p { margin: 0; }
.ct-doc img { max-width: 100%; }
.ct-blank { display: inline-block; min-width: 110px; border-bottom: 1px solid #888; }
.ct-page + .ct-page { margin-top: 16px; }
.ct-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tpl-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.tpl-item > div { flex: 1; display: flex; flex-direction: column; }
.tpl-item small { color: var(--muted); font-size: 12px; }
.tpl-flag { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.te { display: flex; flex-direction: column; gap: 10px; }
.te-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; position: sticky; top: -18px; z-index: 2; background: var(--surface); padding: 6px 0; }
.te-btn { min-width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; color: var(--text); padding: 0 6px; }
.te-btn:hover { border-color: var(--primary); }
.te-sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.te-mode { margin-left: auto; }
.te-page { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.te-area, .te-prev { min-height: 420px; max-width: 820px; margin: 0 auto; outline: none; }
.te-area:focus { box-shadow: 0 0 0 2px var(--primary-100), 0 1px 4px rgba(0,0,0,.12); }
.tok { display: inline-block; background: #ede9fe; color: #5b21b6; border-radius: 5px; padding: 0 4px; font-weight: 600; font-size: .95em; line-height: 1.35; white-space: nowrap; user-select: all; }
.tok.bad { background: #fee2e2; color: #b91c1c; }
.te-hint { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.te-hint .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.te-hint code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
@media (max-width: 720px) { .te-mode { margin-left: 0; } .te-page { padding: 6px; } .te-area, .te-prev { min-height: 300px; } }
@media print {
  body.printing .ct-page { page-break-after: always; break-after: page; }
  body.printing .ct-page:last-child { page-break-after: auto; break-after: auto; }
  body.printing .ct-doc td, body.printing .ct-doc th { border-color: #999; }
}

/* ===== photo viewer ===== */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 9, 20, .94); display: flex; flex-direction: column; opacity: 0; transition: opacity .18s; }
.lightbox.in { opacity: 1; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff; font-weight: 600; }
.lb-top span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-n { font-variant-numeric: tabular-nums; opacity: .8; font-weight: 600; }
.lb-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-x svg { width: 20px; height: 20px; }
.lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 0 12px 16px; }
.lb-slide img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 8px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
@media (hover: none) { .lb-nav { display: none; } }

/* ===== bike photos ===== */
.bc-img.has-photo, .bfp-img.has-photo { padding: 0; overflow: hidden; }
.bc-img.has-photo img, .bfp-img.has-photo img { object-fit: cover; border-radius: 0; }
.bfp-img.has-photo { cursor: zoom-in; }
.bc-img .bc-code { z-index: 1; }
.bc-photos { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 0; border-radius: 99px; background: rgba(17, 24, 39, .62); color: #fff; font-size: 12px; font-weight: 650; }
.bc-photos .ic { width: 13px; height: 13px; }
.bfp-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bfp-th { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; border: 2px solid transparent; }
.bfp-th.is-main { border-color: var(--primary); }
.bfp-pick { width: 100%; height: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: pointer; display: block; }
.bfp-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bfp-badge { position: absolute; left: 0; right: 0; bottom: 0; background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 700; text-align: center; padding: 1px 0; text-transform: uppercase; letter-spacing: .03em; }
.bfp-th .doc-del { width: 20px; height: 20px; top: 3px; right: 3px; }
.bfp-add { aspect-ratio: 4 / 3; border: 1.5px dashed var(--border-2); border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--text-2); cursor: pointer; text-align: center; }
.bfp-add:hover { border-color: var(--primary); color: var(--primary-600); }
.bfp-add.busy { opacity: .5; pointer-events: none; }
.bfp-add .ic { width: 18px; height: 18px; }
.bfp-hint { font-size: 11.5px; line-height: 1.35; }
.bfp-th, .bfp-add { min-width: 0; width: 100%; }
.bfp-pick { position: absolute; inset: 0; }

/* Photos of any size/orientation must never grow their frame: fixed 100% tracks + clipping, real photos fill the frame */
.bc-img, .bfp-img, .tl-thumb, .qs-thumb, .ord-img, .bd-bike-img { grid-template-columns: 100%; grid-template-rows: 100%; overflow: hidden; min-width: 0; }
.bc-img > img, .bfp-img > img, .tl-thumb > img, .qs-thumb > img, .ord-img > img, .bd-bike-img > img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.tl-thumb > img, .qs-thumb > img, .ord-img > img { border-radius: 7px; }
.bd-bike-img:has(> img) { padding: 0; }
.bd-bike-img > img { border-radius: 12px; }
.bc-img, .bfp-img, .tl-thumb, .qs-thumb, .ord-img, .bd-bike-img { position: relative; }
.bc-img > img, .bfp-img > img, .tl-thumb > img, .qs-thumb > img, .ord-img > img, .bd-bike-img > img { position: absolute; inset: 0; }
.bc-img:not(.has-photo) > img, .bfp-img:not(.has-photo) > img { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }

/* 5 price tiers */
.grid-tiers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.grid-tiers .fld { display: flex; flex-direction: column; justify-content: flex-end; }
.grid-tiers .fld > span { line-height: 1.2; }
@media (max-width: 1100px) { .grid-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid-tiers { grid-template-columns: 1fr 1fr; } }
.bc-prices-tiers { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.bc-prices-tiers > div { padding-left: 2px !important; padding-right: 2px !important; min-width: 0; }
.bc-prices-tiers b { font-size: 12.5px !important; white-space: nowrap; }
.bc-prices-tiers small { font-size: 10px !important; white-space: nowrap; }
.kpi-sub .kpi-profit { font-size: inherit !important; line-height: inherit !important; font-weight: 700; color: var(--green-700); display: inline; letter-spacing: 0; }

/* deposit in other currencies, equipment */
.dfx { display: flex; flex-wrap: wrap; gap: 8px; }
.dfx-item { position: relative; flex: 1 1 110px; }
.dfx-item input { width: 100%; padding-right: 64px !important; }
.dfx-item em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); pointer-events: none; }
.eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.eq-note { width: 100%; }

/* contract: borderless layout tables, page breaks, document copies */
.ct-doc table.nb td, .ct-doc table.nb th { border: 0; padding: 2px 8px 2px 0; }
.ct-doc hr.pb { border: 0; border-top: 2px dashed #c7c7d6; margin: 18px -10px; position: relative; overflow: visible; }
.ct-doc hr.pb::after { content: 'новая страница'; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: #fff; color: #8b8ba3; font-size: 10.5px; padding: 0 8px; }
.te-wide { padding: 0 10px !important; font-size: 12.5px !important; }
.ct-what { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-what .work { padding: 6px 10px; }
.ct-what .work .ic { width: 15px; height: 15px; vertical-align: -3px; }
.ct-what .work.off { opacity: .5; cursor: not-allowed; }
.ct-copy-head { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #ccc; padding-bottom: 6px; margin-bottom: 10px; font-size: 12px; }
.ct-copy img { display: block; max-width: 100%; max-height: 640px; margin: 0 auto 10px; object-fit: contain; }
.ct-copy.multi img { max-height: 330px; }
@media print {
  body.printing .ct-doc hr.pb { border: 0; margin: 0; page-break-after: always; break-after: page; }
  body.printing .ct-doc hr.pb::after { display: none; }
  body.printing .ct-copy img { max-height: 235mm; }
  body.printing .ct-copy.multi img { max-height: 115mm; }
}

/* public demo */
.demo-open { width: 100%; margin-top: 4px; }
.demo-note { text-align: center; margin: 8px 0 0; }
.demo-bar { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); font-size: 13px; line-height: 1.4; }
.demo-bar .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.demo-bar b { color: inherit; }
.main > .demo-bar { margin: 16px 30px -10px; max-width: 1700px; }
@media (max-width: 1100px) { .main > .demo-bar { margin: 14px 22px -8px; } }
@media (max-width: 720px) { .main > .demo-bar { margin: 12px 16px -6px; font-size: 12px; } }
