/* Moris Slovakia — Prezúvacia akcia (komplety.moris.club)
   Pokojný, kancelársky vzhľad: biele plochy na svetlosivom pozadí, Moris
   bordová len pre hlavné akcie, farby stavov ako jemné odtiene. */

:root {
  --primary: #8B1A2B;
  --primary-hover: #731524;
  --primary-tint: #fbf1f3;
  --ink: #111318;
  --text: #2d3139;
  --muted: #6b7280;
  --faint: #a1a7b0;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --hover: #f6f7f9;
  --border: #e8eaee;
  --border-strong: #d7dbe1;

  --s-none: #6b7280;    --s-none-bg: #f1f2f4;
  --s-nedvihal: #a15c07; --s-nedvihal-bg: #fdf3e2;
  --s-zavolat: #1d4ed8; --s-zavolat-bg: #ecf1fe;
  --s-osloveny: #6d28d9; --s-osloveny-bg: #f3eefe;
  --s-pride: #0f7a55;   --s-pride-bg: #e6f5ee;
  --s-nepride: #b42318; --s-nepride-bg: #fdeeec;
  --indigo: #3f3ab8;    --indigo-bg: #eff0fe;

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(17,19,24,.05);
  --shadow: 0 8px 24px rgba(17,19,24,.08);
  --shadow-lg: 0 20px 50px rgba(17,19,24,.18);
  --t: .15s cubic-bezier(.4,0,.2,1);
  --font: 'Audi Type', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.sep { font-style: normal; color: var(--faint); margin: 0 6px; }

/* ── Ovládacie prvky ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background var(--t), border-color var(--t), color var(--t); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--panel); border-color: var(--border-strong); color: var(--ink); }
.btn--ghost:hover, .btn--ghost.is-on { border-color: var(--ink); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; height: 46px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); transition: all var(--t); }
.iconbtn:hover { color: var(--ink); background: var(--hover); }
.iconbtn:disabled { opacity: .35; cursor: default; background: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }

.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--panel); outline: none; transition: border-color var(--t), box-shadow var(--t); }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,19,24,.06); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--center { justify-content: center; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; transition: all var(--t); }
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .02em; }
.av--sm { width: 20px; height: 20px; font-size: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.ecv { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 11.5px; letter-spacing: .04em; border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; background: #fff; color: var(--ink); line-height: 1.5; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--s-none-bg); color: var(--s-none); }
.tread { font-weight: 700; font-variant-numeric: tabular-nums; }
.tread--low { color: var(--s-nepride); }
.tread--mid { color: var(--s-nedvihal); }
.tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.tag--swapped { background: #eceef1; color: #4b5563; }
.st { display: inline-block; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.st--none { background: var(--s-none-bg); color: var(--s-none); }
.st--nedvihal { background: var(--s-nedvihal-bg); color: var(--s-nedvihal); }
.st--zavolat { background: var(--s-zavolat-bg); color: var(--s-zavolat); }
.st--osloveny { background: var(--s-osloveny-bg); color: var(--s-osloveny); }
.st--pride { background: var(--s-pride-bg); color: var(--s-pride); }
.st--nepride { background: var(--s-nepride-bg); color: var(--s-nepride); }

/* ── Prihlásenie / meno ──────────────────────────────────────── */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 80% -10%, rgba(139,26,43,.08), transparent 60%), var(--bg); }
.gate__box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 34px 28px; box-shadow: var(--shadow); display: grid; gap: 12px; text-align: center; }
.gate__logo { height: 32px; justify-self: center; margin-bottom: 8px; }
.gate h1 { margin: 0; font-size: 24px; color: var(--ink); }
.gate p { margin: 0 0 4px; color: var(--muted); }
.input--pin { height: 54px; text-align: center; font-size: 26px; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.gate__err { min-height: 20px; color: var(--s-nepride); font-weight: 600; font-size: 13px; }

/* ── Hlavička ────────────────────────────────────────────────── */
.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 64px; padding: 0 24px; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.top__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top__logo { height: 22px; }
.top__title { display: flex; flex-direction: column; line-height: 1.25; padding-left: 14px; border-left: 1px solid var(--border); min-width: 0; }
.top__title h1 { margin: 0; font-size: 15px; color: var(--ink); white-space: nowrap; }
.top__title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.views { display: inline-flex; gap: 2px; padding: 3px; background: #eef0f3; border-radius: 10px; }
.views button { height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; transition: all var(--t); white-space: nowrap; }
.views button:hover { color: var(--ink); }
.views button.is-on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(17,19,24,.12); }
.top__right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.online { display: flex; align-items: center; margin-right: 4px; }
.online .av { width: 26px; height: 26px; border: 2px solid #fff; margin-left: -7px; font-size: 10px; }
.online .av:first-child { margin-left: 0; }
.online__more { font-size: 12px; color: var(--muted); margin-left: 6px; }
.me { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; font-weight: 700; font-size: 13px; transition: border-color var(--t); }
.me .av { width: 28px; height: 28px; }
.me:hover { border-color: var(--border-strong); }
.menu { position: relative; }
.menu__pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu__pop button, .menu__pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); text-align: left; }
.menu__pop button:hover, .menu__pop a:hover { background: var(--hover); }
.menu__pop svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu__pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

/* ── Prehľad ─────────────────────────────────────────────────── */
.summary { display: flex; margin: 20px 24px 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.sum { flex: 1 1 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; border: 0; border-left: 1px solid var(--border); background: none; text-align: left; min-width: 0; }
.sum:first-child { border-left: 0; }
.sum--main { flex: 2 1 0; }
.sum--link { cursor: pointer; transition: background var(--t); }
.sum--link:hover { background: var(--hover); }
.sum__l { font-size: 12px; font-weight: 600; color: var(--muted); }
.sum__v { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sum__v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sum > small { font-size: 12px; color: var(--faint); }
.sum__warn { color: var(--s-nedvihal) !important; font-weight: 600; }
.progress { height: 6px; border-radius: 3px; background: #eef0f3; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--s-pride); transition: width .4s ease; }

/* ── Panel so zoznamom ───────────────────────────────────────── */
.panel { margin: 16px 24px 28px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 10px; border: 0; background: none; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color var(--t); }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); }
.tab.is-on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tab__n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #eef0f3; color: var(--muted); font-size: 11.5px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab.is-on .tab__n { background: var(--primary-tint); color: var(--primary); }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 360px; min-width: 220px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 36px; padding: 0 34px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--panel); outline: none; font-size: 13.5px; transition: border-color var(--t), box-shadow var(--t); }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,19,24,.06); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 17px; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border-radius: 999px; border: 1px solid #ecd3d8; background: var(--primary-tint); color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; max-width: 320px; }
.fchip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip span { font-size: 10px; opacity: .7; }
.fchip:hover { border-color: var(--primary); }
.toolbar__spacer { flex: 1; }
.count { font-size: 12.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { width: 32px; height: 18px; border-radius: 999px; background: #d4d8de; position: relative; transition: background var(--t); }
.switch__ui::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t); }
.switch input:checked + .switch__ui { background: var(--ink); }
.switch input:checked + .switch__ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid rgba(17,19,24,.25); outline-offset: 2px; }

.fpanel { padding: 4px 16px 14px; }
.fpanel__row { display: flex; flex-wrap: wrap; gap: 10px; }
.fsel { position: relative; display: inline-flex; flex-direction: column; gap: 3px; }
.fsel > span { font-size: 11px; color: var(--muted); font-weight: 700; padding-left: 2px; }
.fsel__btn { height: 34px; min-width: 130px; max-width: 220px; padding: 0 28px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--panel) no-repeat right 10px center / 9px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6'/%3E%3C/svg%3E"); cursor: pointer; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsel__btn:hover { border-color: var(--ink); }
.fsel__btn.is-set { border-color: var(--primary); background-color: var(--primary-tint); color: var(--primary); font-weight: 700; }
.fsel__menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 35; min-width: 220px; max-height: 340px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.fsel.is-open .fsel__menu { display: block; }
.fsel.is-open .fsel__btn { border-color: var(--ink); }
.fsel__opt { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.fsel__opt:hover { background: var(--hover); }
.fsel__opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); flex: none; }
.fsel__foot { position: sticky; bottom: -6px; display: flex; justify-content: space-between; gap: 10px; padding: 8px 8px 4px; margin-top: 4px; border-top: 1px solid var(--border); background: var(--panel); }

/* ── Tabuľka ─────────────────────────────────────────────────── */
.tablewrap { overflow: auto; max-height: calc(100vh - 290px); max-height: calc(100dvh - 290px); min-height: 360px; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 3; background: var(--panel-2); text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
.tbl th:hover { color: var(--ink); }
.tbl th.is-sorted { color: var(--ink); }
.tbl th.is-sorted::after { content: ' ↑'; color: var(--primary); }
.tbl th.is-sorted.is-desc::after { content: ' ↓'; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; background: var(--panel); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tbody tr.is-open td { background: var(--primary-tint); }
.tbl tbody tr.is-flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #fff5d1; } to { background: var(--panel); } }
.tbl .sticky { position: sticky; left: 0; z-index: 2; }
.tbl th.sticky { z-index: 4; }
.tbl tr.st-pride td:first-child { box-shadow: inset 3px 0 0 var(--s-pride); }
.tbl tr.is-swapped td { color: var(--faint); }
.tbl tr.is-swapped .cust__t, .tbl tr.is-swapped .ecv, .tbl tr.is-swapped .set__top { color: var(--muted); }
.tbl tr.is-swapped .gsel { opacity: .6; }

.cust { display: flex; flex-direction: column; gap: 2px; min-width: 220px; max-width: 300px; white-space: normal; }
.cust__name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cust__t { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust__sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; }
.cust__more { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer; }
.cust__more:hover { text-decoration: underline; }
.viewers { display: inline-flex; gap: 2px; }
.veh { display: flex; flex-direction: column; gap: 3px; min-width: 150px; max-width: 230px; }
.veh__top { display: flex; align-items: center; gap: 7px; }
.veh__model { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.brand--audi { color: var(--ink); }
.brand--skoda { color: #0e6b3b; }
.set { display: flex; flex-direction: column; gap: 2px; }
.set__top { font-weight: 600; color: var(--ink); font-size: 12.5px; }
.set__sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; }

.gsel { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 9px 0 10px; border-radius: 999px; border: 1px solid transparent; font-size: 12.5px; font-weight: 700; cursor: pointer; max-width: 230px; transition: background var(--t), border-color var(--t); }
.gsel > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsel select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 14px; }
.gsel__chev { color: var(--faint); opacity: 0; transition: opacity var(--t); }
.gsel:hover .gsel__chev, .gsel:focus-within .gsel__chev { opacity: 1; }
.gsel:focus-within { outline: 2px solid rgba(17,19,24,.18); outline-offset: 1px; }
.gsel--st .dot { background: currentColor; }
.s-none { color: var(--s-none); padding-left: 8px; }
.s-none:hover { background: var(--hover); border-color: var(--border); }
.s-nedvihal { background: var(--s-nedvihal-bg); color: var(--s-nedvihal); }
.s-zavolat { background: var(--s-zavolat-bg); color: var(--s-zavolat); }
.s-osloveny { background: var(--s-osloveny-bg); color: var(--s-osloveny); }
.s-pride { background: var(--s-pride-bg); color: var(--s-pride); }
.s-nepride { background: var(--s-nepride-bg); color: var(--s-nepride); }
.gsel--tm, .gsel--dv { color: var(--ink); }
.gsel--tm:hover, .gsel--dv:hover { background: var(--hover); border-color: var(--border); }
.gsel--tm.is-set { background: var(--panel); border-color: var(--border-strong); }
.d-yes { background: var(--indigo-bg); color: var(--indigo); }
.d-no { color: var(--muted); }
.act { display: flex; flex-direction: column; gap: 2px; max-width: 240px; }
.act__by { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.act__by small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.act__note { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act__note b { color: var(--faint); font-weight: 700; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── Detail (drawer) ─────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; background: rgba(17,19,24,.24); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: var(--panel); z-index: 50; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .2s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr__head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.dr__head h2 { margin: 0; font-size: 19px; color: var(--ink); line-height: 1.25; }
.dr__head .sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }
.dr__head .grow { flex: 1; min-width: 0; }
.dr__nav { display: flex; gap: 2px; }
.dr__body { flex: 1; overflow-y: auto; padding: 4px 22px 32px; }
.dr__warn, .dr__swapped { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.dr__warn { background: var(--s-nedvihal-bg); color: #7c4a03; font-weight: 600; }
.dr__swapped { background: #eef0f3; color: var(--text); justify-content: space-between; }
.dr__swapped b { color: var(--ink); }
.sec { padding: 18px 0 4px; }
.sec + .sec { border-top: 1px solid var(--border); margin-top: 14px; }
.sec__h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sec__h .meta { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--faint); margin-left: auto; }
.sec__h .linkbtn.meta { color: var(--muted); font-size: 12px; }
.sec__h .linkbtn.meta:hover { color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { display: grid; gap: 5px; }
.fld > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.tel { display: flex; gap: 6px; }
.tel a { flex: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: all var(--t); }
.seg button:hover { border-color: var(--ink); }
.seg button.is-on { color: #fff; border-color: transparent; }
.seg button.is-on .dot { background: #fff !important; }
.seg button.is-on[data-v=""] { background: var(--s-none); }
.seg button.is-on[data-v="nedvihal"] { background: var(--s-nedvihal); }
.seg button.is-on[data-v="zavolat"] { background: var(--s-zavolat); }
.seg button.is-on[data-v="osloveny"] { background: var(--s-osloveny); }
.seg button.is-on[data-v="pride"] { background: var(--s-pride); }
.seg button.is-on[data-v="nepride"] { background: var(--s-nepride); }
.seg--slots button { min-width: 64px; justify-content: center; font-variant-numeric: tabular-nums; padding: 0 9px; }
.seg--slots button.is-on, .seg--brand button.is-on { background: var(--ink); }
.seg--slots small { font-weight: 600; opacity: .6; font-size: 11px; }
.seg--slots button.is-full:not(.is-on) { border-style: dashed; color: var(--s-nepride); }
.seg--drive button.is-on { background: var(--s-none); }
.seg--drive button.is-on[data-v="yes"] { background: var(--indigo); }
.seg--drive button.is-on[data-v="no"] { background: var(--s-nepride); }
.contacted { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.row-inline { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.row-inline .input { flex: 1; min-width: 180px; }

.notes { display: grid; gap: 8px; margin-bottom: 10px; }
.note { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.note__h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note__h b { color: var(--ink); }
.note__h button { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 12px; }
.note__h button:hover { color: var(--s-nepride); }
.note__t { white-space: pre-wrap; word-break: break-word; }
.note-add { display: grid; gap: 8px; }
.note-add .hint { font-size: 11.5px; color: var(--faint); }
.note-add__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.kv { display: grid; grid-template-columns: 160px 1fr; font-size: 13px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.kv > div { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); background: var(--panel-2); font-weight: 600; }
.kv .v { color: var(--ink); word-break: break-word; }
.wheels { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 220px; }
.wheels span { border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.siblings { display: grid; gap: 6px; }
.sib { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; background: var(--panel); text-align: left; }
.sib:hover { border-color: var(--ink); }
.sib .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: grid; gap: 6px; }
.log li { display: flex; gap: 8px; color: var(--text); }
.log time { color: var(--faint); flex: none; width: 96px; font-variant-numeric: tabular-nums; }
.log b { flex: none; }
.dr__foot { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.danger { color: var(--s-nepride) !important; }

/* ── Dialógy ─────────────────────────────────────────────────── */
.dlg { border: 0; border-radius: 16px; padding: 24px; width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
.dlg::backdrop { background: rgba(17,19,24,.35); }
.dlg h2 { margin: 0; font-size: 19px; color: var(--ink); }
.dlg form { display: grid; gap: 12px; }
.dlg p { margin: 0; }
.dlg__err { color: var(--s-nepride); font-weight: 600; font-size: 13px; }
.dlg__actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; }
.dlg__note { margin-right: auto; font-size: 12px; }
.dlg--wide { width: min(760px, calc(100% - 32px)); }
.dlg--wide[open], .dlg--pick[open] { display: flex; flex-direction: column; gap: 14px; }
.dlg__head, .pick__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.dlg--pick { width: min(760px, calc(100% - 32px)); max-height: min(720px, calc(100dvh - 48px)); }
.pick__list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.pick { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; flex: none; }
.pick:hover { border-color: var(--ink); background: var(--hover); }
.pick__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick__main b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__meta { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 26px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--panel-2); cursor: pointer; color: var(--muted); transition: all var(--t); }
.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--hover); color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop b { color: var(--ink); }
.stock__sum { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.stock__sum > div { padding: 12px 16px; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.stock__sum > div:first-child { border-left: 0; }
.stock__sum b { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stock__sum span { font-size: 12px; color: var(--muted); }
.stock__sum .is-mark { background: var(--primary-tint); }
.stock__sum .is-mark b { color: var(--primary); }
.stock__warn { padding: 9px 12px; border-radius: var(--r-sm); background: var(--s-nedvihal-bg); color: #7c4a03; font-weight: 600; font-size: 13px; }
#stockResult, .dlg__result { display: grid; gap: 10px; }
#stockResult:empty, .dlg__result:empty { display: none; }
.stock__list summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 13px; }
.stock__list ul { margin: 8px 0 0; padding: 0 0 0 18px; max-height: 220px; overflow-y: auto; font-size: 12.5px; display: grid; gap: 3px; }

/* ── Kalendár ────────────────────────────────────────────────── */
.cal { padding: 16px 24px 32px; }
.cal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cal__info h2 { margin: 0; font-size: 20px; color: var(--ink); }
.cal__info > span { color: var(--muted); font-size: 13px; }
.cal__cap { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.cal__cap b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cal__capbar { width: 200px; height: 6px; border-radius: 3px; background: #e6e8ec; overflow: hidden; }
.cal__capbar i { display: block; height: 100%; background: var(--s-pride); }
.cal__actions { display: flex; gap: 8px; }
.cal__set { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.cal__set-actions { display: flex; gap: 8px; }
.cal__set .dlg__err { grid-column: 1 / -1; }
.cal__body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cal__grid { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.cal__line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }
.cal__line--half { border-top: 1px dashed #eef0f3; left: 64px; }
.cal__line span { position: absolute; left: 12px; top: -1px; transform: translateY(-50%); background: var(--panel); padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal__line:first-child span { transform: none; top: 4px; }
.cal__slot { position: absolute; left: 70px; right: 10px; display: flex; flex-direction: column; background: #f5fbf8; border: 1px solid #d5ece0; border-radius: 10px; padding: 5px 6px 6px; transition: box-shadow var(--t), border-color var(--t); }
.cal__slot.is-full { background: var(--panel-2); border-color: var(--border-strong); }
.cal__slot.is-over { background: var(--s-nepride-bg); border-color: #f3c3bd; }
.cal__slot.is-over .cal__load { color: var(--s-nepride); }
.cal.is-dragging .cal__slot { border-style: dashed; }
.cal__slot.is-target { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); }
.cal__slot-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 0 2px 4px; color: var(--ink); }
.cal__load { font-weight: 700; color: var(--s-pride); font-variant-numeric: tabular-nums; }
.cal__slot.is-full .cal__load { color: var(--muted); }
.cal__seats { flex: 1; display: grid; gap: 5px; min-height: 0; }
.cseat { border: 1px dashed #bfe0cf; border-radius: 8px; background: rgba(255,255,255,.7); color: var(--s-pride); font-weight: 700; font-size: 12px; cursor: pointer; transition: all var(--t); }
.cseat:hover { background: #fff; border-color: var(--s-pride); border-style: solid; }
.ccard { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--s-none); border-radius: 8px; padding: 5px 8px; font-size: 11.5px; line-height: 1.35; cursor: grab; overflow: hidden; min-width: 0; user-select: none; box-shadow: var(--shadow-xs); transition: box-shadow var(--t), border-color var(--t); }
.ccard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.ccard.is-drag { opacity: .4; }
.ccard.st-pride { border-left-color: var(--s-pride); }
.ccard.st-zavolat { border-left-color: var(--s-zavolat); }
.ccard.st-nedvihal { border-left-color: var(--s-nedvihal); }
.ccard.st-osloveny { border-left-color: var(--s-osloveny); }
.ccard.st-nepride { border-left-color: var(--s-nepride); opacity: .7; }
.ccard__name { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); font-size: 12px; }
.ccard__name > span:not(.tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ccard__name .dot { width: 7px; height: 7px; }
.ccard__sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard__sub b { color: var(--text); font-family: var(--mono); font-size: 11px; }
.ccard__drive { color: var(--indigo); font-weight: 700; }
.ccard__time { font-weight: 700; color: var(--ink); background: var(--bg); border-radius: 4px; padding: 0 5px; }
.cal__side { position: sticky; top: 80px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); padding: 16px; display: grid; gap: 10px; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); transition: box-shadow var(--t); }
.cal__side h3 { margin: 0; font-size: 15px; color: var(--ink); }
.cal__side > p { margin: -6px 0 0; font-size: 12px; }
.cal__side.is-target { box-shadow: 0 0 0 2px var(--primary); }
.cal__side .chip small { opacity: .6; font-weight: 600; margin-left: 2px; }
.cal__side .chip { height: 28px; font-size: 12px; padding: 0 10px; }
.cal__list { overflow-y: auto; display: grid; gap: 6px; align-content: start; min-height: 80px; }
.cal__list .ccard { padding: 6px 9px; }
.cal__empty, .cal__more { margin: 8px 2px; font-size: 13px; }

/* ── Toasty ──────────────────────────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastin .2s ease-out; max-width: calc(100vw - 32px); }
.toast--err { background: var(--s-nepride); }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Menšie obrazovky ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .top { grid-template-columns: auto 1fr auto; }
  .views { justify-self: center; }
  .top__title span { display: none; }
  .online { display: none; }
  .cal__body { grid-template-columns: 1fr; }
  .cal__side { position: static; max-height: none; }
  .cal__list { max-height: 420px; }
  .cal__set { grid-template-columns: 1fr 1fr; }
  .summary { flex-wrap: wrap; }
  .sum { flex: 1 1 25%; border-top: 1px solid var(--border); }
  .sum--main { flex: 1 1 100%; border-top: 0; }
  .sum:nth-child(2) { border-left: 0; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; height: auto; padding: 10px 16px; gap: 10px; }
  .top__title { display: none; }
  .views { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; display: flex; }
  .views button { flex: 1; }
  .me span:last-child { display: none; }
  .me { padding: 0 4px; }
  .summary { margin: 12px 16px 0; }
  .sum { flex: 1 1 50%; padding: 12px 14px; }
  .sum:nth-child(2n) { border-left: 0; }
  .sum:nth-child(2n+1):not(:first-child) { border-left: 1px solid var(--border); }
  .panel { margin: 12px 0 20px; border-radius: 0; border-left: 0; border-right: 0; }
  .tablewrap { max-height: none; border-radius: 0; }
  .search { flex: 1 1 100%; }
  .count, .switch > span:last-child { display: none; }
  .cust { min-width: 170px; max-width: 210px; }
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .dr__head, .dr__body, .dr__foot { padding-left: 16px; padding-right: 16px; }
  .cal { padding: 12px 16px 24px; }
  .cal__grid { height: auto !important; background: none; border: 0; box-shadow: none; display: grid; gap: 10px; }
  .cal__line { display: none; }
  .cal__slot { position: static; height: auto !important; }
  .cal__seats { grid-template-columns: 1fr !important; }
  .cseat { min-height: 34px; }
  .cal__set { grid-template-columns: 1fr; }
  .stock__sum { grid-template-columns: 1fr; }
  .stock__sum > div { border-left: 0; border-top: 1px solid var(--border); }
  .stock__sum > div:first-child { border-top: 0; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .top, .summary, .cal__actions, .cal__set, .cal__side, .drawer, .backdrop, .toasts, #listView { display: none !important; }
  .cal { padding: 0; }
  .cal__grid { height: auto !important; border: 0; box-shadow: none; display: block; }
  .cal__line, .cseat { display: none; }
  .cal__slot { position: static; height: auto !important; break-inside: avoid; margin-bottom: 6px; background: #fff !important; border: 1px solid #999; }
  .cal__seats { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .ccard { border: 1px solid #bbb; box-shadow: none; }
  .ccard__name > span, .ccard__sub { white-space: normal; }
}

/* Značky a stavy sady v detaile */
.pill--audi { background: #111318; color: #fff; }
.pill--skoda { background: #e7f5ee; color: #0e6b3b; }
.pill--ok { background: var(--s-pride-bg); color: var(--s-pride); }
.pill--warn { background: var(--s-nedvihal-bg); color: var(--s-nedvihal); }
.dlg--wide[open] > *, .dlg--pick[open] > *:not(.pick__list) { flex: none; }

/* Objednaní v servise (plánovač dielne) */
.tag--booked { background: var(--s-zavolat-bg); color: var(--s-zavolat); }
.tbl tr.is-booked td:first-child { box-shadow: inset 3px 0 0 #93b4f5; }
.dr__booked { margin: 14px 0 0; padding: 11px 13px; border-radius: var(--r-sm); background: var(--s-zavolat-bg); color: #1e3a8a; font-size: 13px; }
.dr__booked b { color: #1e3a8a; }
.dr__booked ul { margin: 6px 0 0; padding-left: 18px; }
.dr__booked small { display: block; margin-top: 4px; color: #4b5f9e; }
