/* ────────────────────────────────────────────────────────────────────────────
   app.css — postavitev in gradniki aplikacije.
   Skupni oblikovni sistem je v brand.css; tu je le to, kar rabi aplikacija.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Lupina ──────────────────────────────────────────────────────────────────
   Spodnja navigacija je IN-FLOW otrok flex stolpca, ne position:fixed —
   fixed + dvh na iOS WebKit pusti pod navigacijo lebdeč mrtev prostor. */
.shell { display: flex; height: var(--vvh, 100dvh); overflow: hidden; }
.main-col { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.main {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px max(18px, var(--safe-right)) 30px max(18px, var(--safe-left));
}
.main > .inner { max-width: 1220px; margin: 0 auto; }

/* ── Stranska navigacija (namizje) ───────────────────────────────────────── */
.sidebar {
  width: 244px; flex: none; background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  padding: max(20px, var(--safe-top)) 12px max(14px, var(--safe-bottom)) max(12px, var(--safe-left));
}
.sidebar .logo-card {
  background: #fff; border-radius: 12px; padding: 12px 14px; margin: 0 6px 20px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .logo-card img { width: 100%; max-width: 150px; height: auto; display: block; }
.navlist { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; overflow-y: auto; }
.nav-lbl {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--sidebar-ink2); padding: 16px 12px 6px; font-weight: 700;
}
.navlist button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--sidebar-ink); font: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer; text-align: left; transition: background .13s, color .13s;
}
.navlist button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.navlist button.on {
  background: linear-gradient(90deg, var(--blue), #1aa7e8); color: #fff;
  box-shadow: 0 4px 12px rgba(0, 153, 222, .32);
}
.navlist button svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.navlist button.on svg { opacity: 1; }
.navlist .badge { margin-left: auto; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; margin-top: 10px; }
.side-user { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; min-width: 0; }
.av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.side-user .nm { font-size: 14px; color: #fff; font-weight: 600; line-height: 1.2; }
.side-user .rl { font-size: 12px; color: var(--sidebar-ink2); }
.sidebar .btn.ghost { --btn-line: rgba(255, 255, 255, .16); --btn-ink: var(--sidebar-ink); }
.sidebar .btn.ghost:hover { --btn-ink: #fff; }

/* ── Zgornja vrstica ─────────────────────────────────────────────────────── */
.topbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: max(12px, var(--safe-top)) max(18px, var(--safe-right)) 12px max(18px, var(--safe-left));
  border-bottom: 1px solid var(--line); background: var(--bg2);
}
/* Naslov se ne sme lomiti v več vrstic — vrstica bi rasla in na telefonu
   požrla vidni del vsebine. */
.topbar h1, .topbar .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12.5px; color: var(--mut); margin-top: 1px; }
.topbar .mlogo { height: 24px; display: none; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; }

/* ── Trak "brez povezave" ────────────────────────────────────────────────────
   In-flow otrok stolpca (ne fixed), da ne prekrije vsebine in da se glavno
   območje samo skrajša. */
.offbar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 9px max(18px, var(--safe-right)) 9px max(18px, var(--safe-left));
  background: var(--warn-soft); color: var(--warn);
  font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.offbar svg { width: 16px; height: 16px; flex: none; }

/* ── Spodnja navigacija (mobilno) ────────────────────────────────────────── */
.bottomnav {
  display: none; flex: none;
  border-top: 1px solid var(--line); background: var(--bg2);
  padding-bottom: max(6px, var(--safe-bottom));
  padding-left: max(0px, var(--safe-left)); padding-right: max(0px, var(--safe-right));
}
.bottomnav button {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 4px; border: 0; background: transparent;
  color: var(--mut); font: inherit; font-size: 10.5px; font-weight: 700;
  cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent;
}
.bottomnav button svg { width: 21px; height: 21px; }
.bottomnav button.on { color: var(--brand); }
.bottomnav .badge { position: absolute; top: 4px; left: 50%; margin-left: 4px; }

@media (max-width: 960px) {
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .topbar .mlogo { display: block; }
  .main { padding-top: 14px; }
}

/* ── Statistične kartice ─────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, transform .08s;
}
.stat:hover { border-color: var(--brand); }
.stat:active { transform: translateY(1px); }
.stat .ico {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat .ico svg { width: 20px; height: 20px; }
.stat .n { font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; font-size: 30px; font-weight: 700; line-height: 1; }
.stat .k { font-size: 13px; color: var(--mut); font-weight: 500; margin-top: 5px; }
.bg-blue { background: var(--brand-soft); color: var(--brand); }
.bg-green { background: var(--ok-soft); color: var(--ok); }
.bg-yellow { background: var(--warn-soft); color: var(--warn); }
.bg-red { background: var(--bad-soft); color: var(--bad); }

.section { margin-top: 22px; }
.section > h2 { font-size: 15.5px; color: var(--ink2); margin-bottom: 10px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; font-size: 15.5px; color: var(--ink2); }

/* ── Vrstica termina ─────────────────────────────────────────────────────── */
.slot-row { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.slot-row:last-child { border-bottom: 0; }
.slot-row .tm {
  font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; font-weight: 700;
  font-size: 16px; width: 46px; flex: none;
}
.slot-row .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--brand); flex: none; }
.slot-row .bar.g { background: var(--green); }
.slot-row .bar.y { background: var(--yellow); }
.slot-row .bar.r { background: var(--bad); }

/* ── Kartoteka ───────────────────────────────────────────────────────────── */
.cl-head {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.cl-av {
  width: 66px; height: 66px; border-radius: 18px; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 25px;
  font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif;
}
.cl-meta { min-width: 0; flex: 1 1 220px; }
.cl-meta h2 { font-size: 22px; margin: 0 0 3px; }
.cl-sub { color: var(--mut); font-size: 13.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.cl-sub b { color: var(--ink2); font-weight: 600; }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .cl-grid { grid-template-columns: minmax(0, 1fr); } }   /* 1fr = minmax(auto,…) bi se razširil po vsebini */

.tl { position: relative; padding-left: 20px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand); border: 2px solid var(--card);
}
.tl-item.ok::before { background: var(--ok); }
.tl-item.bad::before { background: var(--bad); }
.tl-item .when { font-size: 12px; color: var(--mut); font-weight: 600; }

/* ── Stolpčni graf ───────────────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; }
.bars .b { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 5px; }
.bars .b i {
  display: block; width: 100%; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), #4fc0f0); min-height: 3px;
}
.bars .b.alt i { background: linear-gradient(180deg, var(--green), #8ce4a8); }
.bars .b span { font-size: 10.5px; color: var(--mut); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .b em { font-size: 11.5px; font-weight: 700; font-style: normal; text-align: center; }

.hbar { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.hbar .l { width: 132px; flex: none; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .t { flex: 1 1 auto; height: 10px; border-radius: 5px; background: var(--card2); overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue), var(--green)); }
.hbar .v { width: 74px; flex: none; text-align: right; font-size: 12.5px; color: var(--mut); font-weight: 600; }
@media (max-width: 560px) { .hbar .l { width: 96px; font-size: 12.5px; } .hbar .v { width: 62px; } }

/* ── Sestavljalnik programa ──────────────────────────────────────────────── */
.day-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.day-card + .day-card { margin-top: 12px; }
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.day-head input { font-weight: 700; font-size: 16px; min-height: 38px; }
.ex-row {
  display: grid; grid-template-columns: minmax(0, 2.1fr) 62px 84px 84px 76px 40px;
  gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line);
}
.ex-row:last-of-type { border-bottom: 0; }
.ex-row .nm { font-weight: 600; font-size: 14px; min-width: 0; }
.ex-row .nm small { display: block; color: var(--mut); font-weight: 500; font-size: 11.5px; }
/* 16px je spodnja meja: pri manjši pisavi iOS ob fokusu pozoomira stran. */
.ex-row input { min-height: 36px; font-size: 16px; padding: 6px 6px; text-align: center; }
.ex-head {
  display: grid; grid-template-columns: minmax(0, 2.1fr) 62px 84px 84px 76px 40px; gap: 8px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--line2);
}
.ex-head span:not(:first-child), .ex-row input { text-align: center; }

/* Na namizju je vsako polje svoja celica mreže (oznaka je v glavi tabele),
   zato je ovojni <label> prosojen. Pravili morata stati PRED medijsko poizvedbo,
   sicer bi jo pri enaki specifičnosti povozili in mobilne oznake ne bi bile
   nikoli vidne. */
label.mini { display: contents; }
label.mini > b { display: none; }

@media (max-width: 760px) {
  .ex-head { display: none; }
  .ex-row { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 0; }
  .ex-row .nm { grid-column: 1 / -1; }
  .ex-row [data-delitem] { grid-column: 1 / -1; justify-self: end; }
  /* Glave tabele ni več → vsako polje potrebuje svojo oznako. */
  .ex-row label.mini { display: flex; align-items: center; gap: 8px; }
  .ex-row label.mini > b {
    display: block; flex: none; width: 72px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--mut); font-weight: 700;
  }
  .ex-row label.mini input { text-align: left; }
}

/* ── Izvedba treninga ────────────────────────────────────────────────────── */
.wo-ex { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.wo-ex h3 { margin: 0 0 2px; font-size: 16px; }
.wo-ex .meta { font-size: 12.5px; color: var(--mut); margin-bottom: 10px; }
.set-row {
  display: grid; grid-template-columns: 34px 1fr 1fr 66px 46px; gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row .no {
  font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; font-weight: 700; font-size: 15px;
  color: var(--mut); text-align: center;
}
.set-row input { min-height: 40px; text-align: center; font-size: 16px; padding: 6px 4px; }
.set-row.done input { background: var(--ok-soft); border-color: transparent; }
.chk {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line2);
  background: var(--card2); color: var(--mut); cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.chk svg { width: 20px; height: 20px; }
.chk.on { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.set-hint { font-size: 10.5px; color: var(--mut); text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* Odštevalnik počitka — lebdeč nad vsebino, da ostane viden med drsenjem. */
.timer {
  position: sticky; bottom: 8px; z-index: 20; margin-top: 12px;
  background: var(--navy); color: #fff; border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 30px rgba(10, 14, 24, .35);
}
.timer .t {
  font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; font-size: 32px; font-weight: 700;
  line-height: 1; min-width: 74px; font-variant-numeric: tabular-nums;
}
.timer .lbl2 { font-size: 12px; opacity: .7; }
.timer .btn { --btn-bg: rgba(255, 255, 255, .14); --btn-ink: #fff; --btn-line: rgba(255, 255, 255, .2); }

.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale button {
  flex: 1 1 0; min-width: 38px; min-height: 42px; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--card2); color: var(--ink2);
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}
.scale button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── Protokoli ───────────────────────────────────────────────────────────── */
.phase { border-left: 3px solid var(--brand); padding: 2px 0 2px 14px; margin-bottom: 16px; }
.phase h4 { margin: 0 0 2px; font-size: 15px; }
.phase .t { font-size: 12px; color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bullets { margin: 6px 0 0; padding-left: 18px; }
.bullets li { margin-bottom: 4px; font-size: 13.5px; color: var(--ink2); }
.refs { font-size: 12.5px; word-break: break-all; }
.refs a { display: block; margin-bottom: 3px; }
/* Literatura in slike tehnik (baza znanja) */
.lit-row { padding: 10px 0; border-top: 1px solid var(--line); }
.lit-row:first-child { border-top: 0; padding-top: 0; }
.lit-row summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.lit-row summary::-webkit-details-marker { display: none; }
.lit-row[open] summary .lit-t { color: var(--brand); }
.lit-t { font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--ink); }
a.lit-t:hover { color: var(--brand); }
.lit-snip { font-size: 12.5px; color: var(--ink2); margin-top: 4px; }
.lit-snip mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.lit-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.lit-img { padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; aspect-ratio: 1; overflow: hidden; cursor: zoom-in; }
.lit-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lit-view .modal-body { display: flex; justify-content: center; background: #fff; }
.lit-view .modal-body img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.lit-view h2 { font-size: 15px; }

/* ── Iskalnik vaj v modalu ───────────────────────────────────────────────── */
.picker { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.pick {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card2); cursor: pointer;
}
.pick:hover { border-color: var(--brand); }
.pick .nm { font-weight: 600; font-size: 14px; }
.pick .ms { font-size: 12px; color: var(--mut); }

.avatar-sm {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════════════════
   Dopolnitve po naročnikovem konceptu: klinični pregled, list za vadbo,
   shranjeni programi, AI asistent, meni "Več".
   ══════════════════════════════════════════════════════════════════════════ */
.warn-t { color: var(--warn); }

/* Hitra dejanja na domači strani */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px;
  box-shadow: var(--shadow); font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, transform .06s;
}
.quick button:hover { border-color: var(--brand); }
.quick button:active { transform: translateY(1px); }
.quick button svg { width: 22px; height: 22px; color: var(--brand); margin-bottom: 6px; }
.quick button b { font-size: 15px; }
.quick button span { font-size: 12.5px; color: var(--mut); }
@media (max-width: 900px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ico-sm { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; }
.ico-sm svg { width: 17px; height: 17px; }
.item.tight { padding: 9px 12px; gap: 10px; }

/* Datumska ploščica v seznamu pregledov */
.date-tile {
  width: 46px; flex: none; text-align: center; border-radius: 10px; padding: 5px 0;
  background: var(--brand-soft); color: var(--brand); line-height: 1.1;
}
.date-tile b { display: block; font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; font-size: 20px; }
.date-tile span { font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* Urejevalnik izvida: domače vaje */
.hx-head, .hx-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 70px 96px 110px 40px; gap: 8px; align-items: center;
}
.hx-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--line2);
}
.hx-row { padding: 7px 0; border-bottom: 1px solid var(--line); }
.hx-row:last-child { border-bottom: 0; }
.hx-row .nm { font-weight: 600; font-size: 14px; min-width: 0; }
.hx-row .nm small { display: block; color: var(--mut); font-weight: 500; font-size: 11.5px; }
.hx-row input, .px-row input, .wk-row input { min-height: 36px; font-size: 16px; padding: 6px 8px; }
.card.internal { border-style: dashed; border-color: var(--line2); background: var(--card2); }
.card.internal textarea { background: var(--card); }

/* Spodnja vrstica dejanj urejevalnika — ostane vidna med drsenjem dolgega obrazca. */
.sticky-actions {
  position: sticky; bottom: 8px; z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r);
  box-shadow: 0 10px 28px rgba(18, 18, 35, .14);
}

/* Sestavljalnik programa (list za vadbo) */
.day-card.warm { border-left: 4px solid var(--yellow); }
.px-head, .px-row {
  display: grid;
  grid-template-columns: 26px 58px minmax(0, 1.5fr) minmax(0, 1.3fr) 64px 84px 84px 74px 36px;
  gap: 7px; align-items: center;
}
.px-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--line2);
}
.px-head span:nth-child(n+5) { text-align: center; }
.px-row { padding: 6px 0; border-bottom: 1px solid var(--line); background: var(--card); }
.px-row:last-child { border-bottom: 0; }
.px-row .nm { font-weight: 600; font-size: 14px; min-width: 0; }
.px-row .nm small { display: block; color: var(--mut); font-weight: 500; font-size: 11.5px; }
.px-row [data-f=sets], .px-row [data-f=reps], .px-row [data-f=load], .px-row [data-f=rest], .px-row [data-f=superset] { text-align: center; }
.grip {
  width: 26px; height: 36px; border: 0; background: transparent; color: var(--mut); cursor: grab;
  display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 6px;
  touch-action: none;               /* sicer telefon ob vlečenju drsi stran */
}
.grip:hover { background: var(--card2); color: var(--ink); }
.grip svg { width: 16px; height: 16px; }
.px-row.dragging { opacity: .85; box-shadow: 0 8px 24px rgba(10, 14, 24, .18); border-radius: 10px; position: relative; z-index: 2; }
.px-row.dragging .grip { cursor: grabbing; }

.wk-panel { margin-top: 12px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.wk-panel summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.wk-panel summary::-webkit-details-marker { display: none; }
.wk-panel summary svg { width: 17px; height: 17px; color: var(--brand); }
.wk-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 90px 110px 120px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.wk-row:last-child { border-bottom: 0; }
.wk-row .nm { font-weight: 600; font-size: 13.5px; }
.wk-row input { text-align: center; }

.term-row { display: grid; grid-template-columns: minmax(0, 200px) 110px 36px; gap: 8px; align-items: center; margin-top: 6px; }
.review-box {
  align-self: end; min-height: 42px; border-radius: var(--r-sm); padding: 8px 12px;
  background: var(--brand-soft); color: var(--ink);
}
.review-box .lbl { margin-bottom: 1px; color: var(--brand); }

/* Spustni meni (PDF oblike) */
.dd { position: relative; }
.dd-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px;
  background: var(--card); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 14px 34px rgba(10, 14, 24, .2); padding: 6px;
}
.dd.open .dd-menu { display: block; }
.dd-menu a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: 14px; }
.dd-menu a:hover { background: var(--card2); }
.dd-menu a small { display: block; font-weight: 500; color: var(--mut); font-size: 12px; }

/* Pogled programa za vadečega */
.ro-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ro-row:last-child { border-bottom: 0; }
.ro-row .nm { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.ro-row .nm small { display: block; color: var(--mut); font-weight: 500; font-size: 12.5px; }
.ro-dose { flex: none; text-align: right; font-size: 14px; }
.ro-dose small { margin-left: 6px; }
.sk-tag {
  display: inline-block; min-width: 30px; margin-right: 8px; padding: 1px 6px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; text-align: center;
}

/* Shranjeni programi */
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--card); color: var(--ink2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.fchip svg { width: 14px; height: 14px; }
.fchip span { background: var(--card2); border-radius: 999px; padding: 0 7px; font-size: 11.5px; color: var(--mut); }
.fchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fchip.on span { background: rgba(255, 255, 255, .22); color: #fff; }
.fchip.ghost { border-style: dashed; color: var(--mut); }
.prog-dates { display: flex; gap: 18px; flex: none; font-size: 13.5px; font-weight: 600; }
.prog-dates .lbl { margin-bottom: 0; font-size: 10.5px; }
.prog-dates small { display: block; font-size: 11.5px; font-weight: 500; color: var(--mut); }
.prog-dates .bad-t small, .prog-dates .warn-t small { color: inherit; }
.prog-acts { flex: none; }

/* Seznam strank — strnjene vrstice (en stolpec na podatek), telefon: kartica v dveh vrsticah */
.cs-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cs-row {
  display: grid; align-items: center; gap: 12px; padding: 7px 10px 7px 14px; min-height: 46px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.7fr) minmax(0, 1fr) 84px 84px 76px;
  border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; transition: background .12s;
}
.cs-row:first-child { border-top: 0; }
.cs-row:not(.cs-head):hover { background: var(--card2); }
.cs-head { min-height: 0; padding-block: 9px; cursor: default; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); background: var(--card2); }
.cs-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cs-name b { font-weight: 600; min-width: 0; }
.cs-name .chip { flex: none; }
.cs-diag { font-size: 13.5px; }
.cs-ther { font-size: 13.5px; color: var(--ink2); }
.cs-d { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-d .lbl { display: none; }
.cs-acts { display: flex; justify-content: flex-end; gap: 2px; }
@media (max-width: 1100px) {
  .cs-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 84px 84px 76px; }
  .cs-diag, .cs-head > :nth-child(2) { display: none; }
}
@media (max-width: 760px) {
  .cs-head { display: none; }
  .cs-row { grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 3px 12px; padding: 9px 4px 9px 12px; }
  .cs-row:nth-child(2) { border-top: 0; }
  .cs-name { grid-column: 1 / 4; flex-wrap: wrap; }
  .cs-acts { grid-column: 4; grid-row: 1 / 3; }
  .cs-ther { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--mut); }
  .cs-d { grid-row: 2; font-size: 12.5px; font-weight: 500; color: var(--mut); white-space: nowrap; }
  .cs-d .lbl { display: inline; font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-right: 3px; }
}

/* Meni "Več" na telefonu */
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-list .nav-lbl { color: var(--mut); padding: 12px 4px 4px; }
.more-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card2); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-align: left;
}
.more-list button span { flex: 1 1 auto; }
.more-list button svg { width: 19px; height: 19px; flex: none; color: var(--mut); }
.more-list button.on { border-color: var(--brand); color: var(--brand); }

/* ── Telefon: urejevalne vrstice → zložene kartice (brez horizontalnega odreza) ── */
@media (max-width: 760px) {
  .hx-head, .px-head { display: none; }
  .hx-row, .px-row, .wk-row { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 0; }
  .hx-row .nm, .px-row .nm, .wk-row .nm { grid-column: 1 / -1; }
  /* Roček za vlečenje ostane levo, polja v dveh stolpcih desno od njega. */
  .px-row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); }
  .px-row .grip { grid-row: 1; grid-column: 1; }
  .px-row .nm { grid-column: 2 / -1; grid-row: 1; }
  .px-row label.mini:nth-of-type(1), .px-row label.mini:nth-of-type(2) { grid-column: 2 / -1; }
  .px-row label.mini:nth-of-type(3), .px-row label.mini:nth-of-type(5) { grid-column: 2; }
  .px-row label.mini:nth-of-type(4), .px-row label.mini:nth-of-type(6) { grid-column: 3; }
  .px-row [data-delitem] { grid-column: 3; justify-self: end; }
  .hx-row [data-delhx] { grid-column: 1 / -1; justify-self: end; }
  .hx-row label.mini, .px-row label.mini, .wk-row label.mini { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .hx-row label.mini > b, .px-row label.mini > b, .wk-row label.mini > b {
    display: block; flex: none; width: 66px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--mut); font-weight: 700;
  }
  .hx-row label.mini input, .px-row label.mini input, .wk-row label.mini input { text-align: left; min-width: 0; }
  .hx-row .nm label.mini { width: 100%; }
  .wk-row { grid-template-columns: 1fr; }
  .term-row { grid-template-columns: minmax(0, 1fr) 96px 36px; }
  .prog-row { flex-wrap: wrap; }
  .prog-row > .grow { flex-basis: 100%; }
  .prog-dates { flex: 1 1 auto; }
  .sticky-actions { flex-wrap: nowrap; bottom: 6px; padding: 8px; }
  .sticky-actions .btn { flex: 1 1 auto; padding: 0 10px; }
  .sticky-actions .btn.plain { flex: 0 0 auto; }
  .hide-sm { display: none !important; }
  .day-head { flex-wrap: wrap; }
  .day-head input[data-dlabel] { flex-basis: 100%; }
}
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
/* Listanje slik: puščici ostaneta levo/desno tudi na telefonu (privzeta noga modala se tam zloži v stolpec). */
.lit-view .modal-foot { flex-direction: row; align-items: center; }
.lit-view .modal-foot .btn { width: auto; min-width: 64px; }

/* Prejšnji programi stranke (v sestavljalniku) */
.hist > summary { cursor: pointer; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; list-style: none; flex-wrap: wrap; }
.hist > summary::-webkit-details-marker { display: none; }
.hist > summary svg { width: 18px; height: 18px; color: var(--brand); }
.hist-prog { border-top: 1px solid var(--line); }
.hist-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 2px; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.hist-head .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hist-head svg { width: 16px; height: 16px; color: var(--mut); transition: transform .15s; flex: none; }
.hist-prog.open .hist-head svg { transform: rotate(90deg); }
.hist-prog [data-hpbody] { padding: 0 2px 12px; }
.hist-day { margin-top: 12px; }
.hist-tbl td, .hist-tbl th { white-space: nowrap; font-size: 13px; }
.hist-tbl td.c, .hist-tbl th:not(:nth-child(2)):not(:nth-child(3)) { text-align: center; }
.hist-tbl td:nth-child(3) { white-space: normal; min-width: 120px; }
.chip.tag { border: 0; cursor: pointer; font: inherit; font-size: 12px; background: var(--brand-soft); color: var(--brand); }
.chip.tag:hover { filter: brightness(.95); }
#tagSugg { align-items: center; }

/* ── Zdravstveni vprašalnik v kartoteki (predlog #391) ───────────────────── */
.q-warn { border-radius: var(--r-sm); padding: 12px 14px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.q-warn.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.q-warn > b { display: flex; align-items: center; gap: 6px; }
.q-warn ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink); }
.q-warn li { margin-bottom: 3px; }
.qa-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.qa-row .n { flex: none; min-width: 28px; color: var(--brand); font-weight: 700; }
.qa-row.da { background: var(--warn-soft); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.qa-val { max-width: 45%; text-align: right; font-weight: 600; }
.q-sig { width: 220px; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--line2); border-radius: 8px; }
.q-all > summary { list-style: none; display: inline-flex; }
.q-all > summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .qa-row.izb { flex-wrap: wrap; }
  .qa-row.izb .grow { flex: 1 1 0; }
  .qa-row.izb .qa-val { max-width: none; flex-basis: 100%; text-align: left; padding-left: 38px; }
}

/* ── Analitika (predlog #265) ─────────────────────────────────────────────── */
.an-filters { display: flex; flex-direction: column; gap: 10px; }
.an-types button small { opacity: .65; font-weight: 600; margin-left: 3px; }
.an-kpis { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
.an-kpi { cursor: default; text-align: left; }
.an-kpi:hover { border-color: var(--line); }
.an-kpi:active { transform: none; }
.an-kpi .n { font-size: 26px; }
.an-sub { font-size: 12px; color: var(--mut); margin-top: 3px; }
.an-note { display: flex; gap: 10px; align-items: flex-start; border-color: var(--warn); }
.an-note > svg { width: 20px; height: 20px; flex: none; color: var(--warn); margin-top: 2px; }
.an-charts .card { min-width: 0; }
.an-chart { display: grid; grid-template-columns: repeat(var(--cols), minmax(22px, 1fr)); gap: 2px; align-items: end; overflow-x: auto; padding-top: 6px; }
.an-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: default; }
.an-bar-wrap { width: 100%; height: 150px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line2); }
.an-bar { display: block; width: min(70%, 26px); background: var(--brand); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.an-col:hover .an-bar { opacity: .75; }
.an-mo { font-size: 11px; color: var(--mut); text-align: center; line-height: 1.2; }
.an-mo b { font-weight: 600; color: var(--ink2); }
.an-col[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 5px 8px; border-radius: 6px; pointer-events: none; z-index: 2;
}
.an-axis { margin-top: 6px; text-align: right; }
.an-nochart { padding: 40px 0; text-align: center; }
.tbl .r { text-align: right; }
.tbl th.r { text-align: right; }
.an-tbl-types tr.click { cursor: pointer; }
.an-tbl-types tr.click:hover td, .an-tbl-types tr.on td { background: var(--brand-soft); }
.an-tbl-types .an-total td { font-weight: 700; border-top: 1px solid var(--line2); }
.an-tbl th.an-sort { cursor: pointer; }
.an-tbl th.an-sort:hover, .an-tbl th.on { color: var(--brand); }
.an-tbl td .chip { margin-left: 6px; font-size: 11px; }
.an-tbl td { padding-top: 6px; padding-bottom: 6px; }
.an-tbl select.an-type { width: auto; min-width: 150px; min-height: 34px; padding: 4px 30px 4px 10px; font-size: 16px; background-position: right 8px center; }
@media (max-width: 640px) {
  /* Tabela z izbirnim poljem → kartice (vsaka celica s svojo oznako). */
  .an-tbl thead { display: none; }
  .an-tbl, .an-tbl tbody, .an-tbl tr, .an-tbl td { display: block; }
  .an-tbl tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .an-tbl tr:last-child { border-bottom: 0; }
  .an-tbl td { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; border: 0; text-align: right; }
  .an-tbl td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--mut); font-weight: 700; text-align: left; }
  .an-tbl td[data-label="Stranka"] { font-size: 15px; }
  .an-tbl td[data-label="Stranka"]::before { display: none; }
  .an-tbl td[data-label="Stranka"] { justify-content: flex-start; text-align: left; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .an-kpi { padding: 12px; }
  .an-kpi .ico { width: 34px; height: 34px; }
  .an-kpi .n { font-size: 21px; }
  .an-kpi .k { font-size: 12.5px; }
  .an-bar-wrap { height: 120px; }
}
