@font-face { font-family: "Instrument Sans"; src: url(fonts/InstrumentSans-VF.ttf) format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/BarlowCondensed-600-latin.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/BarlowCondensed-600-latin-ext.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
:root {
  --navy: #14213D; --navy-2: #1C2C52; --amber: #FCA311; --amber-dark: #8A5300;
  --bg: #E9ECF1; --card: #fff; --line: #D9DEE6; --ink: #14213D; --ink-2: #3B4357; --muted: #5F6778;
  --red: #B42318; --red-bg: #FDECEA; --green: #1E7A45; --green-bg: #E3F4EA; --warn-bg: #FFF4DE;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.45 "Instrument Sans", system-ui, sans-serif; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 18px 10px; background: var(--navy); color: #fff; }
.top-logo { height: 24px; }
.top-shop { margin-left: auto; font-size: 15px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.sync { position: sticky; top: calc(44px + var(--safe-t)); z-index: 19; padding: 8px 18px; font-size: 14px; line-height: 1.35; }
.sync.off { background: var(--warn-bg); color: var(--amber-dark); }
.sync.busy { background: #E8EEF8; color: var(--navy-2); }
.sync.pc { background: #E8EEF8; color: var(--navy-2); }
main { padding: 14px 14px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; outline: none; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; font-size: 12.5px; color: var(--muted); border-radius: 12px; min-height: 52px; justify-content: center; }
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--navy); font-weight: 600; }
.tabs a.on svg { stroke-width: 2.4; }
.tabs .tab-new svg { background: var(--amber); color: var(--navy); border-radius: 50%; padding: 4px; width: 34px; height: 34px; stroke-width: 2.6; }

.card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(20, 33, 61, .06); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.btn.big { min-height: 54px; width: 100%; font-size: 17px; }
.btn.danger { color: var(--red); border-color: #F1C6C1; }
.btn.call { background: var(--green-bg); border-color: #B9E0C6; color: var(--green); }
.btn:disabled { opacity: .6; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--navy); }

.plate { display: inline-flex; align-items: center; height: 26px; padding: 0 8px 0 14px; border: 2px solid var(--navy); border-radius: 6px; background: #fff linear-gradient(90deg, #1F4FBF 0 8px, transparent 8px); font: 600 17px/1 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .06em; white-space: nowrap; color: var(--navy); }
.plate.big { height: 40px; font-size: 26px; padding: 0 12px 0 20px; background: #fff linear-gradient(90deg, #1F4FBF 0 12px, transparent 12px); }

/* spárování */
.pair { display: flex; flex-direction: column; gap: 14px; padding-top: calc(30px + var(--safe-t)); text-align: center; }
.pair-logo { width: 72px; height: 72px; margin: 0 auto; }
.pair h1 { font-size: 28px; }
.pair p { margin: 0; }
.pair-msg { background: var(--warn-bg); color: var(--amber-dark); padding: 10px 14px; border-radius: 12px; }
.pair-ios { display: flex; flex-direction: column; gap: 4px; text-align: left; background: #E8EEF8; padding: 12px 14px; border-radius: 12px; }
.ico-share { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; }
.form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 17px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); outline: none; }
#pair-code { font: 600 24px "Barlow Condensed", monospace; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { margin: 0; color: var(--red); min-height: 1em; }

/* kalendář */
.week-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.week-head strong { font-size: 16px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px; border: 0; border-radius: 14px; background: #fff; min-height: 70px; }
.wd span { font-size: 13px; color: var(--muted); }
.wd strong { font-size: 20px; }
.wd i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--amber-dark); min-height: 16px; }
.wd.today strong { color: var(--amber-dark); }
.wd.on { background: var(--navy); color: #fff; }
.wd.on span, .wd.on i { color: #FCD38A; }
.wd.on.today strong { color: #fff; }
.day-title { font-size: 21px; margin: 18px 4px 10px; }
.day-title::first-letter { text-transform: uppercase; }
.appts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.appt { width: 100%; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: start; text-align: left; padding: 14px 14px 14px 12px; border: 0; border-left: 5px solid var(--mc); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(20, 33, 61, .06); }
.appt-time { display: flex; flex-direction: column; font-weight: 700; font-size: 18px; }
.appt-time small { font-weight: 400; font-size: 14px; color: var(--muted); }
.appt-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.appt-body strong { font-size: 17px; }
.appt-car { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.appt-mech { font-size: 13px; color: var(--muted); }
.appt.st-done { opacity: .72; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; background: #EEF1F5; color: var(--ink-2); }
.chip.working { background: var(--warn-bg); color: var(--amber-dark); }
.chip.done { background: var(--green-bg); color: var(--green); }
.pend { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; }
.empty { text-align: center; padding: 30px 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; color: var(--muted); }
.empty p { margin: 0; }

/* spodní panel */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(20, 33, 61, .45); display: flex; align-items: flex-end; animation: fade .18s ease; }
.sheet-back.out { opacity: 0; transition: opacity .18s; }
.sheet { width: 100%; max-height: 88dvh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; animation: up .22s ease; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.sheet h2 { font-size: 22px; }
.sheet p { margin: 0; }
.sh-when { font-weight: 600; } .sh-car { display: flex; align-items: center; gap: 8px; } .sh-work { color: var(--ink-2); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #EEF1F5; padding: 4px; border-radius: 14px; margin-top: 6px; }
.seg button { min-height: 46px; border: 0; border-radius: 11px; background: transparent; font-weight: 600; }
.seg button.on { background: var(--navy); color: #fff; }
.sh-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 6px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* hledání, seznamy */
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--navy); border-radius: 16px; padding: 0 14px; }
.search-box svg { width: 24px; height: 24px; fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; min-height: 54px; font-size: 18px; background: transparent; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 18px 4px 8px; }
.list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 16px; overflow: hidden; }
.list li + li { border-top: 1px solid #EEF1F5; }
.list a, .list button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; text-decoration: none; width: 100%; border: 0; background: none; text-align: left; }
.list a > span:last-child, .list button > span { display: flex; flex-direction: column; min-width: 0; }
.list .muted { font-size: 14px; }
.hint { color: var(--muted); text-align: center; padding: 20px; margin: 0; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--navy-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar.big { width: 60px; height: 60px; font-size: 24px; }

/* detail */
.detail { display: flex; flex-direction: column; gap: 12px; }
.back { align-self: flex-start; text-decoration: none; font-weight: 600; padding: 6px 4px; color: var(--navy-2); }
.car-head, .cust-head { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.car-head h1, .cust-head h1 { font-size: 24px; }
.car-head p, .cust-head p { margin: 0; }
.vin { border: 0; background: #EEF1F5; border-radius: 10px; padding: 8px 12px; font: 600 15px ui-monospace, monospace; letter-spacing: .05em; display: inline-flex; gap: 10px; }
.vin span { background: var(--navy); color: #fff; border-radius: 6px; padding: 0 6px; font-size: 12px; display: inline-flex; align-items: center; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts > div { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.facts span { font-size: 14px; color: var(--muted); }
.facts strong { font-size: 19px; }
.facts .warn { background: var(--warn-bg); }
.actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.photo-btn { cursor: pointer; }
.note { margin: 0; padding: 10px 14px; border-radius: 12px; background: #E8EEF8; color: var(--navy-2); font-size: 15px; }
.owner { display: flex; align-items: center; gap: 12px; }
.owner a { display: flex; flex-direction: column; text-decoration: none; flex: 1; min-width: 0; }
.owner .btn { min-height: 44px; padding: 0 14px; }
.km-form { display: flex; gap: 10px; align-items: flex-end; }
.km-form .field { flex: 1; }
.reps { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 16px; }
.reps li { display: flex; flex-direction: column; padding: 12px 14px; }
.reps li + li { border-top: 1px solid #EEF1F5; }
.reps .muted { font-size: 14px; }
.form-title { font-size: 24px; margin: 4px 4px 0; }
.pick-box { position: relative; }
.pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 33, 61, .18); overflow: hidden; }
.pick-list button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; min-height: 54px; }
.pick-list button + button { border-top: 1px solid #EEF1F5; }
.pick-list button > span { display: flex; flex-direction: column; }
.pick-list p { margin: 0; padding: 12px; }
.info-card { display: flex; flex-direction: column; gap: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 60; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back { animation: none; } .toast { transition: none; } }
