:root {
  --bg: #f4f5f2; --panel: #ffffff; --ink: #1d2320; --muted: #6a726d; --line: #dfe2dc;
  --accent: #1f5f4a; --accent-2: #e9f1ed; --red: #b42318; --red-bg: #fdecea; --orange: #b25e09; --orange-bg: #fdf3e3;
  --green: #2f7d4f; --green-bg: #e8f4ec; --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ---- boční panel ---- */
:root { --side-w: 168px; --top-h: 48px; }
.brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .drop { width: 14px; height: 18px; background: #e0b23a; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; display: inline-block; flex: none; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: #17231e; color: #fff; display: flex; flex-direction: column; font-size: 13.5px;
        padding: 14px 8px; z-index: 30; overflow-y: auto; }
.side .brand { padding: 4px 8px 16px; font-size: 15px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav .grp { color: #6f847b; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; padding: 14px 10px 4px; }
.side nav .grp:first-child { padding-top: 0; }
.side nav a { color: #c9d4cf; padding: 6px 10px; border-radius: 6px; }
.side nav a:hover { background: #22312b; color: #fff; text-decoration: none; }
.side nav a.on { background: #2a3a33; color: #fff; box-shadow: inset 3px 0 0 #e0b23a; }
.side nav .soon { font-size: 10px; color: #8ea197; border: 1px solid #3a4b43; border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.modgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.modcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.modcard:hover { border-color: #9cb5aa; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.modcard h3 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modcard p { margin: 0; color: var(--muted); font-size: 13px; }
.modcard.locked { opacity: .55; }
.side .who { border-top: 1px solid #2a3a33; padding: 12px 10px 0; margin-top: 12px; font-size: 12px; color: #9fb0a8; }
.side .who .name { color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.side .who a { color: #c9d4cf; }
body.with-side main { margin-left: var(--side-w); }
.topbar { display: none; }
.scrim { display: none; }
/* úzká obrazovka: panel se schová a otevírá tlačítkem */
@media (max-width: 1100px) {
  body.with-side main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; height: var(--top-h); background: #17231e; padding: 0 12px; z-index: 20; }
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .navtoggle { background: none; border: 0; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
  .navtoggle span { width: 20px; height: 2px; background: #fff; border-radius: 2px; display: block; }
  th { top: var(--top-h); }
}
main { max-width: none; margin: 0; padding: 20px 24px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
button.tile { font: inherit; text-align: left; color: inherit; cursor: pointer; transition: box-shadow .12s, border-color .12s; }
button.tile:hover { border-color: #9cb5aa; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
button.tile.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.tile .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile.red { border-color: #f1b8b2; background: var(--red-bg); } .tile.red .v { color: var(--red); }
.tile.orange { border-color: #f0d2a4; background: var(--orange-bg); } .tile.orange .v { color: var(--orange); }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; background: #fafbf9; position: sticky; top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:hover td { background: #fafcfb; }
tr.sev2 td { background: var(--red-bg); } tr.sev1 td { background: var(--orange-bg); }
tr.muted td { color: var(--muted); }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); }
.tablewrap table { border: 0; }
.tablewrap th { top: 0; }
.tablewrap { max-height: 78vh; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b0 { background: var(--green-bg); color: var(--green); } .b1 { background: var(--orange-bg); color: var(--orange); } .b2 { background: var(--red-bg); color: var(--red); }
.bgray { background: #eceeea; color: var(--muted); }
.flags { margin: 0; padding-left: 16px; font-size: 13px; }
.pos { color: var(--red); } .neg { color: var(--green); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  font: inherit; padding: 6px 8px; border: 1px solid #c9cec7; border-radius: 6px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc7b6; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
button, .btn { font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.sec, button.sec { background: #fff; color: var(--accent); }
.btn.danger, button.danger { background: #fff; color: var(--red); border-color: #e3a29b; }
.btn.small, button.small { padding: 3px 9px; font-size: 12px; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--green-bg); border-color: #b9dcc6; color: #1e5a37; }
.flash.err { background: var(--red-bg); border-color: #f1b8b2; color: var(--red); }
.flash.warn { background: var(--orange-bg); border-color: #f0d2a4; color: #7d4206; }
.alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.alerts a { background: var(--orange-bg); border: 1px solid #f0d2a4; color: #7d4206; padding: 6px 12px; border-radius: 6px; }
.login { max-width: 360px; margin: 80px auto; }
.login input { width: 100%; margin-bottom: 12px; }
.chart-box { position: relative; height: 320px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; }
.tx-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx-edit input[type=text] { width: 160px; }
.small { font-size: 12px; }
.coverage summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 400; margin: 0; }
.coverage summary .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.coverage .allData { background: var(--accent-2); border: 1px solid #c6dccf; border-radius: 6px; padding: 3px 10px; }
.coverage .allData.muted { background: #f3f4f1; border-color: var(--line); color: var(--muted); }
.coverage summary a { font-size: 12px; margin-left: 4px; }
.coverage[open] summary { margin-bottom: 4px; }
table.vk th.dayh { text-align: center; border-left: 1px solid var(--line); }
table.vk th.sub2 { font-size: 10px; top: 30px; }
table.vk td.gpsc { color: var(--accent); border-right: 1px solid var(--line); }
table.vk td.warnc { background: var(--orange-bg); }
table.vk tr.tot td { background: #fafbf9; border-top: 2px solid var(--line); }
.levelnow { display: flex; gap: 24px; align-items: center; }
.levelnow .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.levelnow .v { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.levelnow .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.gauge { height: 14px; background: #e6e9e4; border-radius: 7px; overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--accent); border-radius: 7px; }
.gauge i.low { background: var(--orange); }
.gauge.sm { display: inline-block; width: 44px; height: 8px; vertical-align: middle; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #17231e; color: #fff;
         padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50;
         box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media print { .side, .topbar, .scrim, .noprint { display: none !important; } body.with-side main { margin-left: 0; } main { max-width: none; padding: 0; } th { position: static; } }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tabs a { padding: 8px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--panel, #fff); border-color: var(--line); font-weight: 600; margin-bottom: -1px; }
.tabs a:hover:not(.on) { background: rgba(0,0,0,.04); }

.vk .rname { font-size: 10px; line-height: 1.15; color: var(--muted); text-align: left; white-space: normal; max-width: 110px; margin-top: 2px; }

.ac { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; max-height: 320px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ac-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f0f2ee; }
.ac-item:hover, .ac-item.on { background: #eef5f1; }

/* plán přeprav */
.plan-wrap { display: flex; gap: 12px; align-items: flex-start; }
.plan-left { width: 230px; flex: 0 0 230px; position: sticky; top: 8px; max-height: calc(100vh - 30px); overflow: auto; }
.plan-grid-wrap { flex: 1; overflow-x: auto; }
.plan-grid { border-collapse: collapse; width: 100%; background: #fff; }
.plan-grid th, .plan-grid td { border: 1px solid var(--line); padding: 4px; vertical-align: top; font-size: 12px; }
.plan-grid th.today { background: #eef5f1; }
.plan-cell { min-width: 140px; }
.plan-cell.past { background: #fafaf8; }
.plan-cell .drv.drv-home { color: var(--muted); font-style: italic; }
.plan-cell .drv.drv-none { color: #b42318; }
.home-lbl { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
select.drv.home { width: 100%; max-width: 150px; font-size: 11px; padding: 2px; }
.plan-cell .drv { width: 100%; font-size: 11px; padding: 2px; margin-bottom: 3px; }
.plan-list { min-height: 34px; border-radius: 6px; }
#pool.plan-list { min-height: 120px; }
.pcard { background: #fff; border: 1px solid #cfd8d2; border-left: 4px solid #1f5f4a; border-radius: 6px; padding: 4px 6px; margin-bottom: 4px;
  cursor: grab; font-size: 12px; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.pcard-day { border-left-color: #2b4c7e; }
.pcard .pleft { display: inline-block; background: #1f5f4a; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-right: 2px; }
.pcard-day .pleft { background: #2b4c7e; }
.pcard .pr { font-weight: 600; }
.pcard .pm { color: var(--muted); font-size: 11px; }
.pcard .pwarn { color: #b42318; font-size: 10px; }
.pcard-ghost { opacity: .4; background: #eef5f1; }
.pcard { user-select: none; -moz-user-select: none; -webkit-user-select: none; cursor: grab; }
.pcard-saving { opacity: .6; cursor: progress; }
.sortable-fallback { opacity: .9 !important; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.cell-sum { color: var(--muted); }
.cell-warn { color: #b42318; }

.plan-locked .pcard { cursor: default; }
.plan-locked .plan-left .hint { display: none; }
.plan-grid tr.ext-sep td { background: #fff4e5; color: #8a4b00; font-weight: 600; font-size: 12px; padding: 4px 8px; }
.plan-grid tr.ext-row td { background: #fffaf2; }
select.catsel { font-size: 12px; padding: 2px 4px; min-width: 110px; }
.couple-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.couple-row { display: flex; gap: 8px; align-items: stretch; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.couple-veh { width: 110px; flex: none; }
.couple-slot { flex: 1; min-height: 44px; border: 1px dashed var(--line); border-radius: 6px; padding: 3px; }
.tcard { border-left-color: #8a4b00; }
.trl { font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.2; }
.plan-all tr.grp-row td { background: #e3efe9; padding: 6px 8px; border-top: 2px solid #1f5f4a; }
.plan-all .drvname { font-size: 11px; font-weight: 600; color: #2b4c7e; margin-bottom: 3px; }
.plan-all .drvname.drv-home { color: #2b4c7e; font-style: normal; }
.plan-all .drvname.drv-none { color: #b42318; }
.plan-all .rcard { border: 1px solid var(--line); border-left: 3px solid #1f5f4a; border-radius: 5px; padding: 3px 5px; margin-bottom: 3px; background: #fff; font-size: 12px; }
.plan-all .rcard.pcard-day { border-left-color: #2b4c7e; }
.er-check { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.er-check input { width: auto; margin: 0; }
.plan-locked .pcard, .plan-all .rcard { cursor: pointer; }
.plan-locked .pcard:hover, .plan-all .rcard:hover { box-shadow: 0 0 0 2px #1f5f4a33; }
table.kv th { text-align: left; width: 110px; color: var(--muted); font-weight: 500; vertical-align: top; padding: 4px 8px 4px 0; text-transform: none; letter-spacing: 0; font-size: 13px; background: none; }
table.kv td { padding: 4px 0; border: none; }
table.kv tr { border: none; }
.times-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.times-box input.hm { width: 80px; }
.offsel { width: auto; font-size: 13px; }
.ret-modes { display: flex; flex-direction: column; gap: 2px; }
.ret-modes label { font-weight: 400; color: var(--ink); display: flex; gap: 6px; align-items: center; white-space: nowrap; margin: 0; }
.ret-modes input { width: auto; margin: 0; }
.pm .ptimes { color: #2b4c7e; }
.rep-box { margin-top: 6px; font-size: 13px; }
.rep-l { font-weight: 400 !important; color: var(--ink) !important; display: flex !important; gap: 6px; align-items: center; margin: 2px 0 !important; white-space: nowrap; }
.rep-l input[type=number] { width: 60px; padding: 2px 4px; }
.rep-l input[type=checkbox] { width: auto; margin: 0; }
.pm.pseries { color: #6b3fa0; }
input.hm { width: 80px; font-variant-numeric: tabular-nums; }
input.hm.hm-bad { border-color: #b42318; background: #fff1f0; }
.absent-note { font-size: 11px; color: #8a4b00; background: #fff4e5; border-radius: 4px; padding: 1px 5px; margin: 2px 0 3px; }
/* docházka */
table.att th.dcol { padding: 4px 2px; text-align: center; min-width: 22px; font-size: 11px; }
table.att th.dcol.hol { background: #b42318; color: #fff; }
table.att td.dc { padding: 2px; text-align: center; font-size: 11px; font-weight: 600; border-left: 1px solid #eef1ef; }
table.att td.dc.we { background: #f1f3f2; }
table.att td.dc.hol { background: #fce8e6; }
table.att td.dc.cJ { background: #dff1e7; color: #1f5f4a; }
table.att td.dc.cD { background: #dcebfb; color: #2b4c7e; }
table.att td.dc.cN { background: #fde7c8; color: #8a4b00; }
table.att td.dc.cL { background: #eadcf8; color: #6b3fa0; }
table.att td.dc.pl { color: #8a948f; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 6px; }
.cal-h.we { color: #8a948f; }
.cal-d { min-height: 96px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: #fff; font-size: 12px; }
.cal-d.empty { border: none; background: none; }
.cal-d.we { background: #f6f7f6; }
.cal-d.hol { background: #fdf0ee; border-color: #f2c6c0; }
.cal-d.today { box-shadow: inset 0 0 0 2px #1f5f4a; }
.cal-n { margin-bottom: 3px; }
.cal-hol { color: #b42318; font-size: 10.5px; }
.cal-ab { font-weight: 600; border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; }
.cal-d.ab-dovolena .cal-ab, .badge.ab-dovolena { background: #dcebfb; color: #2b4c7e; }
.cal-d.ab-nemoc .cal-ab, .badge.ab-nemoc { background: #fde7c8; color: #8a4b00; }
.cal-d.ab-lekar .cal-ab, .badge.ab-lekar { background: #eadcf8; color: #6b3fa0; }
.cal-act { background: #dff1e7; border-left: 3px solid #1f5f4a; border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; }
.cal-plan { background: #f1f3f2; color: #6b7570; border-left: 3px solid #b9c2be; border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; }
.plan-grid th.hol { background: #b42318; color: #fff; }
.plan-grid th.hol .holname { font-size: 10px; font-weight: 400; line-height: 1.2; text-transform: none; letter-spacing: 0; }
.plan-grid td.plan-cell.hol { background: #fdf0ee; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gallery .ph { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery .ph img { width: 100%; height: 160px; object-fit: cover; display: block; background: #f1f3f2; }
.gallery .ph-nothumb { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f1f3f2; font-size: 12px; text-align: center; padding: 8px; }
.gallery .ph-meta { padding: 6px 8px; font-size: 12px; }
.gallery .ph-act { margin-top: 4px; display: flex; gap: 10px; }
.badge.ph-nakladka { background: #dcebfb; color: #2b4c7e; }
.badge.ph-vykladka { background: #dff1e7; color: #1f5f4a; }
.linkbtn { background: none; border: none; color: #b42318; padding: 0; cursor: pointer; text-decoration: underline; }
.pphoto { font-size: 11px; }
.dpick { position: absolute; z-index: 1000; width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 6px; }
.dpick input { width: 100%; margin-bottom: 4px; }
.dpick-list { max-height: 300px; overflow-y: auto; }
.dpick-o { padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.dpick-o:hover, .dpick-o.act { background: #e3efe9; }
.dpick-o.cur { font-weight: 600; }
.dpick-o.fix { color: var(--muted); font-style: italic; }
.dpick-o.dis { color: #b0b7b3; cursor: not-allowed; background: none; }
.dpick-empty { padding: 6px 8px; color: var(--muted); font-size: 13px; }
.drv2-wrap { display: flex; align-items: center; gap: 4px; margin: 2px 0 3px; }
.drv2-l { font-size: 10px; color: #6b3fa0; font-weight: 600; white-space: nowrap; }
.plan-cell select.drv2 { font-size: 11px; padding: 1px 2px; flex: 1; min-width: 0; border-color: #c9b5e6; }

.stops-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }
.stops-t { margin-top: 6px; width: auto; }
.stops-t td, .stops-t th { padding: 3px 6px; }
.stops-t input.hm { width: 70px; }
.stops-t .sn { color: var(--muted); font-weight: 600; }
.stops-t .row { flex-wrap: nowrap; }
.stops-t .offsel { width: auto; }
.bulk-bar { align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 10px; background: #f6f7f5; border-radius: 8px; flex-wrap: wrap; }
.bulk-bar select { width: auto; }
.ofilt { align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.ofilt select { width: auto; }
/* plán přeprav: řádky aut střídavě podbarvené (sudé modrošedě), svátky a dnešek zůstávají zvýrazněné */
.plan-grid tbody tr.veh-alt > td { background: #eef3f8; }
.plan-grid tbody tr.veh-alt > td.plan-cell.past:not(.hol) { background: #e7edf3; }
.plan-grid tbody tr.veh-alt > td.plan-cell.hol { background: #f8e6e3; }
.plan-grid tbody tr:not(.ext-sep) > td:first-child { border-left: 3px solid transparent; }
.plan-grid tbody tr.veh-alt > td:first-child { border-left-color: #b9cbe0; }
.plan-grid tbody tr.ext-row.veh-alt > td { background: #fbf0de; }
/* archiv reportů rozvozu – přehled den × směna */
.rcal { width: auto; }
.rcal th, .rcal td { padding: 3px 2px; text-align: center; min-width: 26px; font-size: 12px; }
.rcal thead th a { color: var(--ink); text-decoration: none; font-weight: 600; }
.rcal thead th span { font-weight: 400; color: var(--muted); font-size: 10px; }
.rcal th.we, .rcal td.we { background: #f3f3ef; }
.rcal th.hol { background: #fdf0ee; }
.rcal td a { display: block; text-decoration: none; font-weight: 700; }
.rcal td.rc-ok { background: #e6f2ec; } .rcal td.rc-ok a { color: #1f5f4a; }
.rcal td.rc-ok sup { color: #8a4b00; font-weight: 600; font-size: 9px; }
.rcal td.rc-err { background: #fde4e1; } .rcal td.rc-err a { color: #b42318; }
.rcal td.rc-run { background: #fff4e5; } .rcal td.rc-run a { color: #8a4b00; }
.rcal td.rc-miss { background: #fbeaea; } .rcal td.rc-miss a { color: #b42318; }
/* poslat plán jízd */
.msg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.msg-card { margin: 0; }
.msg-text { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.35; margin-top: 6px; }
.wa-btn { background: #1f8f4e; border-color: #1f8f4e; }
/* zakázky: přepínač skupin aut */
.grp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.grp-chip { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  text-decoration: none; color: var(--ink); min-width: 120px; }
.grp-chip span { font-size: 12px; color: var(--muted); }
.grp-chip:hover { border-color: var(--accent, #1f5f4a); }
.grp-chip.on { background: #1f5f4a; border-color: #1f5f4a; color: #fff; }
.grp-chip.on span { color: #d6eadf; }
.grp-chip.empty:not(.on) { opacity: .6; }
td.plan-cell .plan-list { padding-bottom: 8px; }
/* poznámky k vozidlům a návěsům */
.note { margin-bottom: 10px; }
.note-text { white-space: pre-wrap; margin: 6px 0 0; }
.note-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: flex-end; }
.note-files img { height: 90px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.note-file { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
/* O programu – návody a změny (Markdown) */
.md h2 { margin-top: 22px; }
.md table { margin: 8px 0 12px; }
.md td, .md th { vertical-align: top; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 2px 0; }
.guide-list { margin: 0; padding-left: 20px; }
.guide-list li { margin: 6px 0; font-size: 15px; }
/* plán přeprav: časy nakládky/vykládky tučně, poznámka k autu v den */
.ptimes b { color: #12325e; font-weight: 700; }
.cell-note { width: 100%; box-sizing: border-box; margin-top: 4px; font-size: 11px; line-height: 1.3; padding: 2px 4px; min-height: 20px;
  border: 1px dashed transparent; background: transparent; resize: vertical; color: #6b4a00; font-family: inherit; }
.plan-cell:hover .cell-note, .cell-note:focus { border-color: var(--line); background: #fff; }
.cell-note.has { background: #fff6dc; border: 1px solid #f0d9a0; }
.cell-note.ro { white-space: pre-wrap; }
.cell-note.saving { opacity: .5; }
.cell-note::placeholder { color: transparent; }
.plan-cell:hover .cell-note::placeholder, .cell-note:focus::placeholder { color: #aaa; }

/* posila – přeprava navíc */
.badge.bposila { background:#7c2d12; color:#fff; letter-spacing:.03em; }
.pposila { display:inline-block; background:#7c2d12; color:#fff; border-radius:3px; font-size:10px; font-weight:700; padding:0 4px; line-height:14px; vertical-align:1px; }
.posila-chk { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--line, #ddd); border-radius:6px; cursor:pointer; }

/* průběh dne podle tachografu */
.tline { position:relative; height:26px; background:#f1f1ef; border:1px solid var(--line, #ddd); border-radius:4px; overflow:hidden; margin-top:10px; }
.tseg { position:absolute; top:0; bottom:0; }
.tmark { position:absolute; top:-2px; bottom:-2px; width:2px; background:#111; }
.tticks { position:relative; height:16px; font-size:11px; color:var(--muted); }
.tticks span { position:absolute; transform:translateX(-50%); }
.tticks span:first-child { transform:none; } .tticks span:last-child { transform:translateX(-100%); }
.k-drive { background:#2563eb; } .k-work { background:#ea8a0c; } .k-standby { background:#facc15; }
.k-pause { background:#86c99a; } .k-free { background:#c7e6d0; } .k-unknown { background:#d6d3d1; }
.tlegend span { display:inline-block; width:12px; height:10px; border-radius:2px; margin:0 3px 0 10px; vertical-align:-1px; }
.tlegend span:first-child { margin-left:0; }
.tdot { display:inline-block; width:10px; height:10px; border-radius:2px; vertical-align:-1px; }
.tile.t-drive { border-left:4px solid #2563eb; } .tile.t-work { border-left:4px solid #ea8a0c; }
.tile.t-standby { border-left:4px solid #facc15; } .tile.t-pause { border-left:4px solid #86c99a; }

/* ekonomika */
table.ek th.c { text-align:center; }
table.ek td.muted { color:var(--muted); }
table.ek-costs input.ekin { width:72px; text-align:right; padding:3px 5px; }
table.ek-costs input.ekin.own { background:#fff7d6; font-weight:600; }
table.ek-costs input.ekin::placeholder { color:#9ca3af; }
table.ek-costs tr.defrow td { background:#f3f4f6; }

/* auto je v daný den (část dne) v jiné skupině */
td.plan-cell.grp-off { background:repeating-linear-gradient(135deg, #f3f4f6 0 8px, #e9eaec 8px 16px); vertical-align:middle; }
.grp-note { font-size:11px; color:#6b7280; font-style:italic; margin:2px 0 4px; }
td.plan-cell.grp-part .grp-note { color:#92400e; font-style:normal; }

/* ruční pořadí aut v plánu */
.vgrip { cursor:grab; color:#9ca3af; margin-right:4px; font-size:14px; user-select:none; }
.vgrip:active { cursor:grabbing; }

.seg { display:inline-flex; border:1px solid var(--line, #d1d5db); border-radius:8px; overflow:hidden; height:36px; }
.seg a { padding:7px 14px; text-decoration:none; color:inherit; font-weight:600; }
.seg a.on { background:#1f4d3a; color:#fff; }

.couple-row.couple-hit { outline:2px solid #d97706; outline-offset:-2px; background:#fff7ed; }
.cell-trl { font-size:11px; color:#7c4a03; background:#fdf3e1; border-radius:3px; padding:0 4px; margin:0 0 3px; display:inline-block; }
.cell-trl.none { color:#9ca3af; background:#f3f4f6; }

/* týdenní přehled: odjeté trasy */
table.vk td.st-done { background:#dcfce7; } table.vk td.st-done .rname { color:#166534; }
table.vk td.st-part { background:#ffedd5; } table.vk td.st-part .rname { color:#9a3412; }
table.vk td.st-miss { background:#fee2e2; } table.vk td.st-miss .rname { color:#991b1b; }
.stdot { display:inline-block; width:12px; height:12px; border-radius:3px; vertical-align:-2px; }
.stdot.st-done { background:#86efac; } .stdot.st-part { background:#fdba74; } .stdot.st-miss { background:#fca5a5; }

table.vk td.away-day { background:repeating-linear-gradient(135deg, #f3f4f6 0 6px, #e9eaec 6px 12px); color:#9ca3af; font-style:italic; text-align:center; }

s.sh-old { color:#b42318; text-decoration-thickness:2px; }
.sh-new { font-weight:600; color:#166534; }
.sh-old-note { color:#b42318; font-size:11px; }

.badge.blive { background:#1d4ed8; color:#fff; }
table.ek-costs .stick { position:sticky; left:0; background:var(--card, #fff); z-index:2; box-shadow:1px 0 0 var(--line, #e5e7eb); }
table.ek-costs tr.defrow .stick { background:#f3f4f6; }
table.ek-costs tr.curchg td { background:#fffbeb; }
table.ek-costs select.vcur { padding:2px 4px; }

.ppausal { color:#1e40af; }
.pturn-ok { color:#166534; font-weight:600; } .pturn-low { color:#b42318; font-weight:600; }

.noprice { color:#b42318; font-weight:600; }
tr.noprice-row td { background:#fef2f2; }
.badge.bsf { background:#5b21b6; color:#fff; }
.sfasg { display:flex; gap:4px; flex-wrap:wrap; align-items:center; margin-top:4px; }
.sfasg select { max-width:260px; padding:2px 4px; font-size:12px; }
.plan-head { align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:8px; }
.plan-head h1 { margin:0; }
.plan-dates { color:var(--muted); font-size:14px; }
.pcard.pcard-ro { background:#eceef1 !important; border-color:#c5cad3 !important; color:#5b6472; cursor:pointer; opacity:.85; }
.pcard .pro { color:#5b6472; font-weight:600; }
.badge.bxtra { background:#e0ecff; color:#1d4ed8; }
/* Sklad Přerov – grafikon vlaků */
.sp-legend { display:flex; gap:14px; flex-wrap:wrap; align-items:center; margin:4px 0 8px; }
.sp-sw { display:inline-block; width:22px; height:10px; border-radius:2px; margin-right:5px; vertical-align:middle; }
.sp-sw-load { background:#64748b; } .sp-sw-travel { background:repeating-linear-gradient(45deg,#94a3b8 0 4px,#cbd5e1 4px 8px); }
.sp-sw-wh { background:#1f2937; } .sp-sw-empty { height:3px; background:#94a3b8; }
.sp-wrap { overflow-x:auto; background:#fff; border:1px solid var(--line, #e5e7eb); border-radius:8px; }
.sp-grid { min-width:1100px; }
.sp-head, .sp-row { display:grid; grid-template-columns:150px 1fr; }
.sp-head { position:sticky; top:0; background:#f8fafc; z-index:3; border-bottom:1px solid #e5e7eb; }
.sp-lab { padding:6px 8px; border-right:1px solid #e5e7eb; font-size:13px; }
.sp-track { position:relative; }
.sp-days { display:grid; grid-template-columns:repeat(var(--days), 1fr); }
.sp-day { font-size:10.5px; text-align:center; padding:18px 0 4px; border-left:1px solid #eef0f3; position:relative; white-space:nowrap; overflow:hidden; color:#475569; }
.sp-day.we { background:#f1f5f9; } .sp-day.today { background:#fef3c7; font-weight:700; } .sp-day.wk { border-left:2px solid #94a3b8; }
.sp-wkno { position:absolute; top:2px; left:4px; font-size:10.5px; color:#1e293b; }
.sp-row { border-bottom:1px solid #eef0f3; min-height:34px; }
.sp-whrow { background:#fafafa; border-bottom:2px solid #cbd5e1; min-height:40px; }
.sp-bg { position:absolute; inset:0; display:grid; grid-template-columns:repeat(var(--days), 1fr); pointer-events:none; }
.sp-bg > div { border-left:1px solid #eef0f3; } .sp-bg .we { background:#f8fafc; } .sp-bg .wk { border-left:2px solid #cbd5e1; } .sp-bg .today { background:#fffbeb; }
.sp-now { position:absolute; top:0; bottom:0; width:2px; background:#dc2626; z-index:2; pointer-events:none; }
.sp-gname { padding:4px 8px; font-weight:700; font-size:12px; color:#fff; background:var(--c); }
.sp-seg { position:absolute; top:9px; height:16px; border-radius:3px; z-index:1; display:block; }
.sp-load { background:var(--c); }
.sp-travel { background:repeating-linear-gradient(45deg, var(--c) 0 4px, color-mix(in srgb, var(--c) 35%, #fff) 4px 8px); }
.sp-wh { background:#1f2937; box-shadow:inset 0 -3px 0 var(--c); }
.sp-empty { top:16px; height:2px; background:color-mix(in srgb, var(--c) 45%, #fff); border-radius:0; }
.sp-whrow .sp-seg { top:10px; height:20px; color:#fff; font-size:10.5px; font-weight:700; overflow:hidden; white-space:nowrap; text-align:center; line-height:17px; text-decoration:none; }
.sp-whrow .sp-seg.clash { outline:2px solid #dc2626; outline-offset:1px; }
.sp-lbl { position:absolute; top:-1px; font-size:9.5px; font-weight:700; color:#334155; text-align:center; white-space:nowrap; overflow:visible; pointer-events:none; z-index:2; line-height:10px; }
.sp-pt { position:absolute; top:11px; width:10px; height:10px; margin-left:-5px; border-radius:50%; background:var(--c); border:2px solid #fff; box-shadow:0 0 0 1px var(--c); z-index:2; }
.sp-seg:hover, .sp-pt:hover { filter:brightness(1.15); outline:2px solid #0f172a; }
tr.sel td { background:#fef9c3; } tr.muted td { color:#94a3b8; }
.sp-day.wk { overflow:visible; } .sp-wkno { white-space:nowrap; z-index:1; }
.sp-cal { position:relative; display:inline-block; margin-left:2px; }
.sp-cal button { padding:4px 6px; }
.sp-cal input[type=date] { position:absolute; left:0; bottom:0; width:1px; height:1px; opacity:0; pointer-events:none; border:0; padding:0; }
/* grafikon: výraznější víkend, světlejší pobyt ve skladu */
.sp-day.we { background:#fde2e2; color:#b42318; font-weight:600; }
.sp-bg .we { background:#fbe0e0; }
.sp-day.today { background:#fef3c7; color:#92400e; }
.sp-wh, .sp-sw-wh { background:#bae6fd !important; }
.sp-wh { box-shadow:inset 0 0 0 1px #0284c7, inset 0 -3px 0 var(--c); }
.sp-whrow .sp-seg { color:#0c4a6e; }
/* reklamace – e-maily */
.rk-mail { border:1px solid #e2e8f0; border-radius:8px; margin:6px 0; background:#fff; }
.rk-mail > summary { display:flex; gap:12px; align-items:center; padding:8px 12px; cursor:pointer; flex-wrap:wrap; list-style:none; }
.rk-mail > summary::-webkit-details-marker { display:none; }
.rk-mail > summary::before { content:"▸"; color:#94a3b8; }
.rk-mail[open] > summary::before { content:"▾"; }
.rk-mail.rk-new { border-left:4px solid #5b21b6; }
.rk-mail.rk-out { background:#f8fafc; }
.rk-from { color:#475569; font-size:13px; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rk-subj { font-weight:600; flex:1; min-width:200px; }
.rk-body { padding:4px 14px 12px 30px; border-top:1px solid #eef0f3; }
.rk-text { white-space:pre-wrap; font-size:13.5px; line-height:1.45; max-height:480px; overflow:auto; }
.rk-atts { display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; }
.rk-card { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:12px; margin:10px 0; }
.rk-card .panel { margin:0; } .rk-card h3 { margin:0 0 6px; font-size:13px; text-transform:uppercase; color:#64748b; letter-spacing:.03em; }
.rk-kv { display:grid; grid-template-columns:auto 1fr; gap:3px 12px; font-size:14px; } .rk-kv dt { color:#64748b; } .rk-kv dd { margin:0; font-weight:600; }
.rk-big { font-size:17px; font-weight:700; }
.rk-who { padding:5px 0; border-top:1px solid #eef0f3; font-size:14px; }
a.sorth { color:inherit; text-decoration:none; white-space:nowrap; } a.sorth:hover { text-decoration:underline; }
.rk-imp { display:inline-block; position:relative; } .rk-imp > summary { list-style:none; cursor:pointer; } .rk-imp > summary::-webkit-details-marker { display:none; }
tr.rz-over td { background:#fef2f2; }
.sp-nn { font-weight:600; color:#7c3aed; } .sp-note { border-left:3px solid #94a3b8; padding:4px 10px; margin:6px 0; background:#f8fafc; } .sp-note-p { border-left-color:#7c3aed; }
/* dopis – formulář a živý náhled */
.lt-wrap { display:grid; grid-template-columns:minmax(360px, 1fr) minmax(420px, 1.1fr); gap:16px; align-items:start; }
@media (max-width: 1100px) { .lt-wrap { grid-template-columns:1fr; } }
.lt-form textarea, .lt-form input[type=text] { width:100%; }
.lt-paper { background:#fff; border:1px solid #d6dbd8; box-shadow:0 2px 10px rgba(0,0,0,.06); padding:38px 40px 46px 52px; font-family:Calibri, Carlito, sans-serif; font-size:14px; line-height:1.45; color:#111; position:sticky; top:12px; }
.lt-co { color:#1F5F4A; font-weight:700; font-size:20px; } .lt-id { color:#555; font-size:11.5px; }
.lt-hr { border:0; border-top:1.5px solid #1F5F4A; margin:6px 0 22px; }
.lt-addr { margin-bottom:22px; min-height:60px; } .lt-refs { font-size:12.5px; margin-bottom:10px; } .lt-refs td { padding:0 14px 1px 0; border:0; background:none; }
.lt-date { text-align:right; margin:8px 0 22px; } .lt-subj { font-weight:700; margin-bottom:14px; }
.lt-body p { text-align:justify; } .lt-ph { color:#aaa; font-style:italic; } .lt-sign { margin-top:40px; }
.lt-refs { width:auto !important; }
.rz-chips { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 4px; }
.rz-chips a { padding:4px 10px; border:1px solid #d6dbd8; border-radius:14px; text-decoration:none; color:#334155; font-size:13px; background:#fff; }
.rz-chips a.on { background:#1F5F4A; border-color:#1F5F4A; color:#fff; } .rz-chips a b { margin-left:3px; }
select.rz-stav { font-weight:600; background:#e0ecff; color:#1d4ed8; border-color:#bfd3ff; padding:3px 6px; } select.rz-stav.closed { background:#eceef1; color:#5b6472; }
.st-st { font-size:12px; padding:1px 7px; border-radius:10px; background:#eceef1; color:#475569; white-space:nowrap; }
.st-rozpracováno { background:#fef3c7; color:#92400e; } .st-ke-kontrole { background:#e0ecff; color:#1d4ed8; }
.st-vydáno { background:#dcfce7; color:#166534; font-weight:600; } .st-archiv { background:#eceef1; color:#64748b; }
.datepick-wrap { display:inline-flex; align-items:center; gap:2px; }
.datepick-wrap input.datepick { flex:none; }
.form-grid .datepick-wrap { display:flex; }
.form-grid .datepick-wrap input.datepick { flex:1 1 auto; min-width:0; width:auto; }
.datepick-wrap .sp-cal { margin-left:0; flex:none; }
.vz-chips { display:flex; flex-wrap:wrap; gap:6px; }
.vz-chip { display:inline-flex; align-items:center; gap:4px; padding:3px 4px 3px 9px; border-radius:14px; background:#eef4f1; border:1px solid #d5e4dc; font-size:13px; }
.vz-chip.vz-ridic { background:#eef2fb; border-color:#d6def3; }
.vz-x { border:0; background:none; color:#94a3b8; cursor:pointer; padding:0 4px; font-size:15px; line-height:1; }
.vz-x:hover { color:#b42318; }
.vz-add { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto; gap:4px; margin-top:6px; align-items:center; }
.vz-add select, .vz-add input { min-width:0; width:100%; padding:5px 6px; font-size:13px; }
.ss-input { min-width:0; }
.vz-add .ss-input { width:100%; padding:5px 6px; font-size:13px; }
.ss-box { padding:4px; }
/* grafikon: výraznější hranice dnů a týdnů */
.sp-day { border-left:1px solid #b4bec9; }
.sp-bg > div { border-left:1px solid #c2cad4; }
.sp-day.wk, .sp-bg .wk { border-left:2px solid #475569; }
.sp-head .sp-days { border-bottom:1px solid #b4bec9; }
/* grafikon: návrat na nakládku jinam (šipka) a rychlá poznámka dvojklikem */
.sp-ret { top:15px; height:0; border-top:2px dashed var(--c); border-radius:0; overflow:visible; text-decoration:none; }
.sp-ret::after { content:""; position:absolute; right:-2px; top:-7px; border:6px solid transparent; border-left:9px solid var(--c); border-right:0; }
.sp-ret span { position:absolute; left:calc(100% + 3px); top:-12px; line-height:12px; font-size:10px; font-weight:700; color:var(--c); white-space:nowrap; background:rgba(255,255,255,.85); padding:0 3px; border-radius:3px; }
.sp-sw-ret { height:0; border-top:2px dashed #475569; position:relative; }
.sp-qnote { position:absolute; z-index:1001; width:340px; background:#fff; border:1px solid var(--line, #e5e7eb); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.18); padding:10px; }
.sp-qnote textarea { width:100%; margin-top:6px; }
.sp-qnote-t { color:var(--muted, #64748b); }
.sp-in { position:absolute; top:20px; line-height:12px; transform:translateX(-100%); margin-left:-3px; font-size:10px; font-weight:700; color:var(--c); white-space:nowrap; text-decoration:none; background:rgba(255,255,255,.85); padding:0 3px; border-radius:3px; border-right:2px solid var(--c); z-index:2; }
