:root {
  color-scheme: light;
  --page: #eceef2;
  --panel: #dfe2e9;
  --card: #f2f3f5;
  --input: #ffffff;
  --border: #e2e5ea;
  --divider: #d3d7de;
  --outline: #b9bec7;
  --text: #121417;
  --label: #1c1f24;
  --muted: #6e737c;
  --faint: #a3a8b0;
  --tag: #c4cefa;
  --doc: #c3cdfb;
  --soft: #e0e3e8;
  --soft-hover: #d4d8de;
  --primary: #2b58e8;
  --primary-hover: #1f47cc;
  --radius: 6px;
  --num-bg: #ffffff;
  --num-text: #444444;
  --num-open-bg: #000000;
  --num-open-text: #ffffff;
  --locked-bg: #e7e9ee;
  --locked-text: #9aa0a8;
  --locked-title: #8c919a;
  --icon: #2a2e34;
  --icon-disabled: #a9adb5;
  --outline-bg: #eef0f3;
  --outline-text: #8a8f98;
  --outline-hover-bg: #e4e7eb;
  --outline-hover-text: #555b64;
  --outline-hover-border: #9fa5ae;
  --on-primary: #ffffff;
  --export-bg: #c3c7ce;
  --export-text: #eef0f3;
  --hover: rgba(0, 0, 0, 0.06);
  --toast-bg: #121417;
  --toast-text: #ffffff;
  --req-bg: #e2e5ea;
  --slot-open-bg: #f7f8fa;
  --success: #2f8a3b;
  --res-good: #8fd18a;
  --res-potential: #e4ee7a;
  --res-minor: #ffa86b;
  --res-major: #f2716f;
  --res-text: #121417;
  --dashed: #9aa0aa;
  --export-active-bg: #1f2b45;
  --export-active-text: #ffffff;
  --danger: #d93a3a;
  --dur: 320ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.audit {
  max-width: 1394px;
  margin: 0 auto;
  padding: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.app-header {
  max-width: 1394px;
  margin: 0 auto;
  padding: 24px 20px 8px;
}

.app-header__top {
  display: flex;
  align-items: center;
  gap: 48px;
}

.logo { display: block; flex: none; line-height: 0; }
/* PNG ima bijelu pozadinu; multiply je "stopi" s sivom pozadinom headera */
.logo img { display: block; width: 145px; height: auto; mix-blend-mode: multiply; }

.logo:focus-visible,
.account:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 6px; }

.search { position: relative; flex: 1; min-width: 0; }

.search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--input);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search__input::placeholder { color: var(--faint); }
.search__input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 88, 232, 0.15); }

.account {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.account__text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.account__name { font-size: 16px; font-weight: 600; }
.account__company { color: var(--muted); font-size: 14px; }

.account__btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft);
  transition: background-color 0.15s;
}

.account:hover .account__btn { background: var(--soft-hover); }

/* Kontekstualna navigacija */
.app-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.app-nav__tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin: -4px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav__tabs::-webkit-scrollbar { display: none; }

.app-nav__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--soft);
  color: #2a2e34;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}

.app-nav__tab:hover { background: var(--soft-hover); }
.app-nav__tab[aria-current="page"] { background: var(--input); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.app-nav__tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Breadcrumb: trenutni audit / klijent */
.app-nav__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.app-nav__tab { cursor: default; }
span.app-nav__tab:not([aria-current]):hover { background: var(--soft); }
.app-nav__tab--current { max-width: min(760px, 80vw); }
.app-nav__tab--current .app-nav__label { font-weight: 700; }
.app-nav__tab--current:hover { background: var(--input); }
.app-nav__meta { display: inline-flex; align-items: center; min-width: 0; color: #4a4f57; font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; }
.app-nav__dot { margin: 0 8px; font-size: 10px; }

.app-nav__action {
  flex: none;
  height: 46px;
  margin-left: auto;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--export-active-bg);
  color: var(--export-active-text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.app-nav__action:hover { filter: brightness(1.2); }

@media (max-width: 900px) {
  .app-header__top { flex-wrap: wrap; gap: 16px; }
  .search { order: 3; flex-basis: 100%; }
  .account { margin-left: auto; }
  .app-nav { margin-top: 24px; }
}

@media (max-width: 600px) {
  .app-header { padding: 16px 16px 4px; }
  .logo img { width: 120px; }
  .account__text { display: none; }
  .app-nav__tab { height: 42px; padding: 0 14px; font-size: 15px; }
  .app-nav__action { width: 42px; height: 42px; padding: 0; }
  .app-nav__action-label { display: none; }
  .app-nav__meta { display: none; }
  .app-nav__tab--current { max-width: 240px; }
}

@media print {
  .app-header { display: none; }
}

/* ---------- Step (accordion) ---------- */
.step {
  background: var(--panel);
  border-radius: 18px;
  padding: 0 20px;
  margin-bottom: 10px;
}

.step__header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
}

.step.is-locked .step__header { cursor: default; }

.step__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--num-bg);
  color: var(--num-text);
  font-size: 13px;
  font-weight: 500;
}

.step.is-open .step__num { background: var(--num-open-bg); color: var(--num-open-text); }
.step.is-locked .step__num { background: var(--locked-bg); color: var(--locked-text); }

.step__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.step.is-locked .step__title { color: var(--locked-title); }

.step__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

.step__meta-criteria { display: inline-flex; gap: 12px; }
.step__dot { font-size: 10px; }
.step__muted { color: var(--faint); font-weight: 400; }

.step__warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.step__lock {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 0 4px;
  color: var(--locked-title);
  font-size: 13px;
}

.step__lock svg { flex: none; }

.step__toggle {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
}

.step__lock + .step__toggle { margin-left: auto; }

.step__toggle:hover:not(:disabled) { background: var(--hover); }
.step__toggle:disabled { color: var(--icon-disabled); cursor: default; }

.step__toggle::before,
.step__toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 1.6px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.step__toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.step.is-open .step__toggle::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Accordion animacija (sekcije, slotovi, pitanja protokola) */
.step__body,
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.step.is-open > .step__body,
.collapse.is-open { grid-template-rows: 1fr; opacity: 1; }

/* margin/padding ostavljaju mjesta za focus ring unutar overflow: hidden */
.step__body > *,
.collapse > * {
  min-height: 0;
  margin: -4px;
  padding: 4px;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear var(--dur);
}

.step.is-open > .step__body > *,
.collapse.is-open > * { visibility: visible; transition-delay: 0s; }

/* razmak ispod sadržaja kao element, ne padding, da zatvorena sekcija bude 0 px */
.step__inner::after { content: ""; display: block; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .step__body, .collapse, .step__body > *, .collapse > *, .step__toggle::before, .step__toggle::after { transition: none; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px 20px 18px;
}

.card + .card { margin-top: 4px; }

.card__title {
  margin: 0 10px 26px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--divider);
  font-size: 16px;
  font-weight: 600;
}

.card--empty p { margin: 0; color: var(--muted); }

/* ---------- Layout ---------- */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
}

.field { margin-bottom: 26px; min-width: 0; }
.field--last { margin-bottom: 0; }
.field--notes { margin-top: 44px; }

.field__label {
  display: block;
  margin: 0 0 8px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group > .select { flex: 1; min-width: 0; }

/* ---------- Controls ---------- */
.control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.control::placeholder { color: var(--text); opacity: 1; }
input.control::placeholder { color: var(--faint); }

.control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 88, 232, 0.15);
}

textarea.control {
  height: auto;
  min-height: 90px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

#notes { min-height: 106px; }

.select { position: relative; }

.select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  border: 5px solid transparent;
  border-top-color: var(--muted);
  border-bottom-width: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.hint {
  margin: 10px 0 0 2px;
  font-size: 12px;
  color: var(--muted);
}

.hint--top { margin-top: 0; max-width: 310px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn--outline {
  flex: none;
  border: 1px solid var(--outline);
  background: var(--outline-bg);
  color: var(--outline-text);
}

.btn--outline:hover { background: var(--outline-hover-bg); color: var(--outline-hover-text); border-color: var(--outline-hover-border); }

.btn--soft {
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--icon);
}

.btn--soft:hover { background: var(--soft-hover); }

.btn--primary {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.btn--primary:hover { background: var(--primary-hover); }

.btn--export {
  height: 34px;
  margin-right: 6px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--export-bg);
  color: var(--export-text);
  font-size: 13px;
}

.btn--export:disabled { cursor: not-allowed; }

.btn:focus-visible,
.step__toggle:focus-visible,
.icon-btn:focus-visible,
.tag__remove:focus-visible,
.date-input__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
}

.icon-btn:hover { background: var(--hover); }

/* ---------- Tags ---------- */
.tags {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 16px;
}

.tags[hidden] { display: none; }

.tags__label { font-size: 12px; font-weight: 500; }

.tags__list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 13px;
  border-radius: 6px;
  background: var(--tag);
  font-size: 14px;
}

.tag__remove {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.tag__remove:hover { background: var(--hover); }

/* ---------- Scope / locations ---------- */
.loc-date-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input {
  position: relative;
  flex: none;
  width: min(100%, 460px);
}

.date-input .control { padding-right: 46px; }

.date-input__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon);
  transform: translateY(-50%);
  cursor: pointer;
}

.date-input__btn:hover { background: var(--hover); }

.date-input__native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.loc-remove[hidden] { display: none; }

#addScopeBtn { margin-top: 6px; }

/* ---------- Documents ---------- */
.docs {
  display: grid;
  grid-template-columns: 426px minmax(0, 1fr);
  gap: 24px 0;
  padding-bottom: 26px;
}

.docs__aside .btn--upload { margin-top: 26px; }

.docs__main { padding-top: 46px; }

.docs__label { margin: 0 0 8px; font-size: 12px; font-weight: 500; }

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

.doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--doc);
  font-size: 14px;
}

.doc__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.docs__empty { margin: 0; color: var(--muted); font-size: 13px; }
.docs__empty[hidden] { display: none; }

/* ---------- Footer ---------- */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Audit plan ---------- */
.step__meta--plan { font-weight: 400; }

.btn--export:not(:disabled) { background: var(--export-active-bg); color: var(--export-active-text); }
.btn--export:not(:disabled):hover { filter: brightness(1.2); }

.btn--primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--primary:disabled:hover { background: var(--primary); }

.btn--chip {
  height: 28px;
  padding: 0 8px;
  gap: 6px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

.btn--chip:hover { background: var(--soft-hover); }

.plan-empty { margin: 0 0 8px 2px; color: var(--muted); }

.day + .day { margin-top: 30px; }

.day__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 18px 2px;
  font-size: 16px;
  font-weight: 600;
}

.day.has-slots .day__title { margin-bottom: 14px; font-size: 14px; }
.day__dot { margin: 0 9px; }
.day__extra { display: inline-flex; align-items: center; }
.day.has-slots .day__extra { display: none; }

.day__badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
}

.day__slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.add-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 1px dashed var(--dashed);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.add-slot:hover { background: var(--hover); }
.add-slot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Zatvoreni slot */
.slot {
  background: var(--card);
  border-radius: 10px;
  padding: 18px 16px 18px 18px;
}

.slot__summary {
  display: grid;
  cursor: pointer;
  grid-template-columns: 178px 314px minmax(0, 1fr) auto;
  align-items: start;
}

.slot { transition: box-shadow 0.15s; }
.slot:not(.is-open):hover { box-shadow: 0 0 0 1px var(--outline); }

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

.slot__range {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.slot__num { font-size: 11px; color: var(--muted); }

.slot__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-top: 4px;
  font-size: 12px;
}

.slot__meta div { display: flex; gap: 8px; }
.slot__meta dt { color: var(--muted); white-space: nowrap; }
.slot__meta dd { margin: 0; font-weight: 600; }

.slot__summary--compact .slot__meta {
  grid-column: 2 / 4;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 44px;
  padding-top: 8px;
}

.slot__reqs { padding-top: 4px; font-size: 12px; }
.slot__label { display: block; margin-bottom: 2px; color: var(--muted); }
.slot__reqs p { margin: 0; font-weight: 500; line-height: 1.6; }
.req b { margin-right: 4px; font-weight: 600; }
.req__sep { margin: 0 6px; color: var(--faint); font-weight: 400; }

/* Otvoreni slot (editor) */
.slot-edit__head {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.slot-edit__title { margin: 0; font-size: 14px; font-weight: 600; }
.slot-edit__close { margin-left: auto; }
.slot-edit__main { max-width: 546px; }

.slot-edit__divider {
  margin: 26px 0 30px;
  border: 0;
  border-top: 1px solid var(--divider);
}

.slot-edit__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.time-range {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 290px;
  height: 42px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.time-range:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 88, 232, 0.15);
}

.time-range.is-invalid { border-color: var(--danger); }

.time-range__input {
  width: 92px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  outline: none;
}

.time-range__input::-webkit-calendar-picker-indicator { display: none; }

.time-range__btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
}

.time-range__btn:hover { background: var(--hover); }

select.control:disabled { color: var(--muted); cursor: not-allowed; }

.tags--top { align-items: flex-start; gap: 22px; }
.tags--top .tags__label { padding-top: 9px; }
.tag__code { margin-right: 2px; }

#step-plan .form-actions { margin-top: 24px; }

/* Prekidač za pregled (samo demo) */
.demo-switch {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.demo-switch span { padding: 0 6px 0 8px; opacity: 0.7; }

.demo-switch button {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}

.demo-switch button[aria-pressed="true"] { background: rgba(127, 127, 127, 0.35); }

@media (max-width: 900px) {
  .slot__summary { grid-template-columns: minmax(0, 1fr) auto; row-gap: 12px; }
  .slot__open { grid-column: 2; grid-row: 1; }
  .slot__meta,
  .slot__reqs,
  .slot__summary--compact .slot__meta { grid-column: 1 / -1; }
  .slot__summary--compact .slot__meta { flex-direction: column; gap: 2px; padding-top: 0; }
  .slot-edit__head { flex-wrap: wrap; gap: 10px; }
  .slot-edit__title { width: 100%; }
  .time-range { width: 100%; }
}

@media print {
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .step:not(.is-printing),
  .filters,
  .tooltip,
  .step__toggle,
  .btn,
  .add-slot,
  .form-actions,
  .demo-switch,
  .slot:has(> .collapse:only-child) { display: none !important; }
  .step.is-printing .step__body,
  .slot > .collapse:first-child { grid-template-rows: 1fr; opacity: 1; }
  .step.is-printing .step__body > *,
  .slot > .collapse:first-child > * { visibility: visible; }
  .slot > .collapse:nth-child(2) { display: none !important; }
  .step, .slot { background: #fff; }
}

/* ---------- Audit protocol ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; white-space: nowrap; }
.status.is-done { color: var(--success); }

.proto-day + .proto-day { margin-top: 34px; }
.proto-day .day__title { margin-bottom: 14px; }
.proto-day__slots { display: flex; flex-direction: column; gap: 6px; }

.pslot {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--card);
  transition: opacity 0.15s;
}

.has-open .pslot:not(.is-open) { opacity: 0.5; }
.has-open .pslot:not(.is-open):hover { opacity: 0.8; }

.pslot.is-open {
  border-color: var(--border);
  background: var(--slot-open-bg);
  box-shadow: 0 4px 18px rgba(20, 30, 50, 0.08);
}

.pslot__head {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 10px 16px 10px 18px;
}

.pslot__head { cursor: pointer; }
.pslot:not(.is-open):hover { box-shadow: 0 0 0 1px var(--outline); }

.pslot__time { font-size: 20px; font-weight: 500; white-space: nowrap; }

.pslot__meta { display: flex; flex-wrap: wrap; gap: 4px 30px; margin: 0; font-size: 14px; }
.pslot__meta div { display: flex; gap: 8px; }
.pslot__meta dt { color: var(--muted); }
.pslot__meta dd { margin: 0; font-weight: 500; }
.pslot .status { font-size: 12px; }

.pslot__btn { height: 34px; padding: 0 10px; font-size: 14px; }
.pslot.is-open .pslot__btn { background: var(--input); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.pslot__body { display: flex; flex-direction: column; gap: 5px; padding: 0 14px 14px; }
.pslot__empty { margin: 0; padding: 10px 4px; color: var(--muted); }

/* Zahtjev (pitanje protokola) */
.preq { border-radius: 6px; background: var(--req-bg); }

.preq__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 4px 10px 4px 14px;
  cursor: pointer;
}

.preq__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.preq__title:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 2px; }

.result {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--res-text);
  font-size: 12px;
  white-space: nowrap;
}

.result--good { background: var(--res-good); border-color: #5fae59; }
.result--potential { background: var(--res-potential); border-color: #c3cd52; }
.result--minor { background: var(--res-minor); border-color: #e7864b; }
.result--major { background: var(--res-major); border-color: #d65452; }

.preq__results { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.preq__results-label { margin-right: 14px; font-size: 12px; font-weight: 600; }

.result-btn {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--outline);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.result-btn:hover { border-color: var(--muted); }
.result-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.result-btn[aria-pressed="true"] { color: var(--res-text); }
.result-btn--good[aria-pressed="true"] { background: var(--res-good); border-color: #5fae59; }
.result-btn--potential[aria-pressed="true"] { background: var(--res-potential); border-color: #c3cd52; }
.result-btn--minor[aria-pressed="true"] { background: var(--res-minor); border-color: #e7864b; }
.result-btn--major[aria-pressed="true"] { background: var(--res-major); border-color: #d65452; }

.preq__body { padding: 10px 12px 14px 14px; }
.preq__body .field { margin-bottom: 18px; }
.preq__body .field--last { margin-bottom: 0; }
.preq__body .control::placeholder { color: var(--faint); }

.guide { margin: 0 0 22px; max-width: 520px; font-size: 11px; line-height: 1.35; color: var(--label); }
.guide dt { margin-top: 8px; color: var(--muted); text-decoration: underline; }
.guide dt:first-child { margin-top: 0; }
.guide dd { margin: 0; }

@media (max-width: 900px) {
  .pslot__head { grid-template-columns: minmax(0, 1fr) auto; }
  .pslot__meta, .pslot .status { grid-column: 1 / -1; }
  .pslot__btn { grid-column: 2; grid-row: 1; }
  .preq__head { flex-wrap: wrap; }
  .preq__results { justify-content: flex-start; width: 100%; padding-bottom: 6px; }
  .preq__results-label { width: 100%; }
}

/* ---------- Audit report (dashboard) ---------- */
.report { display: flex; flex-direction: column; gap: 8px; }
.report .card + .card { margin-top: 0; }
.report__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px; }
.muted { color: var(--muted); }

.report-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}

.report-card__title { margin: 0; font-size: 16px; font-weight: 600; }
.report-card__meta { color: var(--muted); font-size: 12px; }
.report-empty { margin: 0; color: var(--muted); }

/* Status boje + šrafura kao druga oznaka (minor/major) */
.seg--good { background-color: var(--res-good); }
.seg--potential { background-color: var(--res-potential); }
.seg--minor {
  background-color: var(--res-minor);
  background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.16) 0 1.5px, transparent 1.5px 6px);
}
.seg--major {
  background-color: var(--res-major);
  background-image:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.18) 0 1.5px, transparent 1.5px 6px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.18) 0 1.5px, transparent 1.5px 6px);
}

.swatch {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  vertical-align: -1px;
}

/* Pregled */
.report-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 24px;
}

.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.report-title { margin: 0 0 20px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 0;
}

.facts dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.facts dd { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; font-size: 14px; font-weight: 500; }

.chip {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--tag);
  font-size: 12px;
  font-weight: 500;
}

.verdict {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  border-left: 4px solid var(--verdict-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--verdict-color) 22%, var(--card));
}

.verdict--good { --verdict-color: var(--res-good); }
.verdict--potential { --verdict-color: var(--res-potential); }
.verdict--minor { --verdict-color: var(--res-minor); }
.verdict--major { --verdict-color: var(--res-major); }

.verdict__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.verdict__title { font-size: 20px; font-weight: 600; line-height: 1.25; }
.verdict__text { margin: 0; font-size: 13px; }
.verdict__basis { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* KPI pločice */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--card);
}

.kpi__label { display: flex; align-items: center; color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi__value { font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.kpi__value small { margin-left: 2px; font-size: 18px; font-weight: 500; color: var(--muted); }
.kpi__sub { color: var(--muted); font-size: 12px; }

/* Složena traka */
.bar { display: flex; gap: 2px; width: 100%; }
.bar--lg { height: 30px; }
.bar--sm { height: 10px; min-width: 80px; }
.bar--empty { border-radius: 4px; background: var(--req-bg); }

.bar__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-basis: 0;
  min-width: 4px;
  cursor: default;
}

.bar__seg:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.bar__seg:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.bar__seg:hover { filter: brightness(0.94); }

.bar__label {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
  color: #121417;
  font-size: 12px;
  font-weight: 600;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.legend li { display: flex; align-items: center; }
.legend__label { flex: 1; min-width: 0; }
.legend__value { margin-left: 8px; font-weight: 600; }
.legend__pct { width: 42px; color: var(--muted); text-align: right; }

/* Rezultati po slotu */
.srows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }

.srow {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  font-size: 13px;
}

.srow + .srow { border-top: 1px solid var(--divider); }
.srow__when { display: flex; flex-direction: column; }
.srow__when strong { font-weight: 600; white-space: nowrap; }
.srow__when span,
.srow__who span { color: var(--muted); font-size: 12px; }
.srow__who { min-width: 0; overflow-wrap: anywhere; }
.srow .result { height: 22px; font-size: 11px; }

/* Nalazi */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }

.filter {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--outline);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.filter:hover { background: var(--hover); }
.filter:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.filter[aria-pressed="true"] { border-color: var(--text); background: var(--input); font-weight: 600; }
.filter__count { margin-left: 8px; color: var(--muted); font-weight: 500; }

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

.finding {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--finding-color);
  border-radius: 6px;
  background: var(--req-bg);
}

.finding--potential { --finding-color: var(--res-potential); }
.finding--minor { --finding-color: var(--res-minor); }
.finding--major { --finding-color: var(--res-major); }

.finding__title { margin: 0; font-size: 14px; font-weight: 600; }
.finding__meta { margin: 2px 0 8px; color: var(--muted); font-size: 12px; }
.finding__note { margin: 0; font-size: 13px; line-height: 1.5; }

/* Tablica po zahtjevima */
.table-wrap { overflow-x: auto; }

.rtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.rtable th,
.rtable td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--divider); text-align: left; white-space: nowrap; }
.rtable thead th { color: var(--muted); font-size: 12px; font-weight: 500; }
.rtable tbody th { font-weight: 600; white-space: normal; min-width: 180px; }
.rtable tbody tr:last-child > * { border-bottom: 0; }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.rtable__bar { width: 22%; min-width: 120px; }
.rtable .result { height: 22px; font-size: 11px; }

/* Opseg i osnova */
.basis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.basis__title { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.basis__title:not(:first-child) { margin-top: 20px; }
.basis__text { margin: 0; font-size: 13px; line-height: 1.5; }
.basis__list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.basis__list li span:last-child:not(.muted) { display: block; color: var(--muted); font-size: 12px; }
.basis__list--docs li { padding: 8px 12px; border-radius: 6px; background: var(--doc); }

/* Tooltip */
.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 12px;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .report__row { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .report-overview { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .finding { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .finding__badge { justify-self: start; }
  .basis { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .basis > div + div .basis__title { margin-top: 20px; }
}

@media (max-width: 600px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: minmax(0, 1fr) auto; }
  .srow__who { grid-column: 1 / -1; grid-row: 2; }
  .srow__bar { grid-column: 1 / -1; grid-row: 3; }
  .srow__worst { grid-column: 2; grid-row: 1; }
  .kpi__value { font-size: 28px; }
}

@media print {
  .report-card, .kpi, .report-overview, .finding { break-inside: avoid; }
}

/* ---------- Dashboard ---------- */
body:not([data-view="audit"]) .demo-switch:not(.demo-switch--clients):not(.demo-switch--inspectors) { display: none; }
body:not([data-view="clients"]) .demo-switch--clients { display: none; }
body:not([data-view="inspectors"]) .demo-switch--inspectors { display: none; }

.dash {
  padding: 20px;
  border-radius: 22px;
  background: var(--panel);
}

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

/* Dropdown */
.dropdown { position: relative; flex: none; }

.dropdown__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 188px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--input);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.dropdown--year .dropdown__btn { width: 92px; }

.dropdown__btn::after {
  content: "";
  flex: none;
  border: 5px solid transparent;
  border-top-color: var(--muted);
  border-bottom-width: 0;
  transition: transform 0.2s var(--ease);
}

.dropdown.is-open .dropdown__btn::after { transform: rotate(180deg); }
.dropdown__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 15;
  min-width: 248px;
  padding: 16px 8px 8px;
  border-radius: 12px;
  background: var(--input);
  box-shadow: 0 16px 40px rgba(20, 30, 50, 0.14), 0 2px 6px rgba(20, 30, 50, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
}

.dropdown--year .dropdown__menu { right: 0; left: auto; min-width: 160px; transform-origin: top right; }

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.dropdown__title {
  margin: 0 10px 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
}

.dropdown__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; outline: none; }

.dropdown__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

.dropdown__option.is-active { background: #eef1f6; }
.dropdown__list:focus-visible .dropdown__option.is-active { box-shadow: inset 0 0 0 2px var(--primary); }
.dropdown__option[aria-selected="true"] { font-weight: 600; }
.dropdown__option[aria-selected="true"]::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-left: 16px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-2px);
}

/* Mjeseci */
.months {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  margin: -4px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.months::-webkit-scrollbar { display: none; }

.month {
  flex: none;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5d636c;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.month:hover { background: var(--hover); color: var(--text); }
.month.is-empty { color: var(--faint); }
.month[aria-pressed="true"] { background: var(--input); color: var(--text); font-weight: 600; }
.month:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Kartice auditova */
.alist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }

.acard {
  display: grid;
  grid-template-columns: 96px 338px minmax(0, 1fr) auto;
  align-items: start;
  padding: 20px 14px 22px 20px;
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.acard:hover { box-shadow: 0 0 0 1px var(--outline); }

.acard__date { display: flex; flex-direction: column; }
.acard__day { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.acard__month { color: var(--muted); font-size: 12px; }

.acard__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding-top: 2px;
  font-size: 14px;
}

.acard__meta div { display: flex; gap: 8px; }
.acard__meta dt { color: var(--muted); white-space: nowrap; }
.acard__meta dd { margin: 0; font-weight: 500; }

.acard__reqs { display: flex; gap: 12px; padding-top: 2px; font-size: 14px; }
.acard__label { flex: none; color: var(--muted); }
.acard__reqs { min-width: 0; }
.acard__reqs p { min-width: 0; margin: 0; font-weight: 500; line-height: 1.45; overflow-wrap: break-word; }
.acard__meta { min-width: 0; }

.acard__open { height: 32px; padding: 0 10px; text-decoration: none; }

.acard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 2 / -1;
  margin-top: 18px;
}

.btn--dark-sm {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--export-active-bg);
  color: var(--export-active-text);
  font-size: 14px;
}

.btn--dark-sm:hover { filter: brightness(1.2); }

.alist__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
}

.alist__empty p { margin: 0; }

/* Kartice klijenata (nasljeđuju .acard) */
.ccard { grid-template-columns: 200px 338px minmax(0, 1fr) auto; }
.ccard__name { display: flex; flex-direction: column; gap: 2px; padding-right: 16px; }
.ccard__title { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ccard__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ccard__info .acard__label { width: 64px; }
.ccard .acard__meta dd { overflow-wrap: anywhere; }

/* ---------- Audit protocol: Basic Evidence + Findings / Statements ---------- */
.preq__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 18px; }
.preq__body .preq__cols .field { margin-bottom: 0; }

.pfindings__title { margin: 0 0 9px 2px; }
.pfindings__list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }

.pfinding { padding: 10px 12px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1px var(--outline-bg); }
.pfinding__head { display: flex; align-items: center; justify-content: space-between; min-height: 22px; margin-bottom: 6px; }
.pfinding__label { color: var(--muted); font-size: 12px; }
.pfinding__remove { width: 22px; height: 22px; }
.pfinding .control { min-height: 0; }
.pfinding__results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.pfindings__add { height: 34px; font-size: 13px; }

/* Izvještaj: izjave s rezultatom */
.finding__statements { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; }
.finding__statements li { display: flex; align-items: baseline; }
.swatch--none { background: transparent; box-shadow: inset 0 0 0 1px var(--outline); }
.finding__evidence { margin: 6px 0 0; font-size: 12px; line-height: 1.45; }

@media (max-width: 900px) {
  .preq__cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* ---------- Verzije Audit plana ---------- */
.version-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--input);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.version-badge--draft { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--outline); }
.version-badge--old { background: var(--res-potential); color: var(--res-text); }

.versions { margin: 0 0 22px; }
.versions__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.versions__label { flex: none; color: var(--muted); font-size: 13px; }
.versions__list { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 2px; }
.versions__empty { margin: 0; color: var(--muted); font-size: 13px; }

.vchip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.vchip:hover { background: rgba(255, 255, 255, 0.75); }
.vchip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vchip.is-active { background: var(--input); box-shadow: 0 1px 2px rgba(18, 20, 23, 0.08); }
.vchip b { font-weight: 600; }
.vchip__date { color: var(--muted); }
.vchip__tag { padding: 2px 7px; border-radius: 999px; background: var(--res-potential); white-space: nowrap; color: var(--res-text); font-size: 11px; font-weight: 500; }

.versions__banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 12px 12px 18px;
  border-radius: 10px;
  background: var(--input);
}
.versions__banner p { flex: 1; min-width: 240px; margin: 0; font-size: 14px; }

/* Starija verzija: samo za čitanje */
#planDays.is-readonly .add-slot,
#planDays.is-readonly .slot__open { display: none; }
#planDays.is-readonly .slot__summary { cursor: default; }

@media (max-width: 600px) {
  .versions__row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .versions__list { max-width: 100%; }
  .versions__banner .btn { flex: 1; }
}

/* ---------- Diskretne akcije ispod audita ---------- */
/* Podnožje na svim stranicama */
.page-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding-top: 0; margin-top: -2px; }
.page-foot > .btn--quiet { margin-left: -12px; } /* tekst gumba poravnat s lijevim rubom sadržaja */
body:not([data-view="audit"]) .audit-foot { display: none; }

.audit-foot { display: flex; justify-content: flex-end; margin-left: auto; }
.audit-foot__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

.btn--quiet {
  height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}
.btn--quiet:hover { background: var(--soft); color: var(--text); }

.audit-foot__confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 18px;
  border-radius: 10px;
  background: var(--soft);
}
.audit-foot__confirm p { margin: 0 8px 0 0; font-size: 14px; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #c12f2f; }

@media (max-width: 600px) {
  .audit-foot, .audit-foot__actions { justify-content: stretch; }
  .audit-foot { flex-basis: 100%; }
  .audit-foot__actions .btn { flex: 1; }
  .audit-foot__confirm p { flex-basis: 100%; margin: 0 0 4px; }
}

/* ---------- Klijent (main_client) ---------- */
.field--last-row { margin-bottom: 0; }

.field__error { margin: 8px 0 0 2px; color: var(--danger); font-size: 12px; }
.field.is-invalid .control { border-color: var(--danger); }
.field.is-invalid .control:focus { box-shadow: 0 0 0 3px rgba(217, 58, 58, 0.15); }

/* Popis stavki (odjeli, kontakti, lokacije, povijest audita) */
.llist { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }

.litem {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 10px 10px 10px 16px;
  border-radius: 8px;
  background: var(--input);
}

.litem__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.litem__primary { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.litem__secondary { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.litem__btns { display: flex; flex: none; align-items: center; gap: 4px; }

.litem--form {
  display: block;
  padding: 18px 18px 16px;
  box-shadow: inset 0 0 0 1px var(--outline);
}

.litem__form-title { margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.row--form .field { margin-bottom: 18px; }
.litem__actions { display: flex; justify-content: flex-end; gap: 8px; }

.llist__empty { margin: 0 0 16px; color: var(--muted); }
.llist:last-child, .llist__empty:last-child { margin-bottom: 0; }
.llist__add { height: 40px; text-decoration: none; }

/* Povijest audita */
.hrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 12px 10px 12px 16px; border-radius: 8px; background: var(--input); }
.hrow__date { display: flex; flex-direction: column; }
.hrow__day { font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.hrow .btn--chip { height: 32px; padding: 0 10px; text-decoration: none; }

.pill { padding: 4px 10px; border-radius: 999px; color: var(--res-text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill--upcoming { background: var(--tag); }
.pill--planned { background: var(--res-potential); }
.pill--completed { background: var(--res-good); }

.docs--client { padding-bottom: 0; }

/* Programi (koriste izgled slotova iz Audit plana) */
.prog__reqs { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prog__summary .slot__meta dd { overflow-wrap: anywhere; }
.time-range--dates { width: 340px; padding-right: 12px; }
.time-range--dates .time-range__input { width: 136px; }
.time-range--dates .time-range__input::-webkit-calendar-picker-indicator { display: block; cursor: pointer; opacity: 0.6; }
.time-range.is-invalid + .field__error { margin-top: 8px; }

@media (max-width: 900px) {
  .time-range--dates { width: 100%; }
  .time-range--dates .time-range__input { flex: 1; width: auto; }
}

@media (max-width: 900px) {
  .field--last-row:not(:last-child) { margin-bottom: 26px; }
  .row--form .field--last-row:not(:last-child),
  .row--form .field { margin-bottom: 18px; }
}

@media (max-width: 600px) {
  .litem { align-items: flex-start; }
  .hrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .hrow__date { flex-direction: row; align-items: baseline; gap: 8px; }
  .hrow .litem__text { grid-column: 1 / -1; grid-row: 2; }
  .hrow .btn--chip { grid-column: 2; grid-row: 3; justify-self: end; }
  .hrow .pill { grid-column: 1; grid-row: 3; justify-self: start; }
  .litem__actions .btn { flex: 1; }
}

/* Privremena stranica */
.placeholder { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px; }
.placeholder__title { margin: 0; font-size: 24px; }
.placeholder p { margin: 0 0 8px; }
.placeholder .btn { text-decoration: none; }

@media (max-width: 1100px) {
  .acard { grid-template-columns: 80px minmax(0, 1fr) auto; row-gap: 14px; }
  .acard__reqs { grid-column: 2 / -1; grid-row: 2; }
  .acard__open { grid-column: 3; grid-row: 1; }
  .acard__actions { margin-top: 0; }
  .ccard { grid-template-columns: 180px minmax(0, 1fr) auto; }
  .ccard__info { grid-column: 2 / -1; grid-row: 2; }
}

@media (max-width: 900px) {
  .dash { padding: 14px; }
  .dash__filters { flex-wrap: wrap; gap: 12px; }
  .months { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .dropdown--year { margin-left: auto; }
}

@media (max-width: 600px) {
  .acard { grid-template-columns: 64px minmax(0, 1fr); padding: 16px 14px; }
  .acard__day { font-size: 26px; }
  .acard__open { grid-column: 2; grid-row: 2; justify-self: start; }
  .acard__meta { grid-column: 2; }
  .acard__reqs { grid-column: 1 / -1; grid-row: auto; flex-direction: column; gap: 2px; }
  .acard__actions { grid-column: 1 / -1; }
  .dropdown__btn { width: 168px; }
  .ccard { grid-template-columns: minmax(0, 1fr) auto; row-gap: 12px; }
  .ccard__name { grid-column: 1; grid-row: 1; }
  .ccard .acard__open { grid-column: 2; grid-row: 1; justify-self: end; }
  .ccard .acard__meta { grid-column: 1 / -1; }
  .ccard__info { grid-column: 1 / -1; grid-row: auto; }
  .ccard__info .acard__reqs { flex-direction: column; gap: 2px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .tags { flex-wrap: wrap; gap: 8px 16px; }
  .docs__main { padding-top: 0; }
  .date-input { width: 100%; flex: 1; }
  .step__header { flex-wrap: wrap; padding-left: 0; }
  .step__meta { order: 3; width: 100%; justify-content: flex-start; }
  .step__toggle { margin-left: auto; }
  .step__lock { order: 3; width: 100%; margin: 0; }
}

@media (max-width: 600px) {
  .audit { padding: 16px; }
  .step { padding: 0 12px; }
  .card { padding: 16px 14px; }
  .input-group { flex-direction: column; }
  .input-group .btn { width: 100%; }
}

/* Glavni rezultat ne može biti bolji od najlošijeg nalaza */
.result-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.result-btn:disabled:hover { border-color: var(--outline); }

/* ---------- Change Logs (bočna ploča) ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(18, 20, 23, 0.28); opacity: 0; transition: opacity 0.2s ease; }
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  background: var(--page);
  box-shadow: -12px 0 32px rgba(18, 20, 23, 0.12);
  transform: translateX(24px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; opacity: 1; }
body.has-drawer { overflow: hidden; }

.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; }
.drawer__title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.drawer__sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.drawer__close { flex: none; width: 36px; height: 36px; }

.clog { flex: 1; overflow-y: auto; margin: 0; padding: 0 24px 24px; list-style: none; }
.clog__item { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--outline-bg); }
.clog__item:first-child { border-top: 0; }
.clog__when { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; line-height: 1.4; }
.clog__time { color: var(--text); font-weight: 500; }
.clog__text { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.clog__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.clog__avatar { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); color: var(--text); font-size: 9px; font-weight: 600; }
.clog__section { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--input); color: var(--text); }
.clog__empty { padding: 8px 0; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .drawer__backdrop, .drawer__panel { transition: none; }
}

@media print {
  .page-foot, .drawer { display: none !important; }
}

/* ---------- Bočna ploča: novi klijent iz Audit info ---------- */
.drawer--wide .drawer__panel { width: min(1000px, 100%); }
.drawer__scroll { flex: 1; overflow-y: auto; padding: 0 24px 24px; overscroll-behavior: contain; }
.drawer__foot { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--outline-bg); background: var(--page); }
.client-drawer .step:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .drawer__head { padding: 18px 16px 12px; }
  .drawer__scroll { padding: 0 12px 16px; }
  .drawer__foot { padding: 12px 16px; }
  .drawer__foot .btn { flex: 1; }
}

/* ---------- Inspektori ---------- */
.name-group { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; max-width: calc(50% - 12px); }
.pill--valid { background: var(--res-good); }
.pill--soon { background: var(--res-potential); }
.pill--expired { background: var(--res-major); }
.control--date { max-width: 260px; }

.idoc { gap: 18px; }
.icard .ccard__info .acard__label { width: 82px; white-space: nowrap; }
/* ime inspektora u jednom redu: stupac s imenom ~30% kartice, najmanje 340px */
.icard { grid-template-columns: minmax(340px, 30%) 338px minmax(0, 1fr) auto; }
.lic__summary .slot__range { font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.idoc__type { display: inline-flex; flex: none; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.idoc__size { flex: none; min-width: 72px; color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

@media (max-width: 1100px) {
  .icard { grid-template-columns: minmax(0, 340px) minmax(0, 1fr) auto; }
}
@media (max-width: 900px) {
  .name-group { max-width: none; }
}
@media (max-width: 600px) {
  .icard { grid-template-columns: minmax(0, 1fr) auto; }
  .name-group { grid-template-columns: 110px minmax(0, 1fr); }
  .idoc { flex-wrap: wrap; gap: 8px 14px; }
  .idoc .litem__text { flex-basis: 100%; }
  .idoc .icon-btn { margin-left: auto; }
  .control--date { max-width: none; }
}

/* ---------- Audit info: Inspector (multiple select, kao Audit criteria) ---------- */
.tag--warn { box-shadow: inset 0 0 0 1px var(--danger); }
.tag--soon { box-shadow: inset 0 0 0 1px #b9c43a; }
.tag__warn { flex: none; margin-right: -2px; color: var(--danger); }
.tag--soon .tag__warn { color: #7d8520; }
.insp-notes { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; padding: 0; list-style: none; }
.insp-notes:empty { display: none; }
.insp-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.insp-note--warn { color: var(--danger); }

/* ---------- Audit protocol: ⓘ objašnjenje zahtjeva ---------- */
.preq__name { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; }
.preq__name .preq__title { flex: 0 1 auto; }
.info-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.info-btn:hover { color: var(--primary); }
.info-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.drawer__panel--info { width: min(520px, 100%); }
.rinfo__close-row { display: flex; justify-content: flex-end; padding: 16px 16px 0; }
.rinfo { padding-top: 0; }
.rinfo__eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.rinfo__title { line-height: 1.25; }
.rinfo__section { margin-top: 22px; padding: 18px 20px; border-radius: 10px; background: var(--card); }
.rinfo__heading { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.rinfo__text { margin: 0; font-size: 14px; line-height: 1.6; }
.rinfo__points { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 14px; }
.rinfo__points li { display: flex; gap: 10px; }
.rinfo__ref { flex: none; min-width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rinfo__guide { margin: 0; font-size: 13px; line-height: 1.5; }
.rinfo__guide dt { margin-top: 12px; color: var(--muted); font-size: 12px; }
.rinfo__guide dt:first-child { margin-top: 0; }
.rinfo__guide dd { margin: 2px 0 0; }
.rinfo__official { font-size: 14px; line-height: 1.6; white-space: pre-line; }
.rinfo__placeholder { margin: 0; padding: 12px 14px; border: 1px dashed var(--outline); border-radius: 8px; color: var(--muted); font-size: 13px; }

@media print { .info-btn { display: none; } }
