/* ============================================================
   Water ID Poolab 2.0 — Dashboard měření vod (Ústecký kraj)
   Světlý moderní design
   ============================================================ */

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e6ebf2;
  --border-strong: #d6deea;

  --ink: #17233b;
  --ink-2: #4b5872;
  --ink-3: #8a94a8;

  --accent: #2a78d6;
  --accent-strong: #1d63ba;
  --accent-soft: #e8f1fc;
  --accent-soft-2: #d5e6fa;

  /* kvalita vody */
  --q-excellent: #0ca30c;
  --q-good: #7cb518;
  --q-avg: #fab219;
  --q-bad: #ec835a;
  --q-critical: #d03b3b;

  /* série grafu (validovaná paleta) */
  --series-1: #2a78d6;  /* pH */
  --series-2: #eb6834;  /* teplota */
  --series-3: #1baf7a;  /* vodivost */
  --series-4: #eda100;  /* kyslík */

  --status-ok: #0ca30c;
  --status-warn: #b97f00;
  --status-err: #d03b3b;
  --ok-soft: #e7f6e7;
  --warn-soft: #fdf3dc;
  --err-soft: #fbe7e7;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 35, 59, .04), 0 8px 24px rgba(23, 35, 59, .06);
  --shadow-pop: 0 12px 40px rgba(23, 35, 59, .16);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- Layout ---------- */

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 18px;
}

.brand .mascot {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: none;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: -3px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}

.nav-item svg { width: 19px; height: 19px; flex: none; }

.nav-item:hover { background: var(--surface-2); color: var(--ink); }

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sidebar-mascot {
  margin-top: auto;
  text-align: center;
  padding: 18px 10px 6px;
}

.sidebar-mascot .mascot {
  width: 150px;
  height: 150px;
  margin: 0 auto 10px;
  border-radius: 20px;
}

.sidebar-mascot h4 {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 800;
}

.sidebar-mascot p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.sidebar-version {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  padding-top: 12px;
}

/* ---------- Hlavní část ---------- */

.main { padding: 22px 28px 40px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.topbar .subtitle { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.region-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }

.user-chip { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
}

.user-chip .name { font-size: 13.5px; font-weight: 700; }
.user-chip .role { font-size: 12px; color: var(--ink-3); margin-top: -2px; }

/* ---------- Pohledy ---------- */

.view { display: none; }
.view.active { display: block; }

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1180px) {
  .grid-main { grid-template-columns: 1fr; }
}

.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- Karty ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.01em;
}

.card-sub { color: var(--ink-2); font-size: 13px; margin: 2px 0 0; }

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head .spacer { margin-left: auto; }

/* ---------- Statistiky ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat .label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat .value small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.stat .trend { font-size: 12px; color: var(--status-ok); font-weight: 600; margin-top: 2px; }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
}
.stat-icon.blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--ok-soft); color: var(--status-ok); }
.stat-icon.purple { background: #f0ebfc; color: #7856d6; }
.stat-icon.cyan { background: #e2f5f8; color: #0d8ca3; }

/* ---------- Mapa ---------- */

.map-card { padding: 10px; }

#map-overview { height: 380px; border-radius: 12px; }
#map-full { height: calc(100vh - 220px); min-height: 480px; border-radius: 12px; }
#map-picker { height: 240px; border-radius: 10px; border: 1px solid var(--border); }

.leaflet-container { font-family: var(--font); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 12px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.map-legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.marker-pin {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(23,35,59,.3);
}
.marker-pin > span { transform: rotate(45deg); }

.leaflet-popup-content { font-family: var(--font); margin: 12px 14px; }
.popup-title { font-weight: 800; font-size: 14px; }
.popup-sub { color: var(--ink-3); font-size: 12px; margin-bottom: 6px; }
.popup-score { font-weight: 700; font-size: 12.5px; }

/* ---------- Poslední měření ---------- */

.latest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 900px) { .latest-grid { grid-template-columns: repeat(2, 1fr); } }

.value-tile {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
}

.value-tile .p-name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.value-tile .p-value { font-size: 19px; font-weight: 800; margin: 1px 0; }
.value-tile .p-value small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.value-tile .p-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge.ok { background: var(--ok-soft); color: var(--status-ok); }
.badge.warn { background: var(--warn-soft); color: var(--status-warn); }
.badge.err { background: var(--err-soft); color: var(--status-err); }
.badge.neutral { background: var(--accent-soft); color: var(--accent-strong); }

.latest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.latest-meta b { color: var(--ink); }

/* ---------- Graf ---------- */

.chart-wrap { position: relative; height: 280px; }

/* canvas nesmí určovat šířku layoutu (jinak brání zmenšení na mobilu) */
.chart-wrap canvas {
  position: absolute;
  inset: 0;
  max-width: 100%;
}

/* ---------- Tabulky ---------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }

.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}

/* ---------- Tlačítka ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }

.btn.soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn.soft:hover { background: var(--accent-soft-2); }

.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
}
.btn.ghost:hover { background: var(--surface-2); }

.btn.danger { background: var(--err-soft); color: var(--status-err); }

.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Formuláře ---------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }

@media (max-width: 760px) {
  .form-grid, .form-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ---------- AI analýza ---------- */

.ai-panel .verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  margin: 6px 0 10px;
}

.ai-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  margin: 14px 0 6px;
}

.ai-panel p.summary { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.ai-panel p.summary b { color: var(--ink); }

.ai-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }

.ai-list li {
  display: flex;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  align-items: flex-start;
}

.ai-list li::before {
  content: "";
  flex: none;
  width: 16px; height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>') center / 12px no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>') center / 12px no-repeat;
}

.ai-list.findings li::before { color: var(--status-warn); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round"><path d="M12 8v5"/><circle cx="12" cy="16.5" r=".5" fill="black"/></svg>'); mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round"><path d="M12 8v5"/><circle cx="12" cy="16.5" r=".5" fill="black"/></svg>'); }
.ai-list.findings li { color: var(--ink-2); }
.ai-list.recs li::before { color: var(--status-ok); }

.ai-footer {
  margin-top: 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--accent-strong);
}

.ai-footer b { display: block; font-size: 12.5px; }

/* ---------- Prázdné stavy ---------- */

.empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.empty .mascot {
  width: 110px; height: 110px;
  margin: 0 auto 10px;
  border-radius: 16px;
}

/* ---------- Maskot (sprite 4 × 3) ---------- */

.mascot {
  background-image: url("../assets/mascot.png");
  background-size: 400% 300%;
  background-repeat: no-repeat;
  display: inline-block;
}

/* pozice: sloupec c ∈ {0,33.333,66.667,100}%, řádek r ∈ {0,50,100}% */
.m-device    { background-position: 0% 0%; }        /* palec nahoru + přístroj */
.m-flask     { background-position: 33.333% 0%; }   /* baňka */
.m-chill     { background-position: 66.667% 0%; }   /* brýle a drink */
.m-worried   { background-position: 100% 0%; }      /* starosti */
.m-detective { background-position: 0% 50%; }       /* lupa */
.m-love      { background-position: 33.333% 50%; }  /* srdíčka + přístroj */
.m-scientist { background-position: 66.667% 50%; }  /* vědec s checklistem */
.m-cheer     { background-position: 100% 50%; }     /* radost */
.m-diver     { background-position: 0% 100%; }      /* potápěč */
.m-phone     { background-position: 33.333% 100%; } /* telefon */
.m-thinking  { background-position: 66.667% 100%; } /* přemýšlí */
.m-sparkle   { background-position: 100% 100%; }    /* jiskřičky */

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 35, 59, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 1000;
  overflow-y: auto;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 720px;
  padding: 24px 26px;
}

.modal h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.modal .modal-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

.login-backdrop {
  background: linear-gradient(160deg, #dcebfb 0%, #f3f6fb 60%, #e8f1fc 100%);
  align-items: center;
}

.login-modal {
  max-width: 380px;
  text-align: center;
}

.login-modal .login-mascot {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.login-modal h2 { color: var(--accent); }
.login-modal .field { text-align: left; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin: 14px 0 16px;
}

.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}

.auth-tab.active { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow); }

.auth-error { color: var(--status-err) !important; display: none; margin: -4px 0 10px; text-align: left; }

.btn-logout {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 0 0;
  text-align: left;
}
.btn-logout:hover { color: var(--status-err); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 2000;
  max-width: 380px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--q-critical); }

/* ---------- Univerzita / export ---------- */

.export-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.uni-report { font-size: 13.5px; color: var(--ink-2); }
.uni-report h3 { font-size: 15px; margin: 14px 0 6px; color: var(--ink); }

/* ---------- Nastavení ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }

code.inline {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
  word-break: break-all;
}

/* ---------- Responzivita (tablety a telefony) ---------- */

.menu-btn { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  html, body { max-width: 100vw; overflow-x: hidden; }

  .app { grid-template-columns: 1fr; }

  #chart-params { flex-wrap: wrap; }

  /* sidebar jako vysouvací šuplík */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 268px;
    height: 100vh;
    height: 100dvh;
    z-index: 1500;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(23, 35, 59, .35);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 35, 59, .45);
    z-index: 1450;
  }
  body.sidebar-open .sidebar-backdrop { display: block; }

  .sidebar-mascot .mascot { width: 110px; height: 110px; }

  .menu-btn { display: grid; flex: none; }

  .main { padding: 14px 14px 40px; }

  .topbar { flex-wrap: wrap; gap: 10px 12px; margin-bottom: 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar .subtitle { font-size: 12px; }
  .topbar-right { gap: 8px; }
  .region-pill { display: none; }
  .user-chip .role { display: none; }

  .grid-main { grid-template-columns: 1fr; gap: 14px; }
  .col { gap: 14px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat { padding: 13px 14px; }
  .stat .value { font-size: 22px; }
  .stat-icon { width: 36px; height: 36px; }

  .card { padding: 14px; border-radius: 14px; }
  .card-head { flex-wrap: wrap; }

  #map-overview { height: 300px; }
  #map-full { height: calc(100vh - 230px); min-height: 380px; }
  .map-legend { font-size: 11.5px; gap: 4px 12px; }

  .latest-grid { grid-template-columns: 1fr 1fr; }
  .latest-meta { gap: 4px 14px; font-size: 12px; }

  .chart-wrap { height: 230px; }

  .form-grid, .form-grid-4 { grid-template-columns: 1fr 1fr; }

  .modal-backdrop { padding: 14px 8px; }
  .modal { padding: 18px 16px; border-radius: 14px; }

  .settings-grid { grid-template-columns: 1fr; gap: 14px; }

  table.data { font-size: 12.5px; }
  table.data td, table.data th { padding: 7px 8px; }
}

@media (max-width: 480px) {
  .topbar-right { width: 100%; justify-content: space-between; margin-left: 0; }
  .user-chip .name { font-size: 12.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .latest-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .value-tile .p-value { font-size: 17px; }

  .form-grid { grid-template-columns: 1fr; }

  .export-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .export-row .btn { padding: 9px 6px; font-size: 12.5px; }

  #map-overview { height: 250px; }
  #map-picker { height: 200px; }

  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ---------- Tisk (PDF export) ---------- */

@media print {
  .sidebar, .topbar, .no-print, .toast, .modal-backdrop { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .view { display: none !important; }
  #view-univerzita { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
