/* Podno studio — stil kalkulatora, nadograđen na temu sajta wal.hr.
 *
 * Ne uvodi novu paletu ni tipografiju: sve boje idu iz css/colors/scheme-01.css
 * (--primary-color, --secondary-color…), font je Manrope iz css/style.css, a
 * radijusi i sivi tonovi prate --rounded-1 i --bg-grey teme. Svaka klasa ima
 * prefiks `ps-` da se ne sudari sa Bootstrapom i temom.
 *
 * Vrijednosti u var(--x, fallback) su zaštita za slučaj da se stranica otvori
 * bez CSS-a sajta (kada baza nije dostupna).
 */

.ps-app {
  --ps-accent: var(--primary-color, #cf2e2e);
  --ps-accent-soft: rgba(207, 46, 46, .08);
  --ps-info: var(--secondary-color, #2e88cc);
  --ps-info-soft: rgba(46, 136, 204, .08);
  --ps-pick-on: #dfeffc;   /* izabran sistem: nijansu tamnije od pozadine sprata */
  --ps-ink: var(--title-font-color, #0a2540);
  --ps-body: var(--body-font-color, #7b8893);
  --ps-line: rgba(10, 37, 64, .12);
  --ps-line-soft: rgba(10, 37, 64, .07);
  --ps-grey: var(--bg-grey, #F0F1F3);
  --ps-radius: var(--rounded-1, 12px);
  --ps-ok: #96c346;
  --ps-ok-soft: rgba(150, 195, 70, .1);
  --ps-err: #e7505a;
  --ps-err-soft: rgba(231, 80, 90, .1);
  --ps-warn: #b07d00;
  --ps-warn-soft: rgba(231, 176, 0, .12);
  --ps-control-h: 42px;

  font-family: var(--body-font, "Manrope", Helvetica, Arial, sans-serif);
  line-height: 1.55;
  color: var(--ps-body);
}

.ps-app h1, .ps-app h2, .ps-app h3, .ps-app h4 {
  font-family: var(--title-font, "Manrope", Helvetica, Arial, sans-serif);
  color: var(--ps-ink);
  line-height: 1.25;
}
.ps-app h2 { font-size: 24px; margin-bottom: 6px; }
.ps-app h3 { font-size: 18px; margin-bottom: 6px; }
.ps-app h4 { font-size: 16px; margin-bottom: 6px; }
.ps-app p { line-height: 1.6; }

.ps-lead { color: var(--ps-body); font-size: 15px; }

/* ---------- paneli ---------- */

.ps-panel {
  background: #fff;
  border: 1px solid var(--ps-line-soft);
  border-radius: var(--ps-radius);
  box-shadow: 0 2px 6px rgba(10, 37, 64, .04), 0 12px 32px rgba(10, 37, 64, .05);
  padding: 26px;
  margin-bottom: 20px;
}
.ps-panel-head { margin-bottom: 18px; }
.ps-panel-head p { margin: 0; font-size: 14px; }

.ps-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ps-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .ps-grid-2, .ps-grid-3 { grid-template-columns: 1fr; } }

/* ---------- koraci ---------- */

.ps-steps {
  display: flex; flex-wrap: wrap; gap: 10px;
  list-style: none; margin: 0 0 24px; padding: 0;
}
.ps-steps button {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--ps-line); background: #fff; color: var(--ps-body);
  border-radius: 999px; padding: 7px 18px 7px 8px;
  font-family: var(--title-font, inherit); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.ps-steps button:hover { border-color: var(--ps-accent); color: var(--ps-ink); }
.ps-steps button .ps-n {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ps-grey); color: var(--ps-body);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.ps-steps button[aria-current="step"] {
  border-color: var(--ps-accent); background: var(--ps-accent); color: #fff;
}
.ps-steps button[aria-current="step"] .ps-n { background: rgba(255, 255, 255, .25); color: #fff; }
.ps-steps button.ps-done .ps-n { background: var(--ps-ok-soft); color: #6f9a24; }

/* ---------- forme ---------- */

.ps-field { margin-bottom: 16px; }
.ps-field > label,
.ps-label {
  display: inline-block;
  font-family: var(--title-font, inherit);
  color: var(--ps-ink); font-size: 14px; font-weight: 500;
  margin-bottom: 8px;
}
.ps-hint { font-size: 13px; color: var(--ps-body); margin-top: 6px; line-height: 1.5; }
.ps-field-error { font-size: 13px; color: var(--ps-err); margin-top: 6px; font-weight: 600; }

/* Polja koja kalkulator crta iz JavaScripta nemaju bootstrap klase,
   pa se stilizuju po tipu — izgled je isti kao .form-control na sajtu. */
.ps-app .form-control,
.ps-app input[type="text"],
.ps-app input[type="password"],
.ps-app input[type="number"],
.ps-app select,
.ps-app textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ps-ink);
  background-color: #fff;
  height: auto;
}
/* Ista visina za polje i padajući izbor — osnova za poravnanje u redu. */
.ps-app input[type="text"],
.ps-app input[type="password"],
.ps-app input[type="number"],
.ps-app select { height: var(--ps-control-h); }
.ps-app textarea { min-height: 96px; resize: vertical; }

/* Fokus je plav (--secondary-color), da se ne miješa sa crvenom greškom. */
.ps-app input:focus,
.ps-app select:focus,
.ps-app textarea:focus,
.ps-app .form-control:focus {
  outline: none;
  border-color: var(--ps-info);
  box-shadow: 0 0 0 3px var(--ps-info-soft);
}
.ps-app [aria-invalid="true"] { border-color: var(--ps-err); background: var(--ps-err-soft); }
.ps-app [aria-invalid="true"]:focus { border-color: var(--ps-err); box-shadow: 0 0 0 3px var(--ps-err-soft); }
.ps-app input:disabled, .ps-app select:disabled { background: var(--ps-grey); color: var(--ps-body); }
.ps-app input[type="checkbox"], .ps-app input[type="radio"] { display: inline-block; width: auto; height: auto; }
.ps-app button:focus-visible,
.ps-app a:focus-visible,
.ps-app summary:focus-visible {
  outline: 2px solid var(--ps-info);
  outline-offset: 2px;
}

.ps-switch { display: flex; align-items: center; gap: 10px; }
.ps-switch input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ps-accent); margin: 0; }
.ps-switch label { margin: 0 !important; cursor: pointer; }

/* ---------- dugmad ---------- */

.ps-app .btn-main {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; background: var(--ps-accent); color: #fff;
}
/* `hidden` mora pobijediti display iznad (npr. „Dalje” na posljednjem koraku). */
.ps-app [hidden] { display: none !important; }
.ps-app .btn-main:hover { filter: brightness(.92); color: #fff; }
.ps-app .btn-main:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.ps-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--title-font, inherit);
  border: 1px solid var(--ps-line); background: #fff; color: var(--ps-ink);
  border-radius: 8px; padding: 8px 18px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: all .15s ease;
}
.ps-btn:hover { border-color: var(--ps-ink); color: var(--ps-ink); }
.ps-btn:disabled, .ps-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ps-btn-primary { background: var(--ps-accent); border-color: var(--ps-accent); color: #fff; }
.ps-btn-primary:hover { filter: brightness(.92); color: #fff; }
/* Plavo dugme teme (--secondary-color), kao „Zatraži Ponudu” u zaglavlju. */
.ps-btn-blue { background: var(--ps-info); border-color: var(--ps-info); color: #fff; }
.ps-btn-blue:hover { filter: brightness(.92); background: var(--ps-info); border-color: var(--ps-info); color: #fff; }
.ps-btn-ghost { border-color: transparent; background: transparent; color: var(--ps-body); }
.ps-btn-ghost:hover { background: var(--ps-grey); border-color: transparent; }
.ps-btn-danger { color: var(--ps-err); border-color: rgba(231, 80, 90, .35); }
.ps-btn-danger:hover { background: var(--ps-err-soft); border-color: var(--ps-err); color: var(--ps-err); }
.ps-btn-sm { padding: 5px 12px; font-size: 13px; }
.ps-btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- oznake ---------- */

.ps-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--title-font, inherit);
  font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  background: var(--ps-grey); color: var(--ps-body);
  white-space: nowrap;
}
/* Poluprovidna bijela: oznaka radi i na bijeloj i na plavoj kartici. */
.ps-badge.ps-ok { background: rgb(255 255 255 / 42%); color: #3c9a24; }
.ps-badge.ps-err { background: var(--ps-err-soft); color: var(--ps-err); }
.ps-badge.ps-warn { background: var(--ps-warn-soft); color: var(--ps-warn); }

/* ---------- kartice sistema ---------- */

.ps-system-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.ps-system-card {
  display: block; cursor: pointer;
  border: 2px solid var(--ps-line-soft); border-radius: var(--ps-radius);
  padding: 22px; background: #fff; transition: all .15s ease;
}
.ps-system-card:hover { border-color: var(--ps-line); }
.ps-system-card[data-selected="true"] { border-color: var(--ps-info); background: var(--ps-pick-on); }
.ps-system-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ps-system-card input[type="radio"] { accent-color: var(--ps-info); width: 18px; height: 18px; }
.ps-system-card .ps-summary { font-size: 14px; margin: 0; }
.ps-system-card .ps-meta {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ps-line-soft);
  font-size: 13px; color: var(--ps-body);
}
.ps-system-card h3 .ps-badge { margin-left: auto; }
/* Predloženi sistem: jedini koji odgovara, pa nema šta da se klikne. */
.ps-system-card.ps-static { cursor: default; }
/* Izbor bez ijednog sistema (npr. električno dok ne stigne tabela). */
.ps-system-card.ps-disabled { cursor: not-allowed; background: var(--ps-grey); }
.ps-system-card.ps-disabled:hover { border-color: var(--ps-line-soft); }
.ps-system-card.ps-disabled h3,
.ps-system-card.ps-disabled .ps-summary { opacity: .6; }

/* sistemi po grupi prostorija sa istim uslovima */
.ps-system-group { padding: 18px 0; border-top: 1px solid var(--ps-line-soft); }
.ps-system-group:first-of-type { border-top: 0; padding-top: 0; }
.ps-system-group-head { margin-bottom: 12px; }
.ps-system-group-head h3 { margin: 0; }
.ps-system-group-head .ps-hint { margin-top: 2px; }

/* red sistema u tabeli stavki (više sistema u projektu) */
.ps-table tr.ps-group-row td { background: var(--ps-grey); color: var(--ps-ink); padding-top: 9px; padding-bottom: 9px; }

/* dosadašnji izbori iznad ponuđenog sistema; klik vodi na korak izbora */
.ps-criteria { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ps-chip { border: 0; cursor: pointer; transition: all .15s ease; }
.ps-chip:hover { background: var(--ps-info-soft); color: var(--ps-info); }
/* napomene za ugradnju po grupi obloga (dopuna 05) */
.ps-install-title { font-weight: 600; color: var(--ps-ink); margin-bottom: 4px; }
.ps-install-notes { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.ps-install-notes li + li { margin-top: 4px; }
.ps-install-notes strong { color: var(--ps-ink); font-weight: 600; }
.ps-panel > .ps-install-notes { font-size: 14px; }
.ps-more { margin-top: 10px; }
.ps-more summary { cursor: pointer; color: var(--ps-accent); font-size: 13px; font-weight: 600; }

/* ---------- ponuđeni sistemi uz prostorije (korak 1) ---------- */

.ps-picks { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ps-line); }
.ps-picks-title {
  font-family: var(--title-font, inherit); font-size: 15px; font-weight: 600;
  color: var(--ps-ink); margin-bottom: 2px;
}
.ps-picks > .ps-hint { margin-bottom: 10px; }

.ps-pick-group + .ps-pick-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ps-line-soft); }
.ps-pick-head { margin-bottom: 10px; }
.ps-pick-head strong { color: var(--ps-ink); font-family: var(--title-font, inherit); }
.ps-pick-head .ps-hint { display: block; margin-top: 2px; }
.ps-pick-group .ps-note { margin: 0 0 10px; }
.ps-pick-group .ps-field-error { margin-top: 8px; }

/* min() sprječava da kolona bude šira od uskog ekrana (vodoravni scroll). */
.ps-pick-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.ps-pick {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--ps-line-soft); border-radius: var(--ps-radius);
  padding: 12px 12px 12px 14px; background: #fff; cursor: pointer;
  transition: all .15s ease;
}
.ps-pick:hover { border-color: var(--ps-line); }
.ps-pick.ps-static { cursor: default; }
.ps-pick[data-selected="true"] { border-color: var(--ps-info); background: var(--ps-pick-on); }
.ps-pick input[type="radio"] { accent-color: var(--ps-info); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.ps-pick-text { flex: 1 1 auto; min-width: 0; }
.ps-pick-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--title-font, inherit); font-weight: 600; color: var(--ps-ink);
}
.ps-pick-sum { font-size: 13px; line-height: 1.5; margin-top: 3px; }

.ps-info-btn {
  flex: none; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--ps-line); border-radius: 50%;
  background: #fff; color: var(--ps-info);
  font-family: var(--title-font, inherit); font-size: 14px; font-weight: 700; font-style: italic;
  line-height: 1; cursor: pointer; transition: all .15s ease;
}
.ps-info-btn:hover { background: var(--ps-info); border-color: var(--ps-info); color: #fff; }

/* ---------- modal sa detaljima sistema ---------- */

.ps-modal-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(10, 37, 64, .45);
  overflow: auto;
}
.ps-modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: var(--ps-radius);
  box-shadow: 0 18px 60px rgba(10, 37, 64, .3);
  padding: 22px;
}
.ps-modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ps-modal-head h3 { margin: 0; flex: 1 1 auto; }
.ps-modal-close { font-size: 20px; line-height: 1; }
.ps-modal-close:hover { color: var(--ps-ink); background: var(--ps-grey); border-color: var(--ps-line); }
.ps-modal-body > * + * { margin-top: 14px; }
.ps-modal-body .ps-summary { font-size: 14px; margin: 0; }
.ps-modal-rows { border-top: 1px solid var(--ps-line-soft); padding-top: 12px; }
.ps-modal-row { display: flex; gap: 10px; font-size: 14px; padding: 3px 0; }
.ps-modal-row .ps-k {
  flex: none; width: 140px; color: var(--ps-ink);
  font-family: var(--title-font, inherit); font-weight: 600; font-size: 13px;
}
.ps-modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (max-width: 600px) {
  .ps-modal-row { display: block; }
  .ps-modal-row .ps-k { width: auto; display: block; }
  .ps-modal-foot { flex-direction: column-reverse; }
  .ps-modal-foot .ps-btn { width: 100%; justify-content: center; }
}

/* ---------- tabele ---------- */

.ps-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.ps-table th, .ps-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--ps-line-soft); vertical-align: top; }
.ps-table th {
  font-family: var(--title-font, inherit);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ps-body); font-weight: 700; white-space: nowrap;
  border-bottom: 1px solid var(--ps-line);
}
.ps-table td.ps-num, .ps-table th.ps-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-table tbody tr:last-child td { border-bottom: 0; }
.ps-table .form-control { min-width: 96px; }
.ps-table code { font-size: 12px; }

/* Tabela prostorija: ćelije su poravnate po vrhu, pa poruka o grešci ispod
   polja produžava red nadolje umjesto da pomjeri polje. Tekst i ikonice bez
   polja stoje u bloku visine polja, pa ostaju u ravni sa njim. */
.ps-table.ps-rooms td { vertical-align: top; }
.ps-cell-mid { min-height: var(--ps-control-h); display: flex; align-items: center; }
.ps-num > .ps-cell-mid { justify-content: flex-end; }
.ps-table.ps-rooms col.ps-c-name { width: 26%; }
.ps-table.ps-rooms col.ps-c-finish { width: 26%; }
.ps-table.ps-rooms col.ps-c-floor { width: 22%; }
.ps-table.ps-rooms col.ps-c-area { width: 15%; }
.ps-table.ps-rooms col.ps-c-circ { width: 10%; }
.ps-table.ps-rooms col.ps-c-act { width: 12%; }
.ps-table.ps-rooms.ps-with-finish col.ps-c-name { width: 22%; }
.ps-table.ps-rooms.ps-with-finish col.ps-c-area { width: 13%; }
.ps-table.ps-rooms.ps-with-finish col.ps-c-act { width: 6%; }
.ps-table.ps-rooms select { min-width: 150px; }
/* grijanje i ugradnja po prostoriji (dopuna 04): osam kolona */
.ps-table.ps-rooms.ps-with-choice col.ps-c-name { width: 16%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-choice { width: 11%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-insulation { width: 13%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-finish { width: 15%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-area { width: 9%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-circ { width: 7%; }
.ps-table.ps-rooms.ps-with-choice col.ps-c-act { width: 4%; }
.ps-table.ps-rooms.ps-with-choice th, .ps-table.ps-rooms.ps-with-choice td { padding-left: 5px; padding-right: 5px; }
.ps-table.ps-rooms.ps-with-choice select { min-width: 105px; }
.ps-table.ps-rooms .ps-muted { color: var(--ps-body); justify-content: center; }
.ps-table.ps-rooms.ps-with-choice input { min-width: 70px; }

/* grijanje i ugradnja za sve prostorije odjednom */
.ps-bulk { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ps-bulk select { width: auto; min-width: 240px; }
.ps-table.ps-rooms td.ps-circuits {
  font-family: var(--title-font, inherit);
  font-size: 17px; font-weight: 700; color: var(--ps-ink);
}
.ps-table.ps-rooms input { min-width: 80px; }

/* ---------- sprat kao entitet ---------- */

.ps-floor {
  background: #eff8ff;
  border: 1px solid var(--ps-line-soft);
  border-radius: var(--ps-radius);
  padding: 18px;
  margin-bottom: 18px;
}
.ps-floor .ps-table th { border-bottom-color: rgba(10, 37, 64, .14); }
.ps-floor .ps-table td { border-bottom-color: rgba(10, 37, 64, .08); }

.ps-floor-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.ps-floor-name { flex: 0 1 300px; }
.ps-floor-name input {
  font-family: var(--title-font, inherit);
  font-size: 17px; font-weight: 700; color: var(--ps-ink);
}

/* zbir sprata: jedan miran red na dnu sekcije */
.ps-floor-foot {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid rgba(10, 37, 64, .1);
  font-size: 13px; color: var(--ps-body);
}
.ps-floor-stat { white-space: nowrap; }
.ps-floor-stat b {
  color: var(--ps-ink); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ps-room-custom { margin-top: 8px; }

/* ikonica u tabeli (npr. brisanje reda) */
.ps-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ps-body);
  cursor: pointer; transition: all .15s ease;
}
.ps-icon-btn:hover { color: var(--ps-err); background: var(--ps-err-soft); border-color: rgba(231, 80, 90, .35); }
.ps-icon-btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; border-color: transparent; color: var(--ps-body); }
.ps-icon { display: inline-flex; align-items: center; }
.ps-icon svg { display: block; }

@media (max-width: 700px) {
  .ps-floor-name { flex: 1 1 100%; }
  .ps-floor-foot { gap: 12px; }
}

/* katalog: naziv dobija najviše prostora, ostalo uzima koliko treba */
.ps-table.ps-products td { vertical-align: middle; }
.ps-table.ps-products th, .ps-table.ps-products td { padding: 8px 8px; }
.ps-table.ps-products col.ps-c-sku { width: 130px; }
.ps-table.ps-products col.ps-c-pname { width: auto; }
.ps-table.ps-products col.ps-c-price { width: 104px; }
.ps-table.ps-products col.ps-c-unit { width: 88px; }
.ps-table.ps-products col.ps-c-kit { width: 96px; }
.ps-table.ps-products col.ps-c-refs { width: 72px; }
.ps-table.ps-products col.ps-c-act { width: 86px; }
.ps-table.ps-products .ps-c-pname, .ps-table.ps-products td:nth-child(2) input { min-width: 0; }
.ps-table.ps-products td:first-child code { white-space: nowrap; }

.ps-app code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em; background: var(--ps-grey); color: var(--ps-ink);
  padding: 2px 6px; border-radius: 4px;
}

/* ---------- rezultat ---------- */

/* Šest kartica stoji u jednom redu; ukupan iznos dobija širu ćeliju. */
.ps-summary-cards {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) {
  .ps-summary-cards { grid-template-columns: repeat(3, 1fr); }
  .ps-summary-cards .ps-total { grid-column: span 3; }
}
@media (max-width: 620px) {
  .ps-summary-cards { grid-template-columns: repeat(2, 1fr); }
  .ps-summary-cards .ps-total { grid-column: span 2; }
}
.ps-summary-card { border: 1px solid var(--ps-line-soft); border-radius: var(--ps-radius); padding: 16px 18px; background: #fff; }
.ps-summary-card .ps-k {
  font-family: var(--title-font, inherit);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ps-body); font-weight: 700;
}
.ps-summary-card .ps-v {
  font-family: var(--title-font, inherit);
  font-size: 24px; font-weight: 700; color: var(--ps-ink);
  margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2;
  white-space: nowrap;
}
.ps-summary-card.ps-total { background: var(--ps-info); border-color: var(--ps-info); }
.ps-summary-card.ps-total .ps-v { font-size: clamp(19px, 1.7vw, 24px); }
.ps-summary-card.ps-total .ps-k { color: rgba(255, 255, 255, .8); }
.ps-summary-card.ps-total .ps-v { color: #fff; }

.ps-totals { margin-left: auto; max-width: 380px; margin-top: 18px; }
.ps-totals > div { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.ps-totals .ps-grand {
  border-top: 2px solid var(--ps-ink); margin-top: 8px; padding-top: 10px;
  font-family: var(--title-font, inherit);
  font-weight: 700; font-size: 18px; color: var(--ps-ink);
}

.ps-trace {
  background: var(--ps-grey); border-radius: 8px;
  padding: 14px 16px; margin-top: 10px; font-size: 13.5px; line-height: 1.55;
}
.ps-trace ol { margin: 6px 0 0; padding-left: 20px; }
.ps-trace li { margin-bottom: 2px; }
.ps-trace .ps-ctx { font-weight: 700; color: var(--ps-ink); }
.ps-trace-formula { color: var(--ps-body); font-size: 13px; }
.ps-app details > summary { cursor: pointer; color: var(--ps-info); font-size: 13px; font-weight: 600; }

.ps-note {
  border-left: 3px solid var(--ps-line); background: var(--ps-grey);
  padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 16px 0;
  font-size: 14px; line-height: 1.55; color: var(--ps-body);
}
.ps-note.ps-warn { border-color: #e7b000; background: var(--ps-warn-soft); color: #7a5900; }
.ps-note.ps-err { border-color: var(--ps-err); background: var(--ps-err-soft); color: #a5303a; }
.ps-note.ps-ok { border-color: var(--ps-ok); background: var(--ps-ok-soft); color: #547019; }
.ps-note.ps-info { border-color: var(--ps-info); background: var(--ps-info-soft); color: #1f6699; }
.ps-note strong { color: inherit; }
.ps-note ul { margin: 8px 0 0; padding-left: 20px; }

.ps-empty { color: var(--ps-body); padding: 32px; text-align: center; font-size: 14px; }

.ps-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: currentColor;
  border-radius: 50%; animation: ps-spin .7s linear infinite;
}
.ps-btn .ps-spinner { border-color: var(--ps-line); border-top-color: var(--ps-accent); }
@keyframes ps-spin { to { transform: rotate(360deg); } }

.ps-nav-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 24px; }

/* ---------- editor ---------- */

.ps-admin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ps-admin-layout.ps-wide > :first-child { grid-column: span 2; }
@media (max-width: 1280px) {
  .ps-admin-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .ps-admin-layout .ps-preview-col { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .ps-admin-layout { grid-template-columns: 1fr; }
  .ps-admin-layout.ps-wide > :first-child { grid-column: auto; }
}

.ps-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.ps-tabs button {
  border: 1px solid var(--ps-line); background: #fff; color: var(--ps-body);
  border-radius: 8px; padding: 8px 16px;
  font-family: var(--title-font, inherit); font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.ps-tabs button:hover { border-color: var(--ps-ink); }
.ps-tabs button[aria-selected="true"] { background: var(--ps-ink); color: #fff; border-color: var(--ps-ink); }

.ps-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.ps-list li { border-bottom: 1px solid var(--ps-line-soft); }
.ps-list button.ps-item {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 10px 12px; font: inherit; font-size: 14px; cursor: pointer;
  display: flex; gap: 10px; align-items: baseline;
  border-left: 3px solid transparent; color: var(--ps-ink);
}
.ps-list button.ps-item:hover { background: var(--ps-grey); }
.ps-list button.ps-item[aria-current="true"] { background: var(--ps-accent-soft); border-left-color: var(--ps-accent); }
.ps-list .ps-item .ps-lbl { flex: 1 1 auto; }
.ps-list .ps-item .ps-sku { font-size: 11px; color: var(--ps-body); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ps-list .ps-item.ps-off .ps-lbl { color: var(--ps-body); text-decoration: line-through; }

.ps-op-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 620px) { .ps-op-row { grid-template-columns: 1fr; } }

/* U uskoj koloni pregleda tabela se pomjera vodoravno umjesto da lomi SKU. */
.ps-preview-col .ps-table th,
.ps-preview-col .ps-table td { white-space: nowrap; padding: 8px 10px; }
.ps-preview-col .ps-panel { padding: 20px; }

.ps-formula {
  background: var(--ps-grey); border-radius: 8px;
  padding: 14px 16px; font-size: 14px; color: var(--ps-body);
}
.ps-formula b { color: var(--ps-ink); }

.ps-box { border: 1px solid var(--ps-line-soft); border-radius: var(--ps-radius); padding: 16px; margin-bottom: 16px; }

/* proizvodi kompleta u pravilu */
.ps-kits-list {
  max-height: 320px; overflow: auto; margin-top: 8px;
  border: 1px solid var(--ps-line-soft); border-radius: 8px; padding: 6px 10px;
}
.ps-kit-row { padding: 3px 0; }
.ps-kit-row label { font-size: 13px; font-weight: 400 !important; }

/* obloge sistema: grupa kao prekidač cijele grupe, obloge uvučene ispod nje */
.ps-finish-group { margin: 10px 0 4px; }
.ps-finish-group label { font-weight: 700; }
.ps-finish-items { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 28px; }
.ps-finish-items .ps-field { margin-bottom: 4px; }
.ps-finish-items label { font-size: 13px !important; }

.ps-sticky {
  position: sticky; bottom: 0; z-index: 15;
  background: #fff; border-top: 1px solid var(--ps-line);
  padding: 14px 0; margin-top: 8px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}

.ps-login { max-width: 460px; margin: 0 auto; }

.ps-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- rezervni izgled kada CSS sajta nije dostupan ----------
   :where() daje specifičnost 0, pa ova pravila važe samo ako tema
   (bootstrap + style.css) nije učitana; kada jeste, ona uvijek pobjeđuje. */

:where(body) { margin: 0; background: #fff; font-family: "Manrope", Helvetica, Arial, sans-serif; }
/* Bootstrap inače daje border-box; bez njega bi polje bilo više od izbora. */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(.container) { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
:where(section) { padding: 48px 0; }
:where(.row) { display: block; }
:where(.text-lg-end) { text-align: right; }
:where(.mb-4) { margin-bottom: 24px; }
:where(.btn-main) {
  padding: 8px 25px; border: 0; border-radius: 8px;
  font-family: "Manrope", Helvetica, Arial, sans-serif;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
:where(.ps-fallback-header) img { display: block; }

/* Rezervna traka: logo i naslov u jednom redu, poravnati sa ivicama sadržaja. */
.ps-fallback-header { background: #0a2540; padding: 14px 0; }
.ps-fallback-bar { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.ps-fallback-header img { height: 40px; }
.ps-fallback-header h1 {
  margin: 0 0 0 auto; text-align: right;
  color: #fff; font-size: 24px; font-weight: 700; line-height: 1.25;
}
@media (max-width: 620px) { .ps-fallback-header h1 { font-size: 19px; } }

/* ---------- štampa ---------- */

@media print {
  header, footer, #topbar, #de-loader, .wrapper-cookies, .float-text, .scrollbar-v,
  #subheader, .ps-steps, .ps-nav-actions, .ps-no-print, .ps-tabs, .ps-sticky,
  .ps-btn, .btn-main, #menu-btn {
    display: none !important;
  }
  body { background: #fff !important; }
  section { padding: 0 !important; }
  .ps-panel { box-shadow: none; border: 0; padding: 0; margin-bottom: 16pt; break-inside: avoid; }
  .ps-app { font-size: 10.5pt; color: #000; }
  .ps-table { font-size: 9.5pt; }
  .ps-table th, .ps-table td { padding: 4pt 6pt; }
  .ps-print-only { display: block !important; }
  /* Trag računa ostaje na ekranu; štampani list je pregled materijala. */
  .ps-trace-cell, details { display: none !important; }
  .ps-summary-card.ps-total { background: #fff; border: 1pt solid #000; }
  .ps-summary-card.ps-total .ps-k, .ps-summary-card.ps-total .ps-v { color: #000; }
  a[href]:after { content: ""; }
}
.ps-print-only { display: none; }
