/* =========================================================================
   Moris Editor 2.0 — spoločný design systém a app shell
   Používa sa naprieč všetkými stránkami (dashboard, appky, /analytika).
   Brand: MORIS červená #8B1A2B, typografia Audi Type.
   ========================================================================= */

:root {
  /* Brand */
  --primary: #8B1A2B;
  --primary-hover: #721524;
  --primary-active: #5f111e;
  --primary-tint: #fdf2f4;
  --primary-tint-strong: #f9e3e7;
  --accent: #A52A3A;

  /* Neutrály */
  --ink: #16181d;          /* najtmavší text / nadpisy */
  --text: #2b2f36;         /* bežný text */
  --muted: #6b7280;        /* sekundárny text */
  --faint: #9aa1ac;        /* terciárny / placeholdery */
  --bg: #f6f7f9;           /* stránka */
  --panel: #ffffff;        /* karty / sidebar */
  --panel-2: #fbfbfc;      /* jemné podfarbenie */
  --border: #e9ebef;
  --border-strong: #dcdfe4;

  /* Stavové */
  --success: #12805c;
  --success-tint: #e7f6ef;
  --warning: #b45309;
  --warning-tint: #fdf3e7;
  --info: #1d4ed8;
  --info-tint: #eaf0fe;

  /* Tvar */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Tiene */
  --shadow-xs: 0 1px 2px rgba(16,18,29,.05);
  --shadow-sm: 0 1px 3px rgba(16,18,29,.06), 0 1px 2px rgba(16,18,29,.04);
  --shadow: 0 6px 22px rgba(16,18,29,.07);
  --shadow-lg: 0 16px 40px rgba(16,18,29,.12);

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 76px;
  --maxw: 1360px;

  /* Prechody */
  --t: .16s cubic-bezier(.4,0,.2,1);
  --t-slow: .28s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Audi Type', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =========================================================================
   APP SHELL — sidebar + hlavná plocha
   App-shell model: celá plocha má výšku viewportu a NEscrolluje; scrolluje
   len .main. Sidebar tak vždy zostáva na mieste (spoľahlivejšie než sticky).
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.side {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 40;
}
.side__logo {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 24px;
}
.side__logo-img {
  height: 30px;
  width: auto;
  max-width: 100%;
  display: block;
}
.side__logo .wordmark {
  font-family: 'Audi Type Wide', 'Audi Type', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .04em;
  color: var(--primary);
  line-height: 1;
}
.side__logo .wordmark small {
  display: block;
  font-family: 'Audi Type', sans-serif;
  font-size: .5rem;
  letter-spacing: .42em;
  color: var(--faint);
  font-weight: 400;
  margin-top: 3px;
  padding-left: 2px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--faint);
  padding: 16px 12px 6px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--muted);
  font-weight: 500;
  font-size: .92rem;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  position: relative;
}
.nav__item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav__item:hover { background: var(--panel-2); color: var(--text); }
.nav__item.is-active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}
.nav__item.is-active::before {
  content: '';
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav__spacer { flex: 1; }

/* Používateľská karta dole (persona self-select) */
.side__userwrap { position: relative; margin-top: 12px; }
.side__user {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font: inherit; color: inherit;
  transition: background var(--t), border-color var(--t);
}
.side__user:hover { background: var(--panel-2); border-color: var(--border-strong); }
.side__user.is-open { border-color: var(--primary); background: var(--primary-tint); }
.avatar {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  flex-shrink: 0;
}
.avatar--sm { width: 30px; height: 30px; font-size: .7rem; }
/* Farebné odlíšenie podľa značky/predajcu (nastaviteľné v /nastavenia) */
.avatar--burgundy { background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); }
.avatar--emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.avatar--black { background: linear-gradient(135deg, #3a3f47 0%, #16181d 100%); }
.avatar--orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.side__user .who { min-width: 0; flex: 1; }
.side__user .who b { display: block; font-size: .86rem; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__user .who span { display: block; font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__user .who span:empty { display: none; }
.side__user .chev { color: var(--faint); transition: transform var(--t); }
.side__user.is-open .chev { transform: rotate(180deg); }

/* Rozbaľovacie menu persony — v štýle stránky (nie natívny select) */
.side__usermenu {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% + 8px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  max-height: 340px;
  overflow-y: auto;
}
.side__usermenu-label {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint);
  padding: 8px 10px 6px;
}
.persona-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
  font: inherit; color: inherit;
  transition: background var(--t);
}
.persona-opt:hover { background: var(--panel-2); }
.persona-opt.is-active { background: var(--primary-tint); }
.persona-opt.is-active b { color: var(--primary); }
.persona-opt__txt { min-width: 0; flex: 1; }
.persona-opt__txt b { display: block; font-size: .84rem; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona-opt__txt span { display: block; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Hlavná plocha (jediný scroll kontajner) ---- */
.main { min-width: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
}
.topbar__title { min-width: 0; flex: 1; }
.topbar__title h1 {
  margin: 0; font-size: 1.5rem; font-weight: 700;
  letter-spacing: -.02em; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.topbar__title p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

.iconbtn {
  width: 42px; height: 42px; border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid; place-items: center;
  color: var(--muted); cursor: pointer;
  transition: var(--t); position: relative;
}
.iconbtn:hover { color: var(--primary); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  font-size: .66rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
}

.content {
  padding: 8px 32px 40px;
  max-width: var(--maxw);
  width: 100%;
  flex: 1;
}

/* =========================================================================
   KOMPONENTY
   ========================================================================= */

.section-title {
  font-size: 1.02rem; font-weight: 600; color: var(--ink);
  margin: 0 0 14px; letter-spacing: -.01em;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 22px; }

/* Grid pomôcky */
.grid { display: grid; gap: 18px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.cols-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }

/* Stat karta */
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stat__icon {
  width: 42px; height: 42px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.stat__icon svg { width: 22px; height: 22px; }
.stat__label { font-size: .84rem; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 2rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.stat__delta { font-size: .8rem; font-weight: 600; margin-top: 8px; color: var(--success); }
.stat__delta.is-down { color: var(--primary); }
.stat__spark { margin-top: 10px; height: 34px; width: 100%; display: block; }

/* Zoznam aktivity */
.activity { display: flex; flex-direction: column; }
.activity__row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}
.activity__row:last-child { border-bottom: 0; }
.activity__thumb {
  width: 46px; height: 34px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--faint);
  flex-shrink: 0; overflow: hidden;
}
.activity__thumb svg { width: 20px; height: 20px; }
.activity__thumb img { width: 100%; height: 100%; object-fit: cover; }
.activity__body { flex: 1; min-width: 0; }
.activity__body b { display: block; font-size: .9rem; color: var(--ink); font-weight: 600; }
.activity__body span { display: block; font-size: .8rem; color: var(--muted); }
.activity__time { font-size: .8rem; color: var(--faint); white-space: nowrap; }

/* Odkaz na appku (najpoužívanejšie) */
.applink {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: var(--r);
  transition: background var(--t);
  cursor: pointer;
}
.applink + .applink { border-top: 1px solid var(--border); }
.applink:hover { background: var(--panel-2); }
.applink__icon {
  width: 44px; height: 44px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.applink__icon svg { width: 22px; height: 22px; }
.applink__body { flex: 1; min-width: 0; }
.applink__body b { display: block; font-size: .95rem; color: var(--ink); font-weight: 600; }
.applink__body span { display: block; font-size: .82rem; color: var(--muted); }
.applink__arrow { color: var(--faint); transition: transform var(--t), color var(--t); }
.applink:hover .applink__arrow { color: var(--primary); transform: translateX(3px); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--panel-2); color: var(--muted);
}
.badge--success { background: var(--success-tint); color: var(--success); }
.badge--primary { background: var(--primary-tint); color: var(--primary); }

/* Tlačidlá */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: 1px solid transparent; transition: var(--t);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); box-shadow: var(--shadow); }
.btn--ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--panel-2); }
.btn--sm { padding: 8px 13px; font-size: .84rem; }

/* Formulárové prvky — jednotný štýl stránky (nie natívny vzhľad) */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 10px 40px 10px 14px;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
}
select:hover { border-color: var(--primary); }
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }

/* Skryť natívne number spinnery — čistejší vzhľad */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Správca mimoriadnej výbavy (modal, zdieľaný) */
.mx-scrim {
  position: fixed; inset: 0; background: rgba(16,18,29,.45); z-index: 90;
  display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
.mx-scrim.is-open { opacity: 1; pointer-events: auto; }
.mx-modal {
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 680px; padding: 24px;
  max-height: 88vh; overflow-y: auto;
  transform: translateY(8px); transition: transform var(--t);
}
.mx-scrim.is-open .mx-modal { transform: none; }
.mx-modal h3 { margin: 0 0 4px; font-size: 1.15rem; color: var(--ink); font-weight: 700; }
.mx-sub { margin: 0 0 16px; color: var(--muted); font-size: .88rem; }
.mx-err { color: var(--primary); font-size: .84rem; margin: 0 0 8px; min-height: 0; }
.mx-err:empty { display: none; }
.mx-head, .mx-row { display: grid; grid-template-columns: 1fr 130px 92px auto; gap: 10px; align-items: center; }
.mx-head { padding: 0 2px 8px; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.mx-row { padding: 6px 0; }
.mx-row.is-hidden { opacity: .5; }
.mx-row input {
  font: inherit; font-size: .9rem; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: #fff; color: var(--text); width: 100%; min-width: 0;
}
.mx-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.mx-rowact { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.mx-tbtn {
  font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); transition: var(--t);
}
.mx-tbtn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.mx-tbtn--danger:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.mx-confirm { font-size: .82rem; color: var(--primary); font-weight: 600; }
.mx-empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 22px; }
.mx-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
@media (max-width: 620px) {
  .mx-head { display: none; }
  .mx-row { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .mx-rowact { justify-content: flex-start; }
}

/* Škoda skladové vozidlá — picker (modal so zoznamom + filtrami) */
.sv-modal { max-width: 1080px; padding: 22px 24px; }
.sv-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sv-head h3 { margin: 0; }
.sv-count { font-size: .85rem; color: var(--muted); }
.sv-close {
  margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 1.1rem;
  color: var(--faint); padding: 4px 8px; border-radius: var(--r-sm); line-height: 1;
}
.sv-close:hover { color: var(--ink); background: var(--panel-2); }
.sv-search { position: relative; margin-bottom: 10px; }
.sv-search input {
  font: inherit; font-size: .95rem; padding: 11px 13px; width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--text);
}
.sv-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
/* Rozloženie: ľavý filtračný panel + mriežka vozidiel */
.sv-body { display: grid; grid-template-columns: 218px 1fr; gap: 18px; align-items: start; }
.sv-rail { max-height: 60vh; overflow-y: auto; padding-right: 6px; }
.sv-rail::-webkit-scrollbar { width: 8px; }
.sv-rail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.sv-group { margin-bottom: 16px; }
.sv-group__t {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); margin-bottom: 6px;
}
/* Rýchly multi-výber: celý riadok je klikateľný, žiadne rozbaľovanie. */
.sv-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font: inherit; font-size: .84rem; color: var(--text); cursor: pointer;
  padding: 5px 8px; border: 0; background: none; border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
}
.sv-opt:hover { background: var(--panel-2); }
.sv-opt__box {
  width: 15px; height: 15px; flex: 0 0 15px; border-radius: 4px; position: relative;
  border: 1.5px solid var(--border-strong); background: #fff; transition: var(--t);
}
.sv-opt.is-on { color: var(--primary); font-weight: 600; }
.sv-opt.is-on .sv-opt__box { background: var(--primary); border-color: var(--primary); }
.sv-opt.is-on .sv-opt__box::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sv-opt__n { margin-left: auto; font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.sv-opt.is-on .sv-opt__n { color: var(--primary); }
.sv-opt.is-empty { opacity: .4; cursor: default; }
.sv-opt.is-empty:hover { background: none; }
.sv-price { display: flex; align-items: center; gap: 6px; }
.sv-price input {
  font: inherit; font-size: .82rem; padding: 7px 8px; width: 100%; min-width: 0; text-align: right;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: #fff; color: var(--text);
}
.sv-price input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.sv-price span { color: var(--faint); font-size: .8rem; }
.sv-reset {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .8rem;
  font-weight: 600; color: var(--primary); padding: 4px 8px; margin-bottom: 10px;
}
.sv-reset:hover { text-decoration: underline; }
.sv-reset[hidden] { display: none; }
.sv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px;
  max-height: 60vh; overflow-y: auto; padding: 2px;
}
.sv-card {
  text-align: left; font: inherit; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; transition: var(--t);
}
.sv-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.sv-card__img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--panel-2);
  opacity: 0; transition: opacity .25s; }
.sv-card__img.is-loaded { opacity: 1; }
.sv-card__b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.sv-card__t { font-weight: 600; font-size: .89rem; color: var(--ink); line-height: 1.25; }
.sv-card__m { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.sv-card__p { font-size: 1rem; font-weight: 700; color: var(--primary); margin-top: 2px; }
.sv-card__old { font-size: .76rem; color: var(--faint); text-decoration: line-through; font-weight: 500; margin-left: 6px; }
.sv-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sv-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .02em; padding: 2px 7px;
  border-radius: var(--r-pill); background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.sv-badge--awd { color: var(--info); background: var(--info-tint); border-color: transparent; }
.sv-badge--demo { color: var(--warning); background: var(--warning-tint); border-color: transparent; }
.sv-badge--disc { color: var(--success); background: var(--success-tint); border-color: transparent; }
.sv-empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 34px 10px; grid-column: 1/-1; }
@media (max-width: 860px) {
  /* Úzke okno: filtre nad mriežku, obe časti skrolujú samostatne. */
  .sv-body { grid-template-columns: 1fr; gap: 12px; }
  .sv-rail { max-height: 32vh; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
  .sv-grid { max-height: 46vh; }
}
@media (max-width: 620px) {
  .sv-modal { padding: 18px 16px; }
  .sv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .sv-opt, .sv-price input { font-size: .8rem; }
}

/* Dvojstĺpcový riadok polí (zdieľaný — používa ho aj blok klienta) */
.cl-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .cl-body .row2 { grid-template-columns: 1fr; } }

/* Údaje o klientovi — zbaliteľný blok (zdieľaný) */
.cl-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--panel-2); transition: var(--t);
}
.cl-toggle:hover { border-color: var(--border-strong); }
.cl-toggle.is-open { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.cl-chev { display: inline-block; color: var(--faint); transition: transform var(--t); font-size: 1.05rem; line-height: 1; }
.cl-toggle.is-open .cl-chev { transform: rotate(90deg); color: var(--primary); }
.cl-note { margin-left: auto; font-size: .78rem; font-weight: 500; color: var(--faint); }
.cl-note.is-filled { color: var(--success); font-weight: 600; }
.cl-body { margin-top: 12px; }
/* Doplnenie firemných údajov z registrov — lupa priamo v poli Firma / IČO */
.cl-find { position: relative; display: flex; }
.cl-find input { flex: 1; min-width: 0; padding-right: 40px !important; }
.cl-find__btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; color: var(--faint);
  border-radius: var(--r-sm); transition: var(--t); padding: 0;
}
.cl-find__btn svg { width: 16px; height: 16px; }
.cl-find__btn:hover { color: var(--primary); background: var(--primary-tint); }
.cl-hits { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.cl-hit {
  display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--panel); cursor: pointer; transition: var(--t);
}
.cl-hit:hover { border-color: var(--primary); background: var(--primary-tint); }
.cl-hit b { font-size: .88rem; color: var(--ink); font-weight: 600; }
.cl-hit span { font-size: .78rem; color: var(--muted); }
@media (max-width: 560px) { .cl-lookup { flex-wrap: wrap; } .cl-lookup .btn { width: 100%; } }

/* Vlastný kalendár (date picker) */
.dp-wrap { position: relative; }
.dp-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 40px !important; cursor: text;
}
.dp-pop {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 12px; width: 280px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; color: var(--ink); font-size: .92rem; }
.dp-nav {
  width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1;
  transition: var(--t);
}
.dp-nav:hover { border-color: var(--primary); color: var(--primary); }
.dp-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dp-dow span { text-align: center; font-size: .68rem; font-weight: 600; color: var(--faint); text-transform: uppercase; padding: 4px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-cell { height: 34px; display: grid; place-items: center; }
.dp-day {
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: .86rem;
  color: var(--text); border-radius: var(--r-sm); width: 100%; height: 100%; transition: var(--t);
}
.dp-day:hover { background: var(--primary-tint); color: var(--primary); }
.dp-day.is-today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--border-strong); }
.dp-day.is-sel { background: var(--primary); color: #fff; font-weight: 600; }
.dp-day.is-sel:hover { background: var(--primary-hover); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-link { background: none; border: 0; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; color: var(--primary); padding: 4px 6px; }
.dp-link:hover { text-decoration: underline; }

/* Promo banner */
.promo {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--primary-tint) 0%, var(--primary-tint-strong) 100%);
  border: 1px solid var(--primary-tint-strong);
  padding: 26px 28px;
  display: flex; align-items: center; gap: 22px;
}
.promo__icon {
  width: 54px; height: 54px; border-radius: var(--r);
  background: var(--primary); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
}
.promo__icon svg { width: 28px; height: 28px; }
.promo__body { flex: 1; min-width: 0; }
.promo__body h3 { margin: 0 0 4px; font-size: 1.15rem; color: var(--ink); font-weight: 700; }
.promo__body p { margin: 0; color: var(--text); font-size: .9rem; }
.promo__art {
  position: absolute; right: -20px; bottom: -30px; width: 320px; opacity: .9;
  pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}

/* Footer */
.foot {
  margin-top: auto;
  padding: 18px 32px;
  color: var(--faint); font-size: .78rem;
  display: flex; gap: 8px; justify-content: center; align-items: center;
  border-top: 1px solid var(--border);
}
.foot .sep { opacity: .5; }

/* Mobilné menu tlačidlo (skryté na desktope) */
.side__close, .menu-toggle { display: none; }

/* =========================================================================
   RESPONZÍVNE
   ========================================================================= */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; width: 280px;
    transform: translateX(-100%); transition: transform var(--t-slow);
    box-shadow: var(--shadow-lg);
  }
  .side.is-open { transform: translateX(0); }
  .side__close {
    display: grid; place-items: center;
    position: absolute; top: 16px; right: 16px;
    width: 34px; height: 34px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer;
  }
  .menu-toggle { display: grid; }
  .scrim {
    position: fixed; inset: 0; background: rgba(16,18,29,.4); z-index: 39;
    opacity: 0; pointer-events: none; transition: opacity var(--t);
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 18px; }
  .content { padding: 8px 18px 32px; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .topbar__title h1 { font-size: 1.25rem; }
}
