/* DRX – dizajn C „Petrolejový“ */
:root {
  --black: #000000;
  --lime: #d0fe1d;
  --lime-2: #bde80f;
  --teal: #006f72;
  --teal-2: #005a5d;
  --teal-soft: #e0f2f2;
  --teal-ink: #b3e0e1;
  --white: #ffffff;
  --bg: #f4f7f7;
  --card: #ffffff;
  --text: #000000;
  --muted: #5b6b6c;
  --faint: #8a9797;
  --line: #dde5e5;
  --line-2: #eef2f2;
  --soft: #f0f3f3;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #006f72;
  --radius: 20px;
  --radius-sm: 14px;
  --sidebar: 248px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
a:hover { color: var(--teal-2); }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 .9rem; }
h3 { font-size: 15px; font-weight: 800; margin: 0 0 .6rem; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.ic { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.big { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.danger { color: var(--danger); }
.prewrap { white-space: pre-wrap; margin: 0; }
.mt { margin-top: 1.75rem; }
[hidden] { display: none !important; }

/* ---------- Sidebar (dispečer) ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--teal); color: var(--white); padding: 28px 20px 20px; display: flex; flex-direction: column; gap: 26px; z-index: 30; overflow-y: auto; }
body.has-sidebar main { margin-left: var(--sidebar); }
.sb-brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.sb-brand:hover { color: var(--white); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--lime); color: var(--black); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; letter-spacing: .02em; flex-shrink: 0; }
.logo-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 20px; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sb-brand-text strong { font-size: 15px; font-weight: 800; }
.sb-brand-text small { font-size: 12px; color: var(--teal-ink); }
.sb-new { height: 46px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { height: 44px; padding: 0 14px; border-radius: 12px; color: #d9f0f0; text-decoration: none; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.sb-nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sb-nav a.active { background: rgba(255,255,255,.16); color: var(--white); font-weight: 700; }
.sb-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--lime); color: var(--black); font-size: 11px; font-weight: 800; }
.sb-month { margin-top: auto; border-radius: 16px; background: rgba(0,0,0,.22); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.sb-month small { font-size: 12px; color: var(--teal-ink); font-weight: 600; }
.sb-month strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.sb-month span { font-size: 12px; color: var(--lime); font-weight: 700; }
.sb-user { position: relative; }
.sb-user summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.sb-user summary::-webkit-details-marker { display: none; }
.sb-user summary:hover { background: rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--black); color: var(--lime); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.sb-user-pop { position: absolute; left: 0; bottom: calc(100% + 8px); background: var(--white); color: var(--text); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 10px; min-width: 210px; display: flex; flex-direction: column; gap: 2px; z-index: 40; }
.sb-user-pop.right { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); }
.sb-user-pop a, .sb-user-pop .linkbtn { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; width: 100%; }
.sb-user-pop a:hover, .sb-user-pop .linkbtn:hover { background: var(--soft); }
.sb-user-pop .muted { padding: 6px 10px; }

/* ---------- Driver bar ---------- */
.driverbar { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--teal); color: var(--white); }
.driverbar .avatar { width: 38px; height: 38px; border-radius: 19px; }
body.driver-job .driverbar { display: none; }

/* ---------- Layout ---------- */
.container { max-width: none; padding: 32px 40px 72px; }
body:not(.has-sidebar) .container { margin: 0 auto; }
.narrow { max-width: 480px; }
.narrow-mobile { max-width: 640px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.section { margin-bottom: 28px; }
.section > h2 { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
@media (min-width: 1700px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 520px; } }
@media (max-width: 1200px) { .grid-2, .detail-grid, .grid-2.even { grid-template-columns: 1fr; } }

.searchbox { width: 340px; max-width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: var(--muted); }
.searchbox input { border: 0; outline: 0; padding: 0; background: transparent; font-size: 14px; }
.searchbox:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,111,114,.15); }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: var(--teal-soft); color: var(--teal-2); }
.flash-error { background: var(--danger-soft); color: #8a1f17; }
.flash-info { background: #fbffe6; color: #3d4a00; border: 1px solid #e6f7a3; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #c3cfcf; color: var(--text); }
.btn-primary { background: var(--black); border-color: var(--black); color: var(--white); }
.btn-primary:hover { background: #1c1c1e; border-color: #1c1c1e; color: var(--white); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-2); border-color: var(--teal-2); color: var(--white); }
.btn-lime, .btn-accent { background: var(--lime); border-color: var(--lime); color: var(--black); font-weight: 800; }
.btn-lime:hover, .btn-accent:hover { background: var(--lime-2); border-color: var(--lime-2); color: var(--black); }
.btn-outline { background: var(--white); border: 1.5px solid var(--black); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn-xl { height: 64px; padding: 0 24px; font-size: 20px; font-weight: 800; border-radius: 20px; }
.btn-block { display: flex; width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font: inherit; font-weight: 600; }
.linkbtn.danger { color: var(--danger); }
.iconbtn { border: 1px solid var(--line); background: var(--white); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover { color: var(--text); }
.iconbtn.danger:hover { color: var(--danger); border-color: var(--danger); }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.chip:hover { border-color: #c3cfcf; color: var(--text); }
.chip.active { background: var(--black); border-color: var(--black); color: var(--white); font-weight: 700; }
details.more { position: relative; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); color: var(--text); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.16); padding: 14px; min-width: 260px; display: flex; flex-direction: column; gap: 12px; z-index: 30; }
.more-pop form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.more-pop form:last-child { border: 0; padding-bottom: 0; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,111,114,.15); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); }
input[type=file] { padding: 8px; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 15px; color: var(--text); align-self: end; padding-bottom: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid .span-2 { grid-column: span 2; }
.fgrid .span-3 { grid-column: span 3; }
.fgrid .span-4 { grid-column: 1 / -1; }
.fgrid .stop-note-switch { align-self: end; padding-bottom: 12px; }
@media (max-width: 760px) { .fgrid { grid-template-columns: 1fr 1fr; } .fgrid .span-2, .fgrid .span-3 { grid-column: 1 / -1; } }
.select-sm { padding: 4px 8px; font-size: 12px; width: auto; border-radius: 8px; }
.subform { border-top: 1px solid var(--line-2); margin-top: 18px; padding-top: 18px; }
.hint { color: var(--muted); align-self: end; padding-bottom: 12px; }
.ai-filled { background: #fbffe6; border-color: #c9e86a; }
.new-customer { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
.inline-form > strong, .inline-form > span { align-self: center; }
label.compact { font-size: 12px; }
.note-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.form-actions { display: flex; gap: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 75%, transparent); padding: 16px 0 18px; z-index: 5; }

/* ---------- Order form + preview ---------- */
.form-layout.has-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 44%); gap: 20px; align-items: start; }
.form-preview { position: sticky; top: 24px; height: calc(100vh - 48px); background: var(--white); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); gap: 10px; font-size: 14px; }
.preview-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-preview iframe { flex: 1; border: 0; width: 100%; background: #525659; }
@media (max-width: 1200px) { .form-layout.has-preview { grid-template-columns: 1fr; } .form-preview { position: static; height: 70vh; } }
.dropzone { border: 2px dashed #b7c9c9; border-radius: var(--radius); background: var(--white); padding: 28px; text-align: center; margin-bottom: 16px; cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: #f7fcfc; }
.dz-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.dz-idle { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dz-busy, .dz-done { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ok-mark { color: var(--teal); font-weight: 800; display: inline-flex; vertical-align: middle; }
.stop-row { border-radius: 16px; padding: 16px; margin-bottom: 12px; background: var(--bg); }
.stop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stop-head select { width: auto; font-weight: 800; }
.stop-no { width: 30px; height: 30px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.stop-row.is-unload .stop-no { background: var(--black); color: var(--lime); }
.stop-tools { margin-left: auto; display: flex; gap: 6px; }

/* ---------- KPI strip ---------- */
.kpis { background: var(--white); border-radius: var(--radius); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 28px; overflow: hidden; }
.kpi { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); border-left: 1px solid var(--line-2); }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: #fafcfc; color: var(--text); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-teal .kpi-value { color: var(--teal); }
.kpi-lime { background: var(--lime); }
a.kpi-lime:hover { background: var(--lime-2); }
.kpi-lime .kpi-label, .kpi-lime .kpi-sub { color: var(--black); }
.kpi-danger .kpi-sub { color: var(--danger); font-weight: 700; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(4) { border-left: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--line-2); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi { border-left: 0; border-top: 1px solid var(--line-2); } .kpi:nth-child(-n+2) { border-top: 0; } .kpi:nth-child(even) { border-left: 1px solid var(--line-2); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 11px 16px; background: #f8fafa; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table td { padding: 15px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.table.compact td, .table.compact th { padding: 10px 10px; }
.card .table th { background: transparent; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: #fafcfc; }
tr.inactive td { opacity: .45; }
.route { white-space: nowrap; }
.arrow { color: var(--teal); font-weight: 800; }
.empty { color: var(--muted); padding: 22px; background: var(--white); border-radius: var(--radius); text-align: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 10px; margin-bottom: 16px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .filters .searchbox { grid-column: 1 / -1; width: 100%; } }
.filters .searchbox { width: 100%; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; vertical-align: middle; letter-spacing: 0; }
h1 .badge { font-size: 13px; padding: 5px 12px; }
.st-prijata { background: var(--white); color: var(--black); box-shadow: inset 0 0 0 1.5px var(--black); }
.st-pridelena { background: var(--teal); color: var(--white); }
.st-nalozena { background: var(--lime); color: var(--black); }
.st-dorucena { background: var(--teal-soft); color: var(--teal-2); }
.st-vyfakturovana { background: var(--black); color: var(--white); }
.st-zaplatena { background: var(--soft); color: var(--muted); }
.st-zrusena { background: var(--danger-soft); color: var(--danger); }
.doc-dot { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--faint); margin-right: 3px; }
.doc-dot.on { background: var(--teal-soft); color: var(--teal); }
.doc-kind { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.k-cmr { background: var(--teal-soft); color: var(--teal); }
.k-tovar { background: #eef9c4; color: #3d4a00; }
.doc-group + .doc-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.doc-group .section-label .muted { font-weight: 600; }
.doc-group .docs { margin-bottom: 0; }
.doc-group .thumbs { margin-top: 8px; }
.doc-group > p { margin: 2px 0 0; }
.k-objednavka { background: var(--black); color: var(--white); }
.k-faktura { background: var(--lime); color: var(--black); }

/* ---------- Detail ---------- */
.nextstep { background: var(--white); border: 2px solid var(--lime); }
.stops { list-style: none; margin: 0; padding: 0; }
.stop { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.stop:first-child { padding-top: 4px; }
.stop:last-child { border-bottom: 0; padding-bottom: 4px; }
.stop-num { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.stop.is-unload .stop-num { background: var(--black); color: var(--lime); }
.stop.is-done .stop-num { background: var(--teal); color: var(--white); }
.stop-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stop-kindlabel { font-size: 12px; font-weight: 800; color: var(--teal); }
.stop.is-unload .stop-kindlabel { color: var(--black); }
.stop-title { font-size: 16px; font-weight: 800; }
.stop-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin-top: 4px; color: var(--muted); }
.stop-meta strong { color: var(--text); }
.stop-note { margin-top: 6px; font-size: 13px; background: #fbffe6; padding: 6px 10px; border-radius: 10px; }
.stop-note-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.stop-note-row .stop-note { margin-top: 0; flex: 1 1 220px; }
.stop-note-row.is-empty > :not(.stop-note-add):not([type=hidden]) { display: none; }
.stop-note-edit { width: auto; min-height: 0; resize: none; border: 1px solid transparent; font: inherit; font-size: 13px; line-height: 1.4; color: var(--text); overflow: hidden; }
.stop-note-edit:hover { border-color: var(--line); cursor: text; }
.stop-note-edit:focus { background: var(--white); border-color: var(--teal); }
.stop-note-edit.is-hidden { color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 700; cursor: pointer; }
.stop-note.is-hidden { background: var(--line-2); color: var(--muted); }
.stop-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stop-side { display: flex; flex-direction: column; gap: 8px; }
.round-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--teal); color: var(--white); display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; text-decoration: none; }
.round-btn:hover { background: var(--teal-2); color: var(--white); }
.round-btn.light { background: var(--soft); color: var(--text); }
.round-btn.light:hover { background: var(--line); color: var(--text); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; }
.docs { list-style: none; padding: 0; margin: 0 0 16px; }
.doc { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.doc-thumb { width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-ext { font-size: 11px; font-weight: 800; color: var(--muted); }
.doc-info { min-width: 0; flex: 1; }
.doc-name { word-break: break-all; font-weight: 600; }
.doc-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; font-size: 13px; }
.upload-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.upload-form select { width: auto; }
.upload-form .upload-progress { grid-column: 1 / -1; }
form.busy { opacity: .55; pointer-events: none; }
.feed { list-style: none; padding: 0; margin: 0 0 8px; }
.feed li { display: flex; gap: 12px; padding: 10px 0; }
.feed-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 18px; background: var(--soft); color: var(--text); display: flex; align-items: center; justify-content: center; }
.feed li.from-driver .feed-icon { background: var(--teal-soft); color: var(--teal); }
.feed li.is-new .feed-icon { background: var(--lime); color: var(--black); }
.feed-msg { font-size: 14px; font-weight: 600; }
.feed-lg li { padding: 12px 8px; border-bottom: 1px solid var(--line-2); }
.feed-lg li:last-child { border-bottom: 0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--teal); }
.login-card { background: var(--white); border-radius: 28px; padding: 36px 32px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-brand h1 { font-size: 24px; }

/* ---------- Driver (mobile first) ---------- */
body.driver { font-size: 16px; }
body.driver .container { padding: 20px 16px 48px; }
.driver-title { margin: 4px 0 16px; }
.jobcard { display: block; background: var(--white); border-radius: 22px; padding: 18px; margin-bottom: 12px; text-decoration: none; color: var(--text); }
.jobcard:hover { color: var(--text); }
.jobcard-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.jobcard-route { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jobcard-route .ic { color: var(--teal); }
.jobcard-meta { font-size: 14px; color: var(--muted); }
.jobcard-docs { margin-top: 10px; }
.job-hero { background: var(--teal); color: var(--white); padding: calc(18px + env(safe-area-inset-top)) 20px 26px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.job-hero a { color: var(--white); }
.job-hero-top { display: flex; justify-content: space-between; align-items: center; }
.job-back { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; text-decoration: none; }
.job-hero .badge { background: rgba(255,255,255,.18); color: var(--white); box-shadow: none; }
.job-hero .badge.st-nalozena { background: var(--lime); color: var(--black); }
.job-number { font-size: 13px; font-weight: 700; color: var(--teal-ink); }
.job-route { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-route .ic { color: var(--lime); }
.job-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.job-chip { background: rgba(0,0,0,.2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.job-chip small { font-size: 11px; color: var(--teal-ink); font-weight: 700; }
.job-chip span { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-body { max-width: 640px; margin: 0 auto; padding: 18px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.job-body .card { margin: 0; padding: 18px; }
.job-body .flash { margin: 0; }
.photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-actions .photo-form.wide { grid-column: 1 / -1; }
.btn-photo { height: 56px; border: 1.5px solid var(--black); border-radius: 18px; background: var(--white); color: var(--black); font-size: 15px; font-weight: 800; }
.btn-photo.secondary { height: 48px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.photo-form .upload-progress { text-align: center; padding-top: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.thumb a { width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-compact { padding: 4px 0; }
.list-row { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--text); }
.list-row:last-child { border: 0; }
.list-row:hover { color: var(--text); background: #fafcfc; }
.section-label { font-size: 12px; font-weight: 800; color: var(--teal); margin-bottom: 6px; display: block; }

/* ---------- Responsive: dispečer na mobile ---------- */
@media (max-width: 900px) {
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; inset: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; overflow: visible; }
  body.has-sidebar main { margin-left: 0; }
  .sb-brand-text { display: none; }
  .sb-new { order: 2; height: 40px; padding: 0 14px; margin-left: auto; }
  .sb-new span { display: none; }
  .sb-user { order: 3; }
  .sidebar .sb-user summary > span:last-child { display: none; }
  .sb-user-pop { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); }
  .sb-nav { order: 4; flex-basis: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .sb-nav a { height: 38px; padding: 0 12px; white-space: nowrap; gap: 8px; }
  .sb-month { display: none; }
  .container { padding: 20px 14px 56px; }
  h1 { font-size: 26px; }
  .stop-side { flex-direction: row; }
  .dl { grid-template-columns: 110px 1fr; }
  .upload-form { grid-template-columns: 1fr; }
  .searchbox { width: 100%; }
}

/* opravy */
label.btn { flex-direction: row; color: inherit; font-size: 14px; }
label.btn-photo { font-size: 15px; }
label.btn-photo.secondary { font-size: 14px; }
.linkbtn.small { font-size: 13px; }
.table td:first-child { white-space: nowrap; }
input, select, textarea { font-weight: 500; }

/* logo */
.sb-brand { padding: 4px 4px 0; }
.logo-full { width: 180px; height: auto; display: block; }
.logo-mark-img { display: none; height: 30px; width: auto; }
.logo-mark-img.show { display: block; }
.login-logo { width: 240px; height: auto; margin: 4px auto 6px; display: block; }
@media (max-width: 900px) { .logo-full { display: none; } .logo-mark-img { display: block; } }

/* ---------- Efektivita ---------- */
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .kpis-6 { grid-template-columns: repeat(3, 1fr); } .kpis-6 .kpi:nth-child(4) { border-left: 0; } .kpis-6 .kpi:nth-child(n+4) { border-top: 1px solid var(--line-2); } }
.kmbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--soft); min-width: 160px; }
.kmbar span { display: block; height: 100%; }
.kb-loaded { background: var(--teal); }
.kb-approach { background: #7fbfc1; }
.kb-empty { background: #000; }
.kb-private { background: #c9d3d3; }
.kmlegend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-weight: 600; }
.kmlegend span { display: inline-flex; align-items: center; gap: 6px; }
.kmlegend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.insights li { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--soft); }
.ins-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--white); }
.ins-danger { background: var(--danger-soft) !important; }
.ins-danger .ins-icon { color: var(--danger); }
.ins-warn { background: #fbffe6 !important; }
.ins-warn .ins-icon { color: #6b7d00; }
.ins-ok, .ins-info { background: var(--teal-soft) !important; }
.ins-ok .ins-icon, .ins-info .ins-icon { color: var(--teal); }
.howto { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.howto strong { color: var(--text); }
.head-actions select { width: auto; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--faint); margin-right: 6px; vertical-align: middle; }
.status-dot.on { background: var(--teal); }

/* ---------- Upozornenia ---------- */
.push-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--black); color: var(--white); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.push-card .small { color: #c9d3d3; margin-top: 2px; }
.push-card .btn { flex-shrink: 0; }
@media (max-width: 640px) { .push-card { flex-direction: column; align-items: stretch; } }
.sb-push { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px dashed rgba(255,255,255,.4); background: transparent; color: var(--white); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sb-push:hover { background: rgba(255,255,255,.08); }
@media (max-width: 900px) { .sb-push { display: none !important; } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; flex-direction: column; gap: 2px; background: var(--black); color: var(--white); border-left: 4px solid var(--lime); padding: 14px 16px; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.25); text-decoration: none; animation: toast-in .25s ease-out; transition: opacity .5s, transform .5s; font-size: 14px; }
.toast:hover { color: var(--white); }
.toast span { color: #c9d3d3; font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: auto; } }
[data-push-status].on { color: var(--teal); }
.chat { list-style: none; padding: 0; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.chat li { display: flex; flex-direction: column; gap: 3px; max-width: 85%; }
.chat li.mine { align-self: flex-end; align-items: flex-end; }
.chat .bubble { padding: 10px 14px; border-radius: 16px; background: var(--soft); font-size: 15px; }
.chat li.theirs .bubble { background: var(--teal); color: var(--white); border-bottom-left-radius: 4px; }
.chat li.mine .bubble { border-bottom-right-radius: 4px; }
.news-card { border: 2px solid var(--lime); }
.news-card .feed li { padding: 8px 0; }
.news-link { text-decoration: none; color: var(--text); }
label.searchbox { flex-direction: row; align-items: center; font-size: 14px; font-weight: 500; }

/* ---------- Chat ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-col { width: 56px; text-align: right; }
.chat-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); color: var(--teal); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.chat-btn:hover { background: var(--teal-soft); border-color: var(--teal-soft); }
.chat-btn.on-dark { background: rgba(255,255,255,.16); border-color: transparent; color: var(--white); }
.chat-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--lime); color: var(--black); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--white); }
.chat-badge.inline { position: static; box-shadow: none; margin-left: 4px; }
.chat-btn.on-dark .chat-badge { box-shadow: 0 0 0 2px var(--teal); }
.job-hero-actions { display: flex; align-items: center; gap: 10px; }
.chat-cta { position: relative; }
.jobcard { position: relative; }
.jobcard-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.jobcard-actions { display: inline-flex; align-items: center; gap: 10px; position: relative; z-index: 2; }

.chat-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
body.chat-open .chat-backdrop { opacity: 1; pointer-events: auto; }
.chat-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--white); z-index: 70; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease-out; box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.chat-drawer.open { transform: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: var(--teal); color: var(--white); }
.chat-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-title { font-size: 17px; }
.chat-sub { font-size: 13px; color: var(--teal-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-link { color: var(--white); font-weight: 700; }
.chat-link:hover { color: var(--lime); }
.chat-head .iconbtn { background: rgba(255,255,255,.14); border-color: transparent; color: var(--white); width: 38px; height: 38px; }
.chat-list { list-style: none; margin: 0; padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-list li { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.chat-list li.mine { align-self: flex-end; align-items: flex-end; }
.chat-list .bubble { padding: 10px 14px; border-radius: 18px; background: var(--white); font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-list li.mine .bubble { background: var(--black); color: var(--white); border-bottom-right-radius: 6px; }
.chat-list li.theirs .bubble { background: var(--teal); color: var(--white); border-bottom-left-radius: 6px; }
.chat-list .meta { font-size: 11px; color: var(--muted); padding: 0 4px; }
.chat-list .chat-day { align-self: center; max-width: none; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--white); padding: 3px 12px; border-radius: 999px; margin: 6px 0; }
.chat-empty { position: absolute; top: 50%; left: 0; right: 0; text-align: center; }
.chat-note { margin: 0; padding: 10px 16px; background: #fbffe6; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--white); }
.chat-form textarea { resize: none; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; }
.chat-form .btn { width: 44px; height: 44px; padding: 0; border-radius: 22px; flex-shrink: 0; }
@media (max-width: 700px) { .chat-drawer { width: 100vw; } }

.inbox { padding: 6px 0; }
.inbox-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 24px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: #fafcfc; }
.inbox-icon { width: 40px; height: 40px; border-radius: 20px; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inbox-row.unread .inbox-icon { background: var(--lime); color: var(--black); }
.inbox-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-top { font-size: 14px; }
.inbox-last { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row.unread .inbox-last { color: var(--text); font-weight: 600; }
.inbox-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.sb-sound { border-style: solid; border-color: var(--lime); color: var(--lime); }
.card > .upload-form { margin-top: 16px; }

/* ---------- Potiahnutie pre obnovenie (vodič) ---------- */
body[data-role="driver"] { overscroll-behavior-y: contain; }
body[data-role="driver"] main { transition: transform .25s ease; }
body.ptr-pulling main { transform: translateY(var(--ptr-shift, 0)); transition: none; }
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transform: translate(-50%, -70px); opacity: 0; pointer-events: none; }
.ptr.back { transition: transform .25s ease, opacity .25s ease; }
.ptr-bubble { width: 44px; height: 44px; border-radius: 22px; background: var(--white); color: var(--teal); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: background .15s, color .15s; }
.ptr.ready .ptr-bubble, .ptr.loading .ptr-bubble { background: var(--lime); color: var(--black); }
.ptr-text { font-size: 12px; font-weight: 800; color: var(--black); background: var(--white); padding: 4px 10px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); white-space: nowrap; }
.ptr.loading .ptr-icon { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- Kroky jazdy vodiča: naložené / doručené ---------- */
.steps { display: grid; gap: 10px; }
.steps form { margin: 0; }
.step { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 18px; border-radius: 20px; border: 2px solid transparent; text-align: left; font: inherit; }
.step div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step strong { font-size: 19px; font-weight: 800; }
.step span { font-size: 13px; font-weight: 600; opacity: .85; }
.step svg { flex: none; }
.step.done { background: var(--lime); color: var(--black); }
.step.todo { background: #ff6a13; color: var(--white); cursor: pointer; box-shadow: 0 6px 18px rgba(255,106,19,.35); animation: step-pulse 1.8s ease-in-out infinite; }
.step.todo:active { transform: scale(.98); }
.step.wait { background: var(--white); color: var(--faint); border-color: var(--line); }
@keyframes step-pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(255,106,19,.30); } 50% { box-shadow: 0 6px 26px rgba(255,106,19,.65), 0 0 0 4px rgba(255,106,19,.18); } }
@media (prefers-reduced-motion: reduce) { .step.todo { animation: none; } }
.steps-row { grid-template-columns: 1fr 1fr 2.4fr; margin-bottom: 16px; align-items: stretch; }
.steps-row .step strong { font-size: 17px; }
.steps-row .step { padding: 10px 14px; gap: 10px; }
.steps-row .step { cursor: default; }
@media (max-width: 1100px) { .steps-row { grid-template-columns: 1fr 1fr; } .steps-row .lights { grid-column: 1 / -1; } }
@media (max-width: 700px) { .steps-row { grid-template-columns: 1fr; } }
.jobcard-warn { margin-top: 10px; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #ff6a13; color: var(--white); font-size: 13px; font-weight: 800; position: relative; z-index: 1; pointer-events: none; }

/* ---------- Fázy prepravy u vodiča: nakládka / vykládka ---------- */
.phase { display: grid; gap: 12px; }
.phase-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.slots { display: grid; gap: 8px; }
.slot { border-radius: 16px; background: var(--soft); }
.slot-form { margin: 0; }
.slot-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; min-height: 60px; }
.slot-mark { width: 32px; height: 32px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--white); color: var(--faint); border: 1.5px solid var(--line); }
.slot.ok .slot-mark { background: var(--lime); color: var(--black); border-color: var(--lime); }
.slot.need .slot-mark { background: #ff6a13; color: var(--white); border-color: #ff6a13; }
.slot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slot-text strong { font-size: 16px; font-weight: 800; }
.slot-text small { font-size: 12px; font-weight: 700; color: var(--muted); }
.slot.need .slot-text small { color: #d45200; }
.slot-add { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--black); color: var(--white); font-size: 14px; font-weight: 800; }
.slot.ok .slot-add { background: var(--white); color: var(--black); border: 1px solid var(--line); }
.slot-form .upload-progress { padding: 0 14px 10px; }
.slot-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 12px; }
.slot-thumbs .thumb { width: 76px; flex: none; }
.finish-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 16px; background: #ff6a13; color: var(--white); }
.finish-warn div { display: flex; flex-direction: column; }
.finish-warn span { font-size: 14px; font-weight: 600; }
.req-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.req-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.12); }
.step.done .req-chip.miss { background: #ff6a13; color: var(--white); }
.doc-missing { color: #d45200; font-weight: 700; }
label.slot-row { flex-direction: row; align-items: center; text-align: left; margin: 0; font-size: inherit; color: inherit; }
.step .req-chips { flex-direction: row; }
.req-chip { width: auto; }
.step.todo .req-chip.miss, .step.todo .req-chip { background: rgba(255,255,255,.22); color: var(--white); }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-form select { flex: 1 1 140px; width: auto; }
.upload-form input[type=file] { flex: 1 1 100%; }
.upload-form .upload-progress { flex-basis: 100%; }

/* ---------- Vodič: Detail trasy / Nakládka / Vykládka ako rozbaľovacie tlačidlá ---------- */
.route-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 14px; border: 0;
  background: rgba(255,255,255,.16); color: var(--white); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.route-toggle.open { background: var(--white); color: var(--teal); }
.chev { display: inline-block; transition: transform .2s ease; font-size: 13px; }
[aria-expanded="true"] .chev { transform: rotate(180deg); }
.route-panel { display: grid; gap: 8px; }
.route-panel[hidden], .phase[hidden] { display: none; }
.phase-btn { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 18px; border-radius: 20px; border: 0; font: inherit; text-align: left; cursor: pointer; }
.phase-btn.todo { background: #ff6a13; color: var(--white); box-shadow: 0 6px 18px rgba(255,106,19,.30); }
.phase-btn.done { background: var(--lime); color: var(--black); }
.phase-btn.open { border-radius: 20px 20px 8px 8px; }
.phase-btn-mark { width: 40px; height: 40px; flex: none; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.22); }
.phase-btn.done .phase-btn-mark { background: rgba(0,0,0,.08); }
.phase-btn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.phase-btn-text strong { font-size: 21px; font-weight: 800; }
.phase-btn-text small { font-size: 13px; font-weight: 700; opacity: .9; }
.phase-btn .chev { font-size: 16px; }
.phase-btn + .phase { margin-top: -8px; border-radius: 8px 8px 20px 20px; }
.phase-locked { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 14px; font-weight: 700; }

/* ---------- Pokyny pre vodiča: zobraziť / skryť ---------- */
.instr-block { display: grid; gap: 6px; }
.instr-block label.check { align-self: start; padding-bottom: 0; }
.instr-form { display: grid; gap: 16px; }
.instr-item { display: grid; gap: 8px; }
.instr-item + .instr-item { padding-top: 14px; border-top: 1px solid var(--line-2); }
.instr-item p { margin: 0; }
.instr-item .btn { justify-self: start; }
.instr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.instr-head .section-label { margin: 0; }
label.switch { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--text); cursor: pointer; }
label.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.switch span { width: 40px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .15s; flex: none; }
label.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9px; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
label.switch input:checked + span { background: var(--teal); }
label.switch input:checked + span::after { left: 19px; }
label.switch input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.instr-driver p { margin: 0 0 14px; }
.instr-driver p:last-child { margin-bottom: 0; }

/* ---------- Záloha ---------- */
.backup-alert { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; border-radius: 16px; background: var(--danger-soft); color: #8a1f17; text-decoration: none; }
.backup-alert div { display: flex; flex-direction: column; }
.backup-alert span { font-size: 13px; }
.backup-dl { grid-template-columns: 140px 1fr; margin-bottom: 12px; }
.backup-dl dd { font-weight: 600; }

/* ---------- Štítky a skenovanie ---------- */
.label-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.label-opts { display: grid; gap: 12px; }
.label-opts code { word-break: break-all; font-size: 11px; }
.label-zoom { display: flex; justify-content: center; padding: 28px; margin: 10px 0 16px; background: var(--soft); border-radius: 16px; }
.label-zoom svg { width: 100%; max-width: 440px; height: auto; box-shadow: 0 4px 18px rgba(0,0,0,.15); border-radius: 3px; }
.label-tips ul { margin: 6px 0 0; padding-left: 18px; }
.print-only { display: none; }
@media print {
  body.label-page { background: #fff; }
  body.label-page .sidebar, body.label-page .no-print, body.label-page .flash, body.label-page .chat-backdrop, body.label-page #chat, body.label-page .toasts { display: none !important; }
  body.label-page main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  body.label-page.has-sidebar { padding-left: 0 !important; }
  .print-only { display: block; }
  .print-label { page-break-after: always; break-after: page; }
  .print-label:last-child { page-break-after: auto; break-after: auto; }
  .print-label svg { display: block; box-shadow: none; }
}
@media (max-width: 800px) { .label-layout { grid-template-columns: 1fr; } }
.scan-card { max-width: 640px; display: grid; gap: 16px; }
.scan-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.scan-form label { flex: 1 1 260px; }
.scan-form input { font-size: 18px; height: 52px; }
.scan-help { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.cam-box { position: relative; margin-top: 12px; display: grid; gap: 10px; }
.cam-box video { width: 100%; border-radius: 16px; background: #000; }
.cam-frame { position: absolute; inset: 18% 15% auto; height: 40%; border: 3px solid var(--lime); border-radius: 16px; pointer-events: none; }
.scan-btn { margin-left: auto; margin-right: 10px; width: 42px; height: 42px; border-radius: 21px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); color: var(--white); }
.code-card { display: grid; gap: 10px; }
.code-card-bar { background: #fff; padding: 6px 4px 0; }
.code-card-bar svg { display: block; width: 100%; height: 64px; }
.code-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-card-foot strong { font-size: 17px; letter-spacing: .04em; }

/* ---------- KROS ---------- */
.kros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kros-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 1000px) { .kros-grid { grid-template-columns: 1fr; } }
.kros-sum { grid-column: span 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; font-size: 13px; color: var(--muted); }
.kros-sum strong { color: var(--text); }
.kros-sum .tot { font-size: 15px; color: var(--text); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.kros-next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nextstep .kros-next + .manual-invoice, .nextstep form + .kros-next { margin-top: 12px; }
.nextstep .kros-early { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.manual-invoice summary { cursor: pointer; color: var(--muted); margin-top: 10px; }
.manual-invoice[open] summary { margin-bottom: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row form { margin: 0; }
.kros-spin { display: inline-block; width: 16px; height: 16px; border: 2.5px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: ptr-spin .8s linear infinite; vertical-align: -3px; }

/* Faktúra do KROS – náhľad objednávky zákazníka vedľa formulára */
.kros-layout.with-doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 20px; align-items: start; }
.kros-layout.with-doc .kros-grid { grid-template-columns: 1fr; }
.kros-doc { position: sticky; top: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 32px); }
.kros-doc-head { display: flex; align-items: center; gap: 8px; }
.kros-doc-head select, .kros-doc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.kros-doc-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-tab { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text); }
.doc-tab:hover { border-color: var(--teal); }
.doc-tab.active { background: var(--teal); border-color: var(--teal); color: var(--white); }
.kros-doc-view { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #f4f6f6; display: flex; }
.kros-doc-view iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.kros-doc-view img { max-width: 100%; height: auto; margin: auto; display: block; cursor: zoom-in; }
.kros-doc-view img.zoom { max-width: none; cursor: zoom-out; margin: 0; }
.kros-doc-view p { margin: auto; padding: 20px; }
@media (max-width: 1100px) { .kros-layout.with-doc { grid-template-columns: 1fr; } .kros-doc { position: static; height: 80vh; } }

/* Detail objednávky – naše číslo prepravy a číslo objednávky klienta vedľa seba */
.order-ids { display: flex; align-items: flex-end; gap: 12px 36px; flex-wrap: wrap; margin-bottom: 4px; }
.order-id { display: flex; flex-direction: column; gap: 2px; }
.order-id h1 { margin: 0; }
.order-id-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.order-id.client { padding-left: 24px; border-left: 2px solid var(--line); }
.order-id-num { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; color: var(--text); }
.copy-num { cursor: copy; border-radius: 6px; transition: background .15s; }
.copy-num:hover { background: var(--line-2); }
.copy-num.copied { background: #e9fcb0; }
@media (max-width: 900px) { .order-id-num { font-size: 26px; } }
@media (max-width: 760px) { .order-id.client { padding-left: 0; border-left: 0; } }
.scan-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.kros-import { display: inline-flex; gap: 6px; align-items: center; }
.kros-import .input-sm { width: 150px; padding: 6px 10px; font-size: 13px; }
.kros-existing { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 2px solid var(--lime, #d4ff1e); margin-bottom: 16px; }
.sig-preview { margin-top: 14px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; }
.sig-preview .section-label { display: block; margin-bottom: 10px; }
.sig-preview p { margin-top: 0; }
.sender-card { margin-bottom: 16px; }
.sender-opts { display: flex; gap: 12px; flex-wrap: wrap; }
.sender-opt { flex-direction: row; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px; cursor: pointer; min-width: 260px; }
.sender-opt > span { display: flex; flex-direction: column; gap: 2px; }
.sender-opt:has(input:checked) { border-color: var(--teal); background: #f0fbfb; }
.sender-opt.off { opacity: .55; cursor: not-allowed; }
.mail-acc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.mail-status { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.mail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mail-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 10px 6px 0; }
.mail-table td { padding: 6px 10px 6px 0; border-top: 1px solid var(--line-2); vertical-align: top; }
.mail-table .ok { color: var(--teal); font-weight: 700; }
.mail-st { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.mail-st.dlv { color: var(--teal); }
.mail-st.read { color: var(--teal); }
.mail-st.read::after { content: "✓✓"; font-size: 11px; }
.mail-st.dlv::after { content: "✓"; font-size: 11px; }
.mail-st.fail { color: var(--danger); }

.mail-st.big { display: inline-flex; vertical-align: middle; font-size: 13px; font-weight: 700; margin-left: 8px; padding: 4px 10px; border-radius: 999px; background: #eef4f4; text-decoration: none; letter-spacing: 0; }
.mail-st.big.dlv, .mail-st.big.read { background: #e3f4ea; }
.mail-st.big.fail { background: #fdecec; }

/* tlačidlá-kontrolky stavu prepravy (Faktúra · Mail · Originál doklady · Pošta · Zaplatené) */
.lights { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.steps-row .lights { min-width: 0; }
.page-head + .lights { margin-bottom: 18px; }
.light { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 6px; min-width: 0;
  border-radius: 16px; border: 2px solid #ff6a13; background: #ff6a13; color: var(--white); font: inherit; text-align: center; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.light strong { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: inherit; line-height: 1.15; }
.light span { font-size: 11.5px; font-weight: 600; overflow-wrap: anywhere; }
.light:hover { background: #f25c05; border-color: #f25c05; }
.light:active { transform: scale(.98); }
.light.next { box-shadow: 0 6px 18px rgba(255,106,19,.45); }
.light.on { border-color: var(--lime); background: var(--lime); color: var(--black); box-shadow: none; }
.light.on:hover { background: #c4f000; border-color: #c4f000; }
.light.wait { border-color: var(--teal); background: var(--white); color: var(--teal); box-shadow: none; }
.light.wait:hover { background: #eef6f6; }
.light.bad { border-color: var(--danger); background: var(--danger); color: var(--white); box-shadow: none; }
.light.active { outline: 3px solid var(--black); outline-offset: 2px; }
@media (max-width: 520px) { .lights { grid-template-columns: repeat(3, 1fr); } }

/* podstránky objednávky */
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
@media (max-width: 900px) { .sub-grid { grid-template-columns: 1fr; } }
.sub-grid .card h2, .mail-status h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.paid-ok { display: flex; align-items: center; gap: 8px; color: var(--teal); margin: 0 0 12px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.warn-text { color: #c24e0a; font-weight: 600; }
.section-title { font-size: 18px; margin: 22px 0 10px; }
label.grow { flex: 1; min-width: 220px; }
.mail-status.card { margin-bottom: 16px; }

.big-ok { font-size: 16px; margin-bottom: 14px; }
.track-list { list-style: none; padding: 0 0 0 14px; margin: 10px 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.track-list li.delivered { color: var(--teal); font-weight: 700; }
.track-list li.returning, .track-list li.returned { color: var(--danger); font-weight: 700; }
.manual-post { margin-top: 14px; }
.manual-post summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.post-form .section-label { display: block; margin: 4px 0 8px; }
