:root {
  /* tmavě modrá paleta – stejná ve světlém i tmavém režimu systému */
  color-scheme: dark;
  --bg: #101722;
  --surface: #172130;
  --surface-2: #131b28;
  --text: #ffffff;
  --muted: #ffffff;
  --border: #273248;
  --border-strong: #3a4763;
  --accent: #4170e8;
  --accent-hover: #5683f2;
  --accent-soft: #2a3a68;
  --accent-light: #7d9df5;
  --accent-text: #ffffff;
  --danger: #f87171;
  --danger-soft: #2b1a22;
  --row-hover: #283456;
  --ring: rgba(65, 112, 232, .35);
  --glow: rgba(65, 112, 232, .18);
  --glass: rgba(23, 33, 48, .92);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
  --radius: 12px;
  --sidebar: 232px;
  --placeholder: #a3b2c6;
  --menu: #0d1929;
  --font: Inter, "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* u proměnných nefunguje záložní řádek – light-dark() jen tam, kde ho prohlížeč zná */
@supports (color: light-dark(#fff, #000)) {
  :root { --bg: light-dark(#f5f7fa, #101722); --surface: light-dark(#ffffff, #172130); --placeholder: light-dark(#64748a, #a3b2c6); --menu: light-dark(#102b46, #0d1929); }
}

* { box-sizing: border-box; }

/* formulářové prvky a dialogy mají v prohlížečích vlastní písmo – vynutit Avenir Next */
button, input, select, textarea, dialog { font-family: var(--font); }

body {
  margin: 0;
  font: 15px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ikony; mapa (Leaflet) kreslí trasu do vlastního SVG, které velikost ikony nesmí dostat */
svg:where(:not(.leaflet-container svg)) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- logo ---------- */

.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #4f86ff, #2f5fe0);
  color: #fff;
  box-shadow: 0 4px 10px -2px rgba(47, 107, 255, .45);
}

/* ---------- boční panel (desktop) ---------- */

header {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  background: var(--menu);
  border-right: 1px solid var(--border);
  z-index: 5;
}
header .brand { padding: 0 8px; }

nav { display: flex; flex-direction: column; gap: 2px; }
nav button {
  display: flex; align-items: center; gap: 12px;
  border: 0;
  background: none;
  color: #fff;
  padding: 9px 12px;
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
nav button:hover { background: var(--surface-2); }
nav button.active { background: var(--accent-soft); font-weight: 600; }
nav button.active svg { color: var(--accent-light); }
#nav-more { display: none; }

header .user {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
}
header .user .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
header .user .link { padding: 0; color: #fff; }
header .user .link:hover { background: none; text-decoration: underline; }

main { margin-left: var(--sidebar); padding: 28px 32px 48px; max-width: calc(1280px + var(--sidebar)); }

.tab { display: none; }
.tab.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { transform: translateY(4px); } to { transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab.active, dialog[open], dialog.sheet[open] { animation: none; } }

/* ---------- hlavička stránky a filtry ---------- */

.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; min-height: 38px; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.page-head label.inline { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }

h2 { font-size: 15px; margin: 28px 0 12px; letter-spacing: -.01em; }
.toolbar h2 { margin: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.toolbar label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.toolbar > input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.spacer { flex: 1; }

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  transition: border-color .15s, box-shadow .15s;
}
/* ---------- řádek filtrů: nahoře období, pod čarou upřesnění ---------- */

.filters { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; margin-bottom: 20px; }
.filters-period, .filters-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
.filters-fields { border-top: 1px solid var(--border); background: rgba(0, 0, 0, .12); border-radius: 0 0 var(--radius) var(--radius); }
/* výkaz: měsíc a auto stačí na jednom řádku */
.filters:not(:has(.chips)) { flex-direction: row; flex-wrap: wrap; }
.filters:not(:has(.chips)) .filters-fields { border-top: 0; background: none; }

.filters select, .filters input, .filters .date-range, .filters .search { height: 40px; }
.filters input, .filters select { background: var(--surface-2); }
.filters select {
  -webkit-appearance: none; appearance: none;
  padding: 0 34px 0 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3b2c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
}
.filters input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; filter: invert(1); }
.filters input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* od – do a hledání jako pilulky s ikonou */
.filters .date-range, .filters .search {
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--placeholder);
  transition: border-color .15s, box-shadow .15s;
}
.date-range:hover, .search:hover { border-color: var(--border-strong); }
.date-range:focus-within, .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.date-range svg, .search svg { width: 16px; height: 16px; }
.filters .date-range input, .filters .search input {
  height: 100%; border: 0; background: none; box-shadow: none; padding: 0 4px; font-size: 14px; min-width: 0;
}
.date-range input { font-variant-numeric: tabular-nums; }
.filters .search { flex: 1 1 220px; padding-right: 14px; }
.search input { flex: 1; }

.filter-reset {
  margin-left: auto; height: 40px; padding: 0 14px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--placeholder);
  white-space: nowrap; transition: background .15s, color .15s;
}
.filter-reset:hover { background: var(--surface-2); color: var(--text); }
.filter-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* přepínač měsíců ‹ Říjen 2026 › */
.month-switch { display: inline-flex; align-items: center; gap: 4px; }
.month-switch button {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.month-switch button:hover { background: var(--row-hover); border-color: var(--border-strong); }
.month-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.month-switch svg { width: 18px; height: 18px; }
.month-label { min-width: 150px; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* rychlá volba období */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.chips button {
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
}
.chips button:hover { background: var(--surface-2); border-color: var(--border-strong); }
.chips button.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; font-weight: 600; }
.chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }

/* ---------- tlačítka ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, nav button:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; }
.btn.secondary:hover { background: var(--surface-2); }

.link {
  border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500;
  padding: 3px 6px; border-radius: 6px;
}
.link:hover { background: var(--accent-soft); }
.link.danger { color: var(--danger); }
.link.danger:hover { background: var(--danger-soft); }

/* ---------- dlaždice se součty ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- tabulky ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600;
  background: var(--surface-2);
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 120px; }

/* akce v řádku jako ikony vedle sebe; tachometr na dva řádky – tabulka se vejde bez posuvníku */
td.row-actions { width: 1%; padding-top: 4px; padding-bottom: 4px; }
td.row-actions .icon-btn { display: inline-flex; width: 30px; height: 30px; vertical-align: middle; }
td.odo-cell { line-height: 1.3; }
td.odo-cell span { display: block; color: var(--placeholder); font-size: .92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 13px; }
td .muted { font-size: 12px; }
.inactive td { opacity: .5; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* akce v řádku jsou nenápadné, dokud na řádek nenajedete myší */
@media (hover: hover) {
  .row-actions .link { opacity: .8; }
  tr:hover .row-actions .link, .row-actions .link:focus-visible { opacity: 1; }
}

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #2e2416; color: #fbbf24;
}

/* ---------- přehled ---------- */

.month-switch button:disabled { opacity: .35; cursor: default; background: var(--surface-2); border-color: var(--border); }
.year-switch .month-label { min-width: 70px; }
.stats-summary { margin-bottom: 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 2px 0 0; color: var(--placeholder); font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 15px; }
.card .big { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.card .big small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* karta auta */
.vehicle-card { padding: 18px 20px; }
.vehicle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vehicle-head h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate {
  flex-shrink: 0; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums;
}
.vehicle-card .big { margin-top: 14px; }
.vehicle-card .big small { color: var(--placeholder); }
.split { height: 8px; margin-top: 12px; border-radius: 999px; background: #f59e0b; overflow: hidden; }
.split div { height: 100%; background: var(--accent); border-radius: 999px 0 0 999px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: var(--placeholder); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.work { background: var(--accent); }
.dot.private { background: #f59e0b; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.metrics span { display: block; font-size: 12px; color: var(--placeholder); }
.metrics b { display: block; margin-top: 2px; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.metrics b small { font-size: 12px; font-weight: 500; color: var(--placeholder); }

.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.panel-head .muted { color: var(--placeholder); font-size: 12px; }

/* graf po měsících */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--placeholder); }
.bar div {
  width: 100%; max-width: 36px; min-height: 2px;
  background: var(--accent-soft);
  border-radius: 6px 6px 2px 2px;
  transition: background .15s;
}
.bar div.zero { background: var(--border); }
.bar:hover div:not(.zero) { background: var(--accent); }
.bar.current div:not(.zero) { background: linear-gradient(to top, var(--accent), var(--accent-light)); }
.bar.current span { color: var(--text); font-weight: 700; }
.bar span { margin-top: 6px; }
.bar small { font-size: 10px; margin-bottom: 4px; color: var(--text); font-weight: 600; }

/* žebříček řidičů */
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank-row { display: flex; align-items: center; gap: 12px; }
.rank-pos {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700;
}
.rank-row:first-child .rank-pos { background: var(--accent-soft); border-color: var(--accent); }
.rank-main { flex: 1; min-width: 0; }
.rank-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rank-line b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-line span { flex-shrink: 0; font-weight: 600; }
.rank-line small { font-weight: 500; color: var(--placeholder); font-size: 12px; }
.rank-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rank-bar div { height: 100%; border-radius: 999px; background: var(--accent); }

/* ---------- auta a řidiči ---------- */

.master-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.master-grid.drivers { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.master-card { padding: 16px 18px; transition: border-color .15s; }
.master-card:hover { border-color: var(--border-strong); }
.master-card.inactive { opacity: .55; }
.master-card.inactive:hover { opacity: .85; }
.master-top { display: flex; align-items: flex-start; gap: 12px; }
.master-icon, .avatar {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-light);
}
.avatar { border-radius: 50%; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.master-title { flex: 1; min-width: 0; }
.master-title h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--placeholder); }
.pill.off { color: #fbbf24; border-color: #5a4419; background: #2e2416; }
.master-card .metrics { margin-top: 14px; padding-top: 14px; }

/* fotka auta */
.vehicle-master { padding-top: 0; overflow: hidden; }
.vehicle-photo {
  position: relative; display: block; width: calc(100% + 36px); margin: 0 -18px 14px;
  aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.vehicle-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vehicle-photo.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-bottom: 1px dashed var(--border-strong); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--placeholder);
  transition: background .15s, color .15s;
}
.vehicle-photo.empty svg { width: 28px; height: 28px; }
.vehicle-photo.empty:hover { background: var(--row-hover); color: var(--text); }
.vehicle-photo.empty:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.photo-actions {
  position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .15s;
}
.vehicle-photo:hover .photo-actions, .photo-actions:focus-within { opacity: 1; }
@media (hover: none) { .photo-actions { opacity: 1; } }
.photo-btn {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 0; border-radius: 8px; background: rgba(13, 25, 41, .78); color: #fff; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px);
}
.photo-btn svg { width: 15px; height: 15px; }
.photo-btn:hover { background: rgba(13, 25, 41, .95); }
.photo-btn.danger:hover { color: var(--danger); }
.vehicle-master.uploading .vehicle-photo { opacity: .5; pointer-events: none; }
.vehicle-master.uploading .vehicle-photo::after {
  content: "Ukládám…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.vehicle-banner {
  display: block; width: calc(100% + 40px); margin: -18px -20px 14px; aspect-ratio: 16 / 9; object-fit: cover;
  border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}

.driver-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }

.master-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: none; color: var(--placeholder); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.master-empty {
  grid-column: 1 / -1; padding: 28px 20px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--placeholder); font-size: 14px;
}

.backup { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 32px; padding: 16px 18px; }
.backup-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--accent-light); }
.backup-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.backup-text b { font-size: 14px; }
.backup-text .muted { color: var(--placeholder); }

/* ---------- dialogy ---------- */

dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 22px 24px;
  width: min(580px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(15, 18, 25, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 18px; font-size: 18px; letter-spacing: -.01em; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.grid label.wide { grid-column: 1 / -1; }
.grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.grid input, .grid select, .grid textarea { width: 100%; }
.grid label.check input { width: auto; accent-color: var(--accent); }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.error { color: var(--danger); min-height: 1em; margin: 10px 0 0; font-size: 13px; }
.error:empty { margin: 0; min-height: 0; }
.hint { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--danger); background: var(--danger-soft); }
.hint:empty { display: none; }

/* ---------- barevné dialogy jízdy a tankování ---------- */

dialog.themed { padding: 0; width: min(640px, calc(100vw - 32px)); overflow: hidden; }
/* dialogy jízdy a tankování v barvách zbytku aplikace */
dialog.themed { --dlg: var(--accent); --dlg-2: var(--accent-hover); --dlg-soft: rgba(65, 112, 232, .12); --dlg-line: rgba(65, 112, 232, .35); --dlg-text: #fff; }
dialog.themed form { padding: 0 24px 20px; max-height: calc(100vh - 48px); overflow-y: auto; }

.dlg-head {
  display: flex; align-items: center; gap: 14px;
  margin: 0 -24px 18px; padding: 18px 24px;
  background: linear-gradient(120deg, var(--dlg-soft), transparent 70%), var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.dlg-head::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--dlg), var(--dlg-2)); }
.dlg-head h3 { margin: 0; }
.dlg-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.dlg-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--dlg), var(--dlg-2)); color: #fff;
  box-shadow: 0 6px 16px -6px var(--dlg);
}
.dlg-icon svg { width: 22px; height: 22px; }

.section { margin-bottom: 16px; }
.section h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dlg);
}
.section h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--dlg-line), transparent); }
.grid.three { grid-template-columns: 1.1fr 1.3fr 1.1fr; }

dialog.themed input, dialog.themed select, dialog.themed textarea { background: var(--surface-2); }
dialog.themed input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
dialog.themed input[type="number"]::-webkit-inner-spin-button, dialog.themed input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
dialog.themed input:focus, dialog.themed select:focus, dialog.themed textarea:focus { border-color: var(--dlg); box-shadow: 0 0 0 3px var(--dlg-soft); }
dialog.themed .btn[type="submit"] { background: linear-gradient(135deg, var(--dlg), var(--dlg-2)); color: var(--dlg-text); border: 0; box-shadow: 0 6px 16px -8px var(--dlg); }
dialog.themed .btn[type="submit"]:hover { filter: brightness(1.08); }
dialog.themed .actions { margin: 18px -24px -20px; padding: 14px 24px; background: var(--surface-2); }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }

/* typ jízdy jako dvě tlačítka */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid .segmented label { flex-direction: row; gap: 0; font-size: 14px; }
/* skrytá pole: bez velikosti, jinak je .grid input { width: 100% } roztáhne na šířku okna a stránka přeteče */
.segmented input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.segmented span {
  flex: 1; text-align: center; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-weight: 600;
  transition: all .15s;
}
.segmented span:hover { border-color: var(--border-strong); color: var(--text); }
.seg-business input:checked + span { background: var(--dlg-soft); border-color: var(--dlg); color: #fff; }
.seg-private input:checked + span { background: rgba(245, 158, 11, .16); border-color: #f59e0b; color: #fbbf24; }
.segmented input:focus-visible + span { outline: 2px solid var(--dlg); outline-offset: 2px; }

/* tachometr */
.odo-panel { padding: 14px; border-radius: 12px; background: var(--dlg-soft); border: 1px solid var(--dlg-line); }
.odo { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.odo label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.odo input { width: 100%; font-variant-numeric: tabular-nums; }
.odo-km { color: var(--dlg) !important; }
.odo-km input { font-size: 20px; font-weight: 700; text-align: center; padding: 6px 10px; border-color: var(--dlg-line); color: var(--text); }
.odo-panel .hint { margin-top: 10px; }

/* tankování: cena za litr */
.money-panel { padding: 14px; border-radius: 12px; background: var(--dlg-soft); border: 1px solid var(--dlg-line); }
.calc { justify-content: flex-end; }
.calc b {
  display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: 18px; color: #fff; background: var(--dlg-soft); font-variant-numeric: tabular-nums;
}

/* přepínač „plná nádrž“ */
.grid label.switch { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.grid label.switch small { color: var(--muted); font-size: 12px; }
.switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--dlg); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--dlg); outline-offset: 2px; }

label.note { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
label.note textarea { width: 100%; resize: vertical; }

dialog.themed.narrow { width: min(460px, calc(100vw - 32px)); }
.segmented.chips { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 560px) { .segmented.chips { grid-template-columns: repeat(3, 1fr); } }
.segmented.chips.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .segmented.chips.four { grid-template-columns: repeat(2, 1fr); } }
.chips input:checked + span { background: var(--dlg-soft); border-color: var(--dlg); color: #fff; }
dialog.themed > form > label.switch { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; margin-top: 4px; }
dialog.themed > form > label.switch small { color: var(--muted); font-size: 12px; }
label.note input { width: 100%; }

/* v dialozích bílé písmo: popisky, nadpisy sekcí, hodnoty i tlačítka */
dialog.themed :is(.dlg-head p, .section h4, .grid label, .field, .odo label, .odo-km, label.note, .switch small, .calc b, .segmented span) { color: #fff !important; }
dialog.themed .segmented span { color: rgba(255, 255, 255, .7) !important; }
dialog.themed .segmented input:checked + span { color: #fff !important; }

@media (max-width: 560px) {
  .grid.three, .odo { grid-template-columns: 1fr; }
}

/* ---------- výkaz ---------- */

.print-only { display: none; }

/* výkaz jako dokument */
.report-doc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.report-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
}
.report-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-light); }
.report-head h2 { margin: 2px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.report-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.report-meta dt { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--placeholder); }
.report-meta dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.report-sum { margin: 0 0 18px; }
.report-sum .stat { background: var(--surface-2); box-shadow: none; }
.report-doc .table-wrap { box-shadow: none; }

.type-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.type-pill.work { background: var(--accent-soft); color: var(--accent-light); }
.type-pill.private { background: #2e2416; color: #fbbf24; }

.signatures { grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.signatures div { padding-top: 6px; border-top: 1px solid #000; font-size: 11px; color: #555; }

/* cestovní náhrady */
#allowance { margin-top: 20px; padding: 20px 24px; }
.allowance-head { display: flex; gap: 14px; align-items: flex-start; }
.allowance-head h3 { margin: 0; font-size: 16px; }
.allowance-head p { margin: 4px 0 0; color: var(--placeholder); max-width: 640px; }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 20px 0; }
.unit-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--placeholder); }
.unit-input {
  display: flex; align-items: center; height: 42px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.unit-input:hover { border-color: var(--border-strong); }
.unit-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.unit-input input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; box-shadow: none;
  padding: 0 12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.unit-input input:focus { box-shadow: none; }
.unit-input input::-webkit-inner-spin-button, .unit-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input em { padding: 0 12px; font-style: normal; font-size: 13px; color: var(--placeholder); white-space: nowrap; }

.allowance-hint { margin: 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 10px; text-align: center; color: var(--placeholder); font-size: 13px; }
.allowance-result { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: stretch; }
.allowance-lines { margin: 0; display: flex; flex-direction: column; }
.allowance-lines div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.allowance-lines div:last-child { border-bottom: 0; }
.allowance-lines dt { font-size: 14px; }
.allowance-lines dt small { display: block; font-size: 12px; color: var(--placeholder); font-variant-numeric: tabular-nums; }
.allowance-lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.allowance-total {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 220px;
  padding: 18px 22px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.allowance-total span { font-size: 12px; font-weight: 600; color: var(--accent-light); text-transform: uppercase; letter-spacing: .05em; }
.allowance-total b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .report-doc, #allowance { padding: 16px; }
  .report-head h2 { font-size: 22px; }
  .allowance-result { grid-template-columns: 1fr; }
}

/* ---------- přihlášení ---------- */

body.loading > *, body:not(.logged-in) > header, body:not(.logged-in) > main, body.logged-in #login { display: none; }

#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background:
    radial-gradient(60rem 30rem at 10% -10%, var(--glow), transparent),
    radial-gradient(50rem 30rem at 110% 110%, var(--glow), transparent),
    var(--bg);
}
#login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; box-shadow: var(--shadow-lg); border-radius: 16px; }
#login .brand h1 { font-size: 22px; }
#login form > .muted { margin: -6px 0 4px; }
#login h1 { font-size: 22px; margin: 0; }
#login label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
#login .btn { padding: 10px 14px; }
#login .error, #login .info { margin: 0; }
#login .info { font-size: 13px; color: var(--muted); }
#login .error:empty, #login .info:empty { display: none; }
#login form[hidden] { display: none; }

/* ---------- desktop: filtry na jednom řádku ---------- */

@media (min-width: 900px) {
  .filters-fields > *:not(.search) { white-space: nowrap; flex-shrink: 0; }
  .filters .search { min-width: 200px; }
}

/* ---------- notebook 1440 × 900 (MacBook Air): šířka 1200–1599 px ---------- */

@media (min-width: 1200px) and (max-width: 1599px) {
  :root { --sidebar: 216px; }
  header { padding: 18px 12px; gap: 20px; }
  main { padding: 22px 28px 40px; max-width: none; }

  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 22px; }
  h2 { margin: 22px 0 10px; }

  /* součty v jednom řádku: přehled má 6 dlaždic, jízdy a tankování 4 */
  .summary { gap: 10px; }
  .stats-summary { grid-template-columns: repeat(6, 1fr); }
  .stat { padding: 10px 14px; }
  .stat b { font-size: 18px; }

  /* karty aut: 4 vedle sebe (obsah je cca 1170 px široký) */
  .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
  .vehicle-card { padding: 16px 18px; }
  .master-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

  /* tabulky: o něco hustší, aby se vešly bez vodorovného posuvníku */
  table { font-size: 14px; }
  th, td { padding: 9px 10px; }

  .bars { height: 190px; }
  .month-label { min-width: 130px; }

  /* filtry včetně „Zrušit filtry“ vždy na jednom řádku; zužuje se jen hledání */
  .filters-fields { flex-wrap: nowrap; gap: 8px; padding: 12px 14px; }
  .filters-fields > * { flex-shrink: 0; }
  .filters select { max-width: 170px; padding-left: 12px; text-overflow: ellipsis; }
  .filters .date-range { padding: 0 6px 0 12px; gap: 4px; }
  .filters .date-range input { width: 136px; flex: none; }
  .filters .search { flex: 1 1 0; min-width: 120px; }
  .filter-reset { padding: 0 10px; }
}

/* ---------- nízké okno (900 px displej, prohlížeči zbývá cca 780 px) ---------- */

@media (min-width: 900px) and (max-height: 900px) {
  header { gap: 18px; }
  nav button { padding: 8px 12px; }

  /* dialogy se vejdou celé i s tlačítky; když ne, posouvá se jejich obsah */
  dialog.themed { max-height: calc(100vh - 32px); }
  dialog.themed form { max-height: calc(100vh - 34px); }
  .dlg-head { padding: 14px 24px; margin-bottom: 14px; }
  .dlg-icon { width: 38px; height: 38px; }
  .section { margin-bottom: 12px; }
  .section h4 { margin-bottom: 8px; }
  .odo-panel, .money-panel { padding: 12px; }
  label.note textarea { min-height: 0; }
  dialog.themed .actions { margin-top: 14px; padding: 12px 24px; }
}

/* ---------- telefon a úzká okna ---------- */

@media (max-width: 899px) {
  header {
    position: sticky; inset: auto; top: 0;
    width: auto; flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    border-right: 0; border-bottom: 1px solid var(--border);
    /* bez backdrop-filter: ten by z hlavičky udělal rámec pro position: fixed a spodní lišta by skončila nahoře */
    background: var(--menu);
  }
  header .brand { padding: 0; }
  .logo { width: 30px; height: 30px; }
  /* e-mail a odhlášení jsou v panelu „Více“ */
  header .user { display: none; }

  /* spodní lišta: Jízdy · Tankování · Přehled · Více, ostatní záložky v panelu zespodu */
  nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    flex-direction: row; gap: 0;
    padding: 6px 6px max(8px, env(safe-area-inset-bottom));
    background: var(--menu);
    border-top: 1px solid var(--border);
  }
  nav button { flex: 1; min-width: 0; flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 11px; text-align: center; }
  nav button:hover { background: none; }
  nav button.active { background: none; }
  nav button svg { box-sizing: content-box; padding: 4px 16px; border-radius: 14px; transition: background .15s; }
  nav button.active svg { background: var(--accent-soft); }
  nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  nav [data-tab="trips"] { order: 1; }
  nav [data-tab="fuel"] { order: 2; }
  nav [data-tab="stats"] { order: 3; }
  nav [data-tab="plan"], nav [data-tab="report"], nav [data-tab="prices"], nav [data-tab="settings"] { display: none; }
  #nav-more { display: flex; order: 4; }

  dialog.sheet {
    margin: auto 0 0; padding: 0;
    width: 100%; max-width: 100%;
    border: 0; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  }
  dialog.sheet[open] { animation: sheet-up .25s cubic-bezier(.2, .8, .2, 1); }
  .sheet-body { padding: 8px 16px max(20px, env(safe-area-inset-bottom)); }
  .grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 14px; }
  .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheet-grid button {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 14px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-2); color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer;
  }
  .sheet-grid button.active { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
  .sheet-grid button.active svg { color: var(--accent-light); }
  .sheet-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sheet-account {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  }
  #sheet-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--placeholder); }
  #sheet-logout { font-weight: 600; }

  main { margin-left: 0; padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 22px; flex-basis: 100%; }
  /* editor cesty: šipka zpět a nadpis na jednom řádku, tlačítka pod nimi */
  #plan-editor .page-head h1 { flex: 1 1 calc(100% - 52px); }
  .page-head .spacer { display: none; }
}

@media (max-width: 640px) {
  /* 16px zabrání automatickému zoomu Safari na iPhonu při psaní */
  input, select, textarea { font-size: 16px; }
  .toolbar > select, .toolbar > input[type="search"] { flex: 1 1 140px; max-width: none; }
  .filters > label { flex: 1 1 140px; }
  .filters > label input { flex: 1; min-width: 0; }
  .filters-period, .filters-fields { padding: 12px; gap: 10px; }
  .filters .month-switch { flex: 1 1 100%; justify-content: space-between; }
  .chips { margin-left: 0; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips button { flex-shrink: 0; }
  .filters-fields > select { flex: 1 1 140px; }
  .filters .date-range, .filters .search { flex: 1 1 100%; }
  .filters .date-range input { flex: 1; }
  .filters .filter-reset { flex: 1 1 100%; margin-left: 0; }
  .page-head .btn { flex: 1; }
  .summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat b { font-size: 17px; }

  /* tabulky jako karty */
  .table-wrap:not(.plain) { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap:not(.plain) :is(table, tbody, tr, td) { display: block; background: none; }
  .table-wrap:not(.plain) thead { display: none; }
  .table-wrap:not(.plain) tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 8px 0; box-shadow: var(--shadow); }
  .table-wrap:not(.plain) td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 16px; white-space: normal; text-align: right; }
  .table-wrap:not(.plain) td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex-shrink: 0; }
  .table-wrap:not(.plain) td.wrap { min-width: 0; }
  .table-wrap:not(.plain) td.row-actions { width: auto; justify-content: flex-end; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
  .table-wrap:not(.plain) td.row-actions::before, .table-wrap:not(.plain) td.empty::before { content: none; }
  .table-wrap:not(.plain) td.empty { display: block; text-align: center; }
  .table-wrap.plain th, .table-wrap.plain td { padding: 8px 10px; }
  .link { font-size: 15px; padding: 6px 8px; }
}

/* ---------- tisk výkazu ---------- */

@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #555; --border: #ccc; --row-hover: #fff; --accent: #000; --shadow: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  header, .no-print, .row-actions { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  .tab.active { animation: none; }
  .table-wrap, .card, .stat { border: 0; padding: 0; box-shadow: none; }
  .summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat b { font-size: 14px; }
  th, td { padding: 4px 6px; border-bottom: 1px solid #ccc; }
  th { background: none; }
  :root { --placeholder: #555; --accent-light: #000; --accent-soft: #fff; }
  .report-doc { border: 0; padding: 0; }
  .report-head { border-color: #000; }
  .report-sum .stat { background: none; }
  .type-pill { padding: 0; background: none !important; color: #000 !important; font-weight: 400; }
  .print-only { display: grid; }
  .plate { border-color: #000; }
  #allowance { padding: 0; margin-top: 24px; break-inside: avoid; }
  .allowance-head .backup-icon { display: none; }
  .rate-grid { margin: 10px 0; }
  .unit-input { border: 0; height: auto; background: none; }
  .unit-input input { padding: 0; width: 6em; flex: none; }
  .unit-input em { padding: 0 0 0 4px; }
  .allowance-total { border-color: #000; }
}

/* ---------- dálniční známky ---------- */

.small { font-size: 12px; }
.pill.ok { color: #6ee7b7; border-color: #1f5640; background: #14291f; }
.pill.warn { color: #fbbf24; border-color: #5a4419; background: #2e2416; }
.warn-text { color: #fbbf24; }

.vignettes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.vignettes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vignettes-head > span { font-size: 12px; color: var(--placeholder); }
.vignettes .muted.small { margin: 0; color: var(--placeholder); }
.vignette-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.vignette-row .country {
  flex-shrink: 0; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.vignette-kind { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.vignette-kind small { font-weight: 500; color: var(--placeholder); }
.vignette-row .icon-btn { width: 28px; height: 28px; }
.vignette-row .icon-btn svg { width: 15px; height: 15px; }

.buy-panel {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px;
  border-radius: 12px; background: var(--dlg-soft); border: 1px solid var(--dlg-line);
}
.buy-panel > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.buy-panel .muted { font-size: 12px; color: var(--placeholder); }
.buy-panel .muted b { color: var(--text); }
.buy-panel .link { padding: 1px 4px; font-size: 12px; }
@media (max-width: 520px) { .buy-panel { flex-direction: column; align-items: stretch; } }
.section > p.small { margin: 8px 0 0; color: var(--placeholder); }

/* ---------- plánování cest ---------- */

.btn[hidden] { display: none; }

.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.plan-card { cursor: pointer; transition: border-color .15s; }
.plan-card:hover { border-color: var(--border-strong); }
.plan-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-card.done { opacity: .7; }
.plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.plan-date { font-size: 12px; font-weight: 600; color: var(--accent-light); }
.plan-card h3 { font-size: 16px; }
.plan-card p { margin: 4px 0 0; color: var(--placeholder); }

#plan-editor .page-head .icon-btn svg { width: 22px; height: 22px; }
#plan-error:empty { display: none; }
#plan-error { margin: -8px 0 14px; }

.plan-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
/* minmax(0, …): dlouhá adresa ze zastávky (nowrap) jinak sloupec roztáhne přes šířku telefonu */
@media (max-width: 1100px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } }
.plan-form { --dlg: var(--accent); --dlg-2: var(--accent-hover); --dlg-soft: rgba(65, 112, 232, .12); --dlg-line: rgba(65, 112, 232, .35); }
.plan-form .section h4 .muted { font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--placeholder); }
.plan-form label small.muted { font-size: 11px; color: var(--placeholder); }
.plan-form label.inline-switch { flex-direction: row; align-items: center; align-self: end; gap: 10px; min-height: 38px; color: var(--text); font-size: 14px; cursor: pointer; }
.plan-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-side .summary { margin: 0; }
/* náklady celkem (poslední dlaždice): přes celý řádek, popisek a součet vedle sebe a větším písmem */
.plan-summary .stat:last-child {
  grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px;
}
.plan-summary .stat:last-child > span { font-size: 16px; font-weight: 600; color: var(--text); }
.plan-summary .stat:last-child b { margin: 0; font-size: 23px; text-align: right; color: var(--accent-light); }
.nowrap { white-space: nowrap; }
/* .stat span je popisek dlaždice (blok, malé písmo) – částky uvnitř součtu musí zůstat v řádku */
.stat b .nowrap { display: inline; font: inherit; color: inherit; }

.plan-stop { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.stop-dot {
  flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 6px; border-radius: 50%;
  background: var(--accent-soft); color: #fff; font-size: 12px; font-weight: 700;
}
.stop-dot.start { background: #16a34a; }
.stop-dot.end { background: #dc2626; }
.stop-field { flex: 1; min-width: 0; }
.stop-field input { width: 100%; }
.stop-field small { display: block; margin-top: 3px; font-size: 11px; color: var(--placeholder); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-stop .icon-btn { margin-top: 2px; }
.plan-stop-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 0 36px; }
#plan-route-error { margin-top: 10px; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist label { flex: 1; display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.checklist input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.checklist input:checked + span { text-decoration: line-through; color: var(--placeholder); }
.checklist .icon-btn { width: 28px; height: 28px; opacity: .6; }
.checklist .icon-btn:hover { opacity: 1; }
.checklist .icon-btn svg { width: 15px; height: 15px; }
.checklist-add { display: flex; gap: 8px; margin-top: 8px; }
.checklist-add input { flex: 1; min-width: 0; }

.plan-map { height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.plan-map.empty { display: grid; place-items: center; color: var(--placeholder); font-size: 13px; }
.plan-map .leaflet-container { font: inherit; }
@media (max-width: 640px) { .plan-map { height: 260px; } }

.need { padding: 14px 0; border-top: 1px solid var(--border); }
.need:first-child { padding-top: 0; border-top: 0; }
.need:last-child { padding-bottom: 0; }
.need h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.need p { margin: 6px 0 0; font-size: 13px; color: var(--placeholder); }
.need-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 3px 0; font-size: 14px; }
.need-row .country {
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.need-row .link { padding: 2px 4px; }
.need-row.weather b { font-size: 15px; }
.weather-icon { font-size: 22px; line-height: 1; }

/* ceny PHM – pumpy na trase (Plánování) a v okolí (Tankování) */
.fuel-country { padding: 6px 0; }
.fuel-country .muted, .fuel-stations .muted, .fuel-ref .muted, .fuel-nearby .muted, #plan-fuel-prices h3 .muted { color: var(--placeholder); }
.fuel-ref .muted { font-size: inherit; }
.fuel-country + .fuel-country { border-top: 1px dashed var(--border); }
.fuel-ref { padding: 2px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.fuel-ref a { color: var(--accent-light); }
.fuel-stations { list-style: none; margin: 4px 0 0; padding: 0; }
.fuel-stations li, .fuel-stations button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; align-items: baseline; padding: 5px 0; font-size: 13px;
}
.fuel-stations .name { font-weight: 600; overflow-wrap: anywhere; }
.fuel-stations .where { grid-column: 1; color: var(--placeholder); font-size: 12px; overflow-wrap: anywhere; }
.fuel-stations .price { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fuel-stations .price small { display: block; font-weight: 400; }
.fuel-stations.pick li { padding: 0; }
.fuel-stations.pick button {
  width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.fuel-stations.pick button:hover { background: var(--accent-soft); }
.fuel-stations.pick button.selected { border-color: var(--accent); background: var(--accent-soft); }
.fuel-nearby { margin-top: 10px; }
.fuel-nearby > .link { margin-left: -6px; }
.fuel-nearby p { margin: 6px 0 0; font-size: 13px; }
.fuel-nearby .hint { margin-top: 6px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* rozpočet cesty */
.cost-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 78px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.cost-row input, .cost-row select { width: 100%; }
.cost-row .icon-btn { width: 32px; height: 32px; }
.cost-add { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-left: -6px; }
.section > p.small { margin: 8px 0 0; color: var(--placeholder); }
@media (max-width: 520px) { .cost-row { grid-template-columns: minmax(0, 1fr) 90px 70px 32px; } }

.cost-list { margin: 0; }
.cost-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.cost-list dt { font-size: 14px; }
.cost-list dt small { display: block; font-size: 12px; color: var(--placeholder); }
.cost-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-list .cost-total { border-bottom: 0; padding-top: 10px; }
.cost-list .cost-total dt { font-weight: 700; }
.cost-list .cost-total dd { font-size: 16px; font-weight: 700; color: var(--accent-light); white-space: normal; text-align: right; }

.country-row { padding: 6px 0; }
.country-row + .country-row { border-top: 1px dashed var(--border); }
.country-row p { margin-top: 2px; }

/* VIN a registr vozidel */
.vin-row { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 10px; }
.vin-row label { flex: 1; min-width: 0; }
.vin-row input { text-transform: uppercase; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.vin-info { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; color: var(--placeholder); }
.vin-info:empty { display: none; }
.error-text { color: var(--danger) !important; }
@media (max-width: 520px) { .vin-row { flex-direction: column; align-items: stretch; } }

/* ---------- ceníky známek a mýta ---------- */

.price-input {
  display: inline-flex; align-items: center; height: 34px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.price-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.price-input input {
  width: 6.5em; flex: none; height: 100%; border: 0; background: none; box-shadow: none; padding: 0 6px 0 10px;
  text-align: right; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.price-input input:focus { box-shadow: none; }
.price-input input::-webkit-inner-spin-button, .price-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.price-input em { width: 5.2em; padding: 0 8px 0 2px; font-style: normal; font-size: 12px; color: var(--placeholder); text-align: left; white-space: nowrap; }
.price-input input.saved { color: #4ade80; transition: color .2s; }

/* výběr služby pro výpočet trasy */
.plan-provider { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--placeholder); }
.plan-provider select { height: 36px; padding: 0 10px; }
.plan-stop-actions { flex-wrap: wrap; }

/* varianty trasy */
.plan-alts { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.plan-alts[hidden] { display: none; }
.plan-alts h3 { margin: 0 0 4px; font-size: 14px; }
.plan-alts h3 .muted { font-weight: 500; font-size: 12px; color: var(--placeholder); margin-left: 6px; }
.alt-route {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%;
  padding: 10px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit;
  transition: border-color .15s, background .15s;
}
.alt-route:hover { border-color: var(--border-strong); }
.alt-route.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.alt-route:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.alt-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.alt-main b { font-size: 16px; font-variant-numeric: tabular-nums; }
.alt-main .slower { color: #fbbf24; font-weight: 600; font-variant-numeric: tabular-nums; }
.alt-sub { font-size: 12px; color: var(--placeholder); font-variant-numeric: tabular-nums; }
.rate-source { margin: -8px 0 16px; font-size: 12px; color: var(--placeholder); }
.fx-total { color: var(--placeholder); font-weight: 500; }

/* ---------- ceníky: podzáložky a karty ---------- */

.price-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.price-tabs {
  display: flex; gap: 4px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.price-tabs button {
  flex-shrink: 0; height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--placeholder); white-space: nowrap;
  transition: background .15s, color .15s;
}
.price-tabs button:hover { color: var(--text); }
.price-tabs button.active { background: var(--accent-soft); color: #fff; font-weight: 600; }
.price-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#price-year { height: 38px; }

.pane-intro { margin: 0 0 16px; max-width: 760px; font-size: 13px; color: var(--placeholder); }
.price-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.price-card { padding: 16px 18px; }
.price-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 28px; margin-bottom: 8px; }
.price-card-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; }
.price-card-head .link.small, .price-rows .link.small { padding: 0; font-size: 12px; }
.price-card .country, .price-rows .country {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
}
.price-rows { margin: 0; display: flex; flex-direction: column; }
.price-rows > div {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  min-height: 48px; padding: 6px 0; border-top: 1px solid var(--border);
}
.price-rows dt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; font-size: 14px; }
.price-rows .row-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.price-rows dd { margin: 0; display: grid; grid-template-columns: auto 34px; align-items: center; gap: 4px; }
.price-rows .icon-btn { opacity: .5; }
.price-rows > div:hover .icon-btn, .price-rows .icon-btn:focus-visible { opacity: 1; }


/* kurzy ČNB: informace, dlaždice měn na cestách, přepočet a tabulka všech kurzů */
#price-fx { display: flex; flex-direction: column; gap: 16px; }
.fx-info { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; color: var(--placeholder); }
.fx-info b { color: var(--text); }
.fx-info .link.small { padding: 0; font-size: 12px; }
.fx-title { margin: 4px 0 -6px; font-size: 14px; }
.fx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fx-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fx-tile-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--placeholder); }
.fx-tile b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.fx-tile small { font-size: 11px; color: var(--placeholder); }
.fx-tile .country, .fx-table .country {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 22px; padding: 0 6px;
  border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--text);
}

.fx-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .fx-layout { grid-template-columns: 1fr; } }
.fx-converter, .fx-all { padding: 16px 18px; }
.fx-converter h3, .fx-all h3 { margin: 0 0 12px; font-size: 15px; }
.fx-converter { position: sticky; top: 16px; }
.fx-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.fx-calc input, .fx-calc select { height: 40px; min-width: 0; }
.fx-calc input { font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.fx-result { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent); }
.fx-result span { font-size: 13px; color: var(--accent-light); }
.fx-result b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fx-result small { font-size: 11px; color: var(--placeholder); }
.fx-result:empty { display: none; }

.fx-all { overflow-x: auto; }
.fx-table { width: 100%; min-width: 440px; }
.fx-table th, .fx-table td { padding: 7px 10px; }
.fx-table th { background: none; border-bottom: 1px solid var(--border-strong); }
.fx-table th:first-child, .fx-table td:first-child { padding-left: 0; }
.fx-table th:last-child, .fx-table td:last-child { padding-right: 0; }
.fx-table td:first-child { color: var(--placeholder); }
.fx-table td b { font-variant-numeric: tabular-nums; }
.fx-table tr.travel td:first-child { color: var(--text); font-weight: 600; }
.page-head label.inline[hidden] { display: none; }
/* ceník je taky .card – nesmí převzít dvousloupcové dl z karet Přehledu */
.price-card .price-rows { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; border: 0; font-size: 14px; }
.price-card .price-rows dt { color: var(--text); }
.price-card .price-rows dd { text-align: left; font-weight: 400; }
.price-rows dt small { font-size: 11px; }
/* známky a mýtné: jedna země na řádek přes celou šířku, položky v kartě ve sloupcích vedle sebe */
#price-vignettes, #price-tolls { grid-template-columns: 1fr; gap: 12px; }
#price-vignettes .price-rows, #price-tolls .price-rows {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); column-gap: 32px;
}

/* sazby náhrad: dlaždice vedle sebe, pod nimi karta se změnami */
#price-rates { display: flex; flex-direction: column; gap: 16px; }
.rate-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rate-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.rate-tile-label { font-size: 12px; font-weight: 600; color: var(--placeholder); }
.rate-tile b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.rate-tile-unit { font-size: 12px; color: var(--placeholder); margin-top: -2px; }
.rate-tile small { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--placeholder); }
.rate-table { width: 100%; }
.rate-table th, .rate-table td { padding: 8px 10px; vertical-align: middle; }
.rate-table th { background: none; border-bottom: 1px solid var(--border-strong); }
.rate-table th:first-child, .rate-table td:first-child { padding-left: 0; }
.rate-table th:last-child, .rate-table td:last-child { padding-right: 0; width: 1%; }
.rate-table td:nth-child(2) { color: var(--placeholder); font-variant-numeric: tabular-nums; }
.rate-table tbody tr:hover { background: none; }
.rate-table tbody .icon-btn { opacity: .5; }
.rate-table tbody tr:hover .icon-btn, .rate-table .icon-btn:focus-visible { opacity: 1; }
.rate-table tfoot td { border-bottom: 0; border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.rate-table tfoot select, .rate-table tfoot input[type="date"] { height: 34px; font-size: 13px; width: 100%; min-width: 0; }
.rate-table tfoot .btn { height: 34px; padding: 0 14px; font-size: 13px; }
.rate-changes { overflow-x: auto; }
.rate-table { min-width: 520px; }
/* známky a mýtné: položky v kartě pod sebou v jednom sloupci */
#price-vignettes .price-rows, #price-tolls .price-rows { display: flex; flex-direction: column; }

/* vyhledávání v podzáložkách Ceníků */
.pane-search-box {
  display: flex; align-items: center; gap: 8px; flex: 0 1 320px; min-width: 200px; height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--placeholder);
  transition: border-color .15s, box-shadow .15s;
}
.pane-search-box:hover { border-color: var(--border-strong); }
.pane-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.pane-search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.pane-search-box input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; box-shadow: none; font-size: 14px; }
.pane-search-box input:focus { box-shadow: none; }
.search-empty { margin: 0 0 12px; }
@media (max-width: 640px) { .pane-search-box { flex-basis: 100%; } }
/* skryté výsledky hledání – i u prvků, které mají vlastní display (grid, flex) */
[data-item][hidden], [data-group][hidden] { display: none !important; }
