/* GOAT CE – appka vodiča (mobil). Alpine Daybreak, svetlý + tmavý (podľa telefónu). */
:root {
  --bg: #F4F7F6;
  --panel: #FFFFFF;
  --panel2: #EBF1EF;
  --border: #DCE6E2;
  --text: #13251F;
  --muted: #5A6B66;
  --accent: #00736E;
  --accent2: #1F8A5B;
  --danger: #C4452E;
  --warn: #A8700A;
  --firm-bud: #C2603B;          /* Budapešť – terakota */
  --firm-vba: #3F73C4;          /* Viedeň + Bratislava – modrá */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1417;
    --panel: #10211F;
    --panel2: #16302C;
    --border: #26403A;
    --text: #E8F1ED;
    --muted: #94ABA4;
    --accent: #45C9BF;
    --accent2: #3FB984;
    --danger: #E8745C;
    --warn: #E2A63F;
    --firm-bud: #E89070;
    --firm-vba: #7FA8E8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-size: 17px; font-weight: 700; flex: 1;
  display: flex; align-items: center; gap: 8px; }
.brand span { color: var(--muted); font-weight: 400; }
.brand-logo { height: 28px; width: auto; }
.iconbtn {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 18px; padding: 6px 12px;
}
.net { background: var(--danger); color: #fff; font-size: 11px;
  padding: 3px 9px; border-radius: 10px; }

.pending {
  background: var(--warn); color: #1a1a1a; font-size: 14px;
  padding: 8px 14px; display: flex; align-items: center; gap: 8px;
}
.pending .mini {
  margin-left: auto; border: none; border-radius: 8px;
  padding: 5px 12px; font-size: 13px; background: #1a1a1a; color: #fff;
}

.screen { flex: 1; overflow-y: auto; padding: 14px; }
.hidden { display: none !important; }

/* ── Prihlásenie ── */
.login-box { max-width: 360px; margin: 8vh auto 0; text-align: center; }
.login-logo img { width: 110px; height: auto; }
.login-box h2 { margin: 6px 0 2px; }
.login-box input { margin-top: 12px; }
.login-box .big { margin-top: 16px; width: 100%; }
.err { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 18px; }

/* „Zabudol som heslo" – textový odkaz pod prihlásením (nie tlačidlo-blok) */
.linkish { background: none; border: 0; padding: 10px 4px; margin-top: 6px;
  width: 100%; color: var(--muted); font-size: 14px; text-decoration: underline;
  cursor: pointer; }

/* „Zostať prihlásený 24 h" – zafajknutie pod heslom. Zámerne veľký zásah
   prstom (22 px + celý riadok je <label>): vodič to ťuká v aute, na mobile. */
.remember { display: flex; gap: 10px; align-items: flex-start; text-align: left;
  margin: 14px 2px 0; font-size: 14px; color: var(--text); cursor: pointer; }
.remember input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.remember span { line-height: 1.3; }
.remember small { display: block; margin-top: 3px; font-size: 12px;
  color: var(--muted); line-height: 1.3; }

/* GDPR súhlas (checkbox + text) pri prvom prihlásení */
.consent { display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 0 4px; font-size: 13px; color: var(--text); font-weight: 400; }
.consent input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; }
.consent span { line-height: 1.35; }

/* ── Prvky ── */
input, select {
  width: 100%; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 12px; font-size: 16px; font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent2); }
label { display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin: 14px 0 5px; }
.muted { color: var(--muted); font-size: 13px; }

.big {
  width: 100%; padding: 15px; font-size: 17px; font-weight: 600;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text);
}
.big.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.big.primary:active { background: var(--accent2); }
.big.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.big:disabled { opacity: .55; }
.row { display: flex; gap: 10px; margin-top: 18px; }

/* ── Výlety ── */
#btn-new-trip { margin-bottom: 14px;
  box-shadow: 0 6px 16px -6px rgba(14, 124, 102, .35); }
/* karta hore: meno + sadzby (per typ) */
.rates-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.rc-name { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.rc-rates { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-rate {
  flex: 1; min-width: 90px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; text-align: center;
}
.rc-rate span { display: block; font-size: 12px; color: var(--muted); }
.rc-rate b { font-size: 17px; color: var(--accent2); }

/* meno + preklik do profilu (sadzby už na hlavnej obrazovke nie sú) */
.rc-name { display: flex; align-items: center; justify-content: space-between; }
.rc-link { background: none; border: 0; padding: 0; color: var(--accent2);
  font-size: 14px; font-weight: 600; cursor: pointer; }

/* prepínač dní – vodič má často 2-3 dni po sebe */
.day-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px;
  padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab { flex: 0 0 auto; background: var(--panel2);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
  white-space: nowrap; }
.day-tab.past { color: var(--muted); }
.day-tab.active { background: var(--accent2); border-color: var(--accent2);
  color: #fff; }

/* história jázd */
.hist-nav { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 12px; }
.hist-nav b { font-size: 16px; }
.hist-nav .btn { min-width: 44px; font-size: 20px; line-height: 1; }
.hi-sum { background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.hi-row { display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.hi-l { min-width: 0; }
.hi-l span { display: block; font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-r { text-align: right; flex: 0 0 auto; }
.hi-r b { color: var(--accent2); }
.hi-exp, .hi-paid { display: block; font-size: 12px; color: var(--muted); }

/* poznámka pod tlačidlom trasy */
.r-route-note { margin-top: 8px; font-size: 12.5px; color: var(--muted);
  line-height: 1.35; }

/* prepínač firiem (vodič robí pre obe – fakturuje im zvlášť) */
.co-switch { display: flex; gap: 6px; margin-bottom: 12px;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; }
.co-seg { flex: 1; background: none; border: 0; border-radius: 9px;
  padding: 10px 6px; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; }
.co-seg.active { background: var(--accent2); color: #fff; }

/* profil */
.pf-row { display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.pf-row span { color: var(--muted); }
.pf-row b { text-align: right; }
.pf-h { margin: 16px 0 4px; font-size: 15px; }
.pf-note { margin-top: 12px; font-size: 13px; }

.sum-card {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 14px; padding: 13px 16px; margin-bottom: 12px; color: #fff;
}
.sum-title { font-size: 13px; opacity: .85; text-transform: capitalize; }
.sum-line { font-size: 16px; margin-top: 3px; }
.sum-note { font-size: 12px; opacity: .85; margin-top: 4px; }

.trip {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 14px; margin-bottom: 12px;
}
.t-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.t-date { font-weight: 700; font-size: 15px; }
.t-type { color: var(--muted); font-size: 14px; flex: 1; }
.t-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 9px; }
.tag.pend { background: var(--warn); color: #1a1a1a; }
.tag.fail { background: var(--danger); color: #fff; }
/* stav nákladu: čaká na potvrdenie šéfom / potvrdené; výlet vyplatený */
.tag.wait { background: none; border: 1px solid var(--warn); color: var(--warn); }
.tag.appr { background: none; border: 1px solid var(--accent2); color: var(--accent2); }
.tag.paid { background: var(--accent); color: #fff; }

.exp {
  display: flex; align-items: center; gap: 9px;
  border-top: 1px solid var(--border); padding: 9px 0; font-size: 15px;
}
.exp:first-of-type { margin-top: 9px; }
.exp .e-cat { font-size: 18px; }
.exp .e-amt { font-weight: 700; white-space: nowrap; }
.exp .e-note { color: var(--muted); font-size: 13px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp .e-del { background: none; border: none; color: var(--muted);
  font-size: 17px; padding: 4px 6px; }

.t-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.t-add {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; font-weight: 600;
}

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* História: každá jazda sa dá rozkliknúť na detail (výplata + bločky) */
.hi-click { cursor: pointer; }
.hi-chev { color: var(--muted); font-size: 12px; margin-left: 6px; }
.hi-det {
  background: var(--panel2); border-radius: 12px;
  padding: 10px 12px; margin: -2px 0 10px;
}
.hi-d-line { font-size: 13px; margin-bottom: 6px; }
.hi-roster, .hi-add {
  margin-top: 10px; width: 100%; background: var(--panel);
  color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 14px; font-weight: 600;
}
/* dodatočný bloček k starej jazde – rovnaké tlačidlo ako na hlavnej obrazovke */
.hi-add { border-color: var(--accent); }
.hi-det .exp { margin-top: 6px; }

/* Tlačidlá pod zoznamom jázd — oddelené linkou, nech nesplynú s poslednou kartou */
.main-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── Modaly ── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; z-index: 20;
}
.sheet {
  background: var(--panel); width: 100%; max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 10px 16px
    calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
/* úchytka hore – jasné, že je to vysúvacie okno */
.sheet::before {
  content: ""; display: block; width: 42px; height: 4px;
  border-radius: 2px; background: var(--border); margin: 0 auto 12px;
}
.sheet h3 { margin: 0 0 4px; }
/* Prilepená hlavička okna: pri dlhom zozname (recenzie) sa dá zavrieť hneď,
   netreba skrolovať na koniec za tlačidlom „Zavrieť". */
.sheet-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); margin: 0 -16px 8px; padding: 2px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.sheet-head h3 { flex: 1; margin: 0; }
.sheet-x {
  flex: 0 0 auto; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  width: 36px; height: 36px; font-size: 16px; line-height: 1;
}
.sheet hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.sheet .big { margin-top: 10px; }

.cats { display: flex; gap: 9px; }
.cats button {
  flex: 1; padding: 13px 4px; font-size: 14px; line-height: 1.5;
  background: var(--panel2); color: var(--text);
  border: 2px solid var(--border); border-radius: 12px;
}
.cats button.sel { border-color: var(--accent2); background: var(--accent); color: #fff; }

#exp-preview img { margin-top: 10px; max-width: 100%; max-height: 180px;
  border-radius: 10px; border: 1px solid var(--border); }

/* ── Kalendár „Kedy môžem robiť" ── */
.avail-note {
  background: var(--panel2); border: 1px solid var(--warn);
  color: var(--text); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; margin: 12px 0; line-height: 1.4;
}
.cal-nav { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
#cal-month { flex: 1; text-align: center; font-weight: 700; font-size: 16px;
  text-transform: capitalize; }
.cal-legend { display: flex; gap: 16px; justify-content: center;
  font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cdot.bud { background: var(--firm-bud); }
.cdot.vba { background: var(--firm-vba); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted);
  font-weight: 600; padding: 2px 0; }
.cal-blank { aspect-ratio: 1; }
.cal-cell {
  aspect-ratio: 1; position: relative; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; padding: 0;
}
.cal-cell.today { border-color: var(--accent2); }
.cal-cell.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-cell.past { opacity: .4; }
.cc-num { font-weight: 600; line-height: 1; }
.cc-dots { display: flex; gap: 3px; height: 8px; }
.cc-dots .cdot { width: 7px; height: 7px; }
.cc-count {
  position: absolute; top: 2px; right: 4px;
  font-size: 10px; color: var(--muted); font-weight: 600;
}
.cal-cell.sel .cc-count { color: #fff; opacity: .85; }

.cal-day {
  margin-top: 14px; background: var(--panel2);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
}
.cd-head { font-weight: 700; font-size: 15px; margin-bottom: 10px;
  text-transform: capitalize; }
.cd-firm { display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--border); }
.cd-firm:first-of-type { border-top: none; }
.cd-name { display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 15px; }

/* ── Dispatch riadok na karte výletu + rozpis vyzdvihnutí ── */
.t-dispatch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-top: 6px; }
.t-roster {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
}
.r-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; padding: 6px 0 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.stop { border-bottom: 1px solid var(--border); padding: 10px 0; }
.stop:last-of-type { border-bottom: none; }
.s-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 15px; }
.s-pax, .s-time, .s-nat { font-size: 13px; color: var(--muted);
  white-space: nowrap; }
.s-addr { font-size: 14px; margin-top: 3px; line-height: 1.35;
  overflow-wrap: anywhere; }
/* kontakt na hosťa – volanie aj WhatsApp vedľa seba */
.s-contact { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.s-phone { display: inline-block; margin-top: 4px; font-size: 14px;
  color: var(--accent2); text-decoration: none; }
.s-wa { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 600;
  color: #128C4A; text-decoration: none; }
@media (prefers-color-scheme: dark) { .s-wa { color: #25D366; } }
.s-note { font-size: 13px; color: var(--muted); margin-top: 3px;
  overflow-wrap: anywhere; }
.warn-text { color: var(--warn); }
.r-route {
  display: block; text-align: center; margin-top: 14px;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 12px; padding: 13px 14px; font-size: 16px; font-weight: 700;
}
/* tmavý režim: svetlozelený accent + biely text má ~2:1 kontrast — tu tmavý text */
@media (prefers-color-scheme: dark) {
  .r-route { color: #0A1417; }
}
.cd-count { color: var(--muted); font-size: 13px; flex: 1; }
.cd-toggle {
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); border-radius: 10px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.cd-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cd-toggle:disabled { opacity: .5; }

/* ── Prišiel / Neprišiel pri zastávke ── */
/* Dve veľké tlačidlá vedľa seba — vodič ťuká v behu, jednou rukou. */
.s-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 9px; }
.s-act .big { width: auto; flex: 1; min-width: 130px; padding: 13px 10px;
  font-size: 15px; margin-top: 0; }
.ns-chip { font-size: 14px; font-weight: 700; padding: 7px 11px;
  border-radius: 10px; background: var(--panel2); border: 1px solid var(--border); }
.ns-chip.ok { color: var(--accent2); border-color: var(--accent2); }
.ns-chip.bad { color: var(--danger); border-color: var(--danger); }
.ns-open { background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; }
/* Oprava preklikaného „Prišiel". Zámerne drobná a bledá — ťuká sa raz za čas
   a nesmie konkurovať dvom veľkým tlačidlám ani zvádzať k omylu. */
.ns-fix { background: none; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 10px;
  padding: 5px 9px; font-size: 12px; font-weight: 600; }

/* Nedokončené dôkazy — pruh pod hlavičkou, viditeľný aj na prihlásení.
   Musí trčať: vodičovi beží odpočet a bez tohto vstupu sa k fotkám offline
   nedostane. */
.ns-todo {
  background: var(--panel); border-bottom: 2px solid var(--danger);
  padding: 8px 14px 10px;
}
.ns-todo-h { font-size: 13px; font-weight: 700; color: var(--danger);
  margin-bottom: 6px; }
.ns-todo-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ns-todo-w { flex: 1; min-width: 0; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-todo-t { font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; }

/* okno „zákazník neprišiel" */
.ns-notify { margin-top: 10px; font-size: 14px; line-height: 1.35;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; }
.ns-count { text-align: center; font-size: 40px; font-weight: 700;
  letter-spacing: 2px; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
#ns-hint { text-align: center; }
.ns-slot { margin-top: 14px; }
.ns-slot label { margin-bottom: 6px; }
/* druhá cesta k tomu istému slotu: výber z galérie namiesto fotenia */
.ns-slot label.ns-alt { margin-top: 8px; font-size: 14px; opacity: .7; }
.ns-prev img { margin-top: 8px; max-width: 100%; max-height: 150px;
  border-radius: 10px; border: 1px solid var(--border); }
/* zamknuté sloty pred vypršaním odpočtu */
.ns-locked { opacity: .55; }
.ns-locked input { pointer-events: none; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 11px; font-size: 14px;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 86%; z-index: 30; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--danger); }
