/* =====================================================================
   KALKULATOR TARIFE (assets/tarifa) - stilovi modula.
   Raspored: jedna strana bez skrolovanja - traka gore, levo kratak unos,
   desno jedna korpa. Koristi promenljive teme aplikacije (--surface,
   --line, --ink, --muted, --accent, --accent-2, --warn), pa prati svetlu,
   tamnu i navy temu. Sve je pod .tf-root / .tf-print-sheet.
   ===================================================================== */

.tf-root {
  --tf-h: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: var(--tf-h);
  min-height: 0;
  color: var(--ink);
  font-size: 14px;
}
/* U aplikaciji: visina prozora minus zaglavlje aplikacije (uz skaliranje zoom-om). */
.app-shell .tf-root {
  --tf-h: calc((100vh - var(--app-header-h, 74px) - 66px) / var(--app-zoom, 1));
  min-height: 600px;
}

.tf-root button:active {
  /* bez scale(): smanjena povrsina bi pri kliku uz ivicu promasila dugme */
  transform: translateY(1px);
}

/* ---------------------------------------------------------------- traka */
.tf-bar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 16px;
}
.tf-title {
  margin: 0 6px 0 0;
  font-size: 18px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.tf-bar-date {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tf-bar-date .tf-label {
  white-space: nowrap;
}
.tf-bar .tf-check {
  margin: 0;
  align-items: center;
}
.tf-bar .tf-check input {
  margin: 0;
}
.tf-meta {
  position: relative;
  font-size: 13px;
}
.tf-meta > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.tf-meta > summary::-webkit-details-marker {
  display: none;
}
.tf-meta-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: grid;
  gap: 0;
  width: 300px;
  padding: 14px 14px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tf-new {
  margin-left: auto;
}

/* ---------------------------------------------------------------- raspored */
.tf-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, 450px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
}
.tf-entry,
.tf-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

/* ---------------------------------------------------------------- jezicci */
.tf-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  margin: 10px 16px 0;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
}
.tf-tab {
  flex: 1 1 0;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
}
.tf-tab:hover {
  color: var(--ink);
}
.tf-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
/* Ugovor: tiha veza na kraju reda, ne ravnopravan jezicak */
.tf-tab-quiet {
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.tf-tab-quiet.active {
  text-decoration: none;
}

/* ---------------------------------------------------------------- unos */
.tf-entry-scroll {
  position: relative; /* skriveno dugme forme (.tf-sr) ne sme da produzi stranu */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 4px;
}
.tf-entry-foot {
  flex: none;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

.tf-field {
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0 0 11px;
  min-width: 0;
}
.tf-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.tf-step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-size: 11.5px;
  font-weight: 800;
  vertical-align: 1px;
}
.tf-field > .tf-label:has(.tf-step) {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}
.tf-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
}
/* Vrednost predmeta i izbor suda u jednom redu */
.tf-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}
.tf-stack > .tf-field {
  margin: 0;
}
.tf-input {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.12s ease;
}
.tf-input:hover:not(:focus):not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.tf-input:focus {
  border-color: var(--accent);
}
.tf-input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}
select.tf-input {
  padding-right: 6px;
}
.tf-w-sm { max-width: 140px; }
.tf-w-time { max-width: 110px; }
.tf-w-date { max-width: 150px; }
.tf-w-money { max-width: 220px; }
.tf-root .local-date-wrap {
  display: inline-flex;
  width: 100%;
  max-width: 190px;
}
.tf-root .local-time-wrap {
  max-width: 110px;
}
.tf-bar .local-date-wrap {
  max-width: 160px;
}

.tf-search {
  position: relative;
  margin-bottom: 11px;
}
.tf-search-input {
  padding-left: 32px;
  background: var(--surface-2) no-repeat 10px center / 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  border-color: transparent;
}
.tf-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tf-results.is-open {
  display: grid;
  gap: 2px;
}
.tf-results .tf-hint {
  padding: 6px 8px;
}
.tf-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
}
.tf-result:hover,
.tf-result:focus-visible,
.tf-result.is-first {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tf-result-meta {
  color: var(--muted);
  font-size: 11.5px;
}

.tf-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
}
p.tf-hint {
  margin: -4px 0 12px;
}
.tf-hint-inline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.tf-fixed {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}
.tf-note {
  margin: 0 0 12px;
  padding: 2px 0 2px 9px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.tf-note-warn {
  border-left-color: var(--warn);
  color: var(--ink);
}
.tf-stack .tf-note {
  margin: 0;
}

.tf-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 12px;
  cursor: pointer;
  line-height: 1.4;
}
.tf-check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.tf-radio-row {
  margin-bottom: 10px;
}
.tf-hint.tf-hint-warn {
  margin: 4px 0 0;
}
.tf-check .tf-hint {
  margin-top: 2px;
}
.tf-stack .tf-check {
  margin: 2px 0 0;
}

.tf-switch,
.tf-radio-row {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
}
.tf-radio {
  position: relative;
  flex: 1 1 0;
  cursor: pointer;
}
.tf-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tf-radio span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.tf-radio:hover span {
  color: var(--ink);
}
.tf-radio input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.tf-radio input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tf-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
  align-items: start;
}
.tf-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 8px;
  align-items: start;
}
.tf-time-row .tf-field {
  margin: 0;
}
.tf-group {
  margin: 0 0 12px;
  padding: 10px 12px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.tf-group > legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tf-claim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 140px) 28px;
  gap: 6px;
  margin-bottom: 6px;
}
.tf-claims {
  margin: 0;
}
.tf-claims .text-button {
  min-height: 30px;
  margin-bottom: 4px;
}

/* Vise opcija */
.tf-more {
  margin: 4px 0 8px;
}
.tf-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.tf-more-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
}
.tf-more-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.tf-help {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.tf-help > summary {
  cursor: pointer;
  font-weight: 600;
}
.tf-help ol,
.tf-help ul {
  margin: 4px 0 8px;
  padding-left: 20px;
  line-height: 1.55;
}

/* Pregled iznosa + dugme */
.tf-preview {
  margin: 0 0 10px;
  font-size: 13px;
}
.tf-preview-empty {
  margin: 0;
  color: var(--muted);
}
.tf-preview-amount,
.tf-preview-fees {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.tf-preview-amount span,
.tf-preview-fees span {
  color: var(--muted);
}
.tf-preview-amount strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.tf-preview-fees strong {
  font-variant-numeric: tabular-nums;
}
.tf-suggest:empty {
  display: none;
}
.tf-suggest-title {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 650;
}
.tf-form-actions {
  display: flex;
  gap: 8px;
}
.tf-add {
  flex: 1 1 auto;
  min-height: 44px;
  font-size: 15px;
}

.tf-msgs {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.45;
}
.tf-msgs li {
  padding: 4px 8px;
  border-left: 3px solid transparent;
  border-radius: 4px;
}
.tf-msgs-error li {
  border-left-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 13%, transparent);
}
.tf-msgs-warn li,
.tf-msgs-suggest li {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, transparent);
}
.tf-msgs-todo li {
  padding: 0;
  color: var(--muted);
}
.tf-msgs-note li {
  padding: 0 0 0 11px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- korpa */
.tf-basket-head {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px 8px;
}
.tf-basket-head h3 {
  margin: 0;
  font-size: 17px;
}
.tf-basket-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px;
}
.tf-basket-empty {
  display: grid;
  place-content: center;
  height: 100%;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
}
.tf-basket-empty p {
  margin: 0 0 6px;
}
.tf-basket-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.tf-item {
  border-bottom: 1px solid var(--line);
}
.tf-item-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto minmax(96px, auto) 30px;
  align-items: center;
  gap: 10px;
  padding: 7px 6px 7px 8px;
  border-radius: 6px;
}
.tf-item:hover > .tf-item-line,
.tf-item.is-open > .tf-item-line {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.tf-item-no {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  user-select: none;
}
.tf-drag {
  cursor: grab;
}
.tf-item-main {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tf-item-title,
.tf-item-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tf-item-title {
  font-weight: 650;
}
.tf-item-sub {
  color: var(--muted);
  font-size: 12px;
}
.tf-item-pts {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tf-item-amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.tf-item-x {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}
.tf-item-x:hover {
  background: var(--surface-2);
  color: var(--accent-2);
}
.tf-item-restore:hover {
  color: var(--accent);
}
.tf-item.is-fee .tf-item-line {
  padding-top: 4px;
  padding-bottom: 4px;
}
.tf-item.is-fee .tf-item-title {
  font-size: 13px;
  font-weight: 550;
}
.tf-item.is-fee .tf-item-amt {
  font-weight: 600;
  font-size: 13px;
}
.tf-item-fee-mark {
  color: var(--muted);
}
.tf-item.is-excluded .tf-item-title,
.tf-item.is-excluded .tf-item-amt {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}
.tf-item.is-error .tf-item-amt {
  color: var(--accent-2);
}
.tf-item.is-editing > .tf-item-line {
  box-shadow: inset 3px 0 0 var(--accent);
}
.tf-item-err {
  margin: -4px 0 8px 42px;
  color: var(--accent-2);
  font-size: 12px;
}
.tf-item-detail {
  padding: 2px 12px 12px 42px;
}
.tf-item-calc,
.tf-item-note {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.tf-item-note {
  font-style: italic;
}
.tf-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tf-item-actions .small {
  min-height: 30px;
  padding: 0 12px;
}
.tf-flag {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 1px;
}
.tf-flag-err {
  background: var(--accent-2);
  color: #fff;
}
.tf-flag-warn {
  background: var(--warn);
  color: #1b1405;
}
.tf-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid var(--warn);
  border-radius: 999px;
  color: var(--warn);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}
.tf-row.is-dragging,
.tf-item.is-dragging {
  opacity: 0.45;
}
.tf-item.is-drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}
.tf-item.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tf-basket-foot {
  flex: none;
  padding: 8px 18px 14px;
  border-top: 1px solid var(--line);
}
.tf-basket-foot > .tf-msgs {
  margin: 0 0 8px;
}
.tf-sum {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tf-sum th {
  padding: 3px 0;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}
.tf-sum td {
  padding: 3px 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tf-sum tr.is-sub th,
.tf-sum tr.is-sub td {
  color: var(--ink);
  font-weight: 700;
}
.tf-sum-pts {
  margin-right: 14px;
  color: var(--muted);
  font-size: 12px;
}
.tf-amount {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: copy;
}
.tf-amount:hover {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.tf-grand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
}
.tf-grand span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tf-grand strong {
  margin-left: auto;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.tf-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 8px;
}
.tf-foot-actions .text-button {
  min-height: 28px;
  padding: 0;
  font-weight: 650;
}
/* Meni "Kopiraj obracun" / "Stampaj": otvara se nagore (dno korpe je pri dnu prozora). */
.tf-docmenu {
  position: relative;
}
.tf-docmenu > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.tf-docmenu > summary::-webkit-details-marker {
  display: none;
}
.tf-docmenu > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.tf-docmenu[open] > summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}
.tf-docmenu-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: grid;
  min-width: 190px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tf-docmenu-pop button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.tf-docmenu-pop button:hover,
.tf-docmenu-pop button:focus-visible {
  background: var(--surface-2);
}
.tf-footnote {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- poruke (samostalni rezim) */
.tf-toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 400;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.tf-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: auto;
}
.tf-toast-warn,
.tf-toast-error {
  border-color: var(--warn);
}

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

/* ---------------------------------------------------------------- uzi ekrani i telefon: jedna kolona */
.tf-mobilebar {
  display: none;
}
@media (max-width: 900px) {
  .tf-root,
  .app-shell .tf-root {
    height: auto;
    min-height: 0;
  }
  .tf-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }
  .tf-entry,
  .tf-sheet {
    overflow: visible;
  }
  .tf-entry-scroll,
  .tf-basket-scroll {
    overflow: visible;
  }
  .tf-new {
    margin-left: 0;
  }
  .tf-mobilebar {
    position: sticky;
    bottom: var(--tf-sticky-bottom, 0px);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .tf-mobilebar span {
    color: var(--muted);
    font-size: 12.5px;
  }
  .tf-mobilebar strong {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
  }
}
@media (max-width: 560px) {
  .tf-bar {
    padding: 10px 12px;
  }
  .tf-title {
    width: 100%;
  }
  .tf-meta-pop {
    width: min(300px, calc(100vw - 48px));
  }
  .tf-entry-scroll {
    padding: 12px 12px 6px;
  }
  .tf-entry-foot {
    padding: 10px 12px 12px;
  }
  .tf-tabs {
    margin: 10px 12px 0;
  }
  .tf-grid2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .tf-item-line {
    grid-template-columns: 20px minmax(0, 1fr) auto 28px;
    gap: 6px;
  }
  .tf-item-pts {
    display: none;
  }
  .tf-item-detail,
  .tf-item-err {
    padding-left: 30px;
    margin-left: 0;
  }
  .tf-grand strong {
    font-size: 19px;
  }
}

/* U aplikaciji je na telefonu dole fiksna traka navigacije; traka sa zbirom stoji iznad nje. */
@media (max-width: 480px), (max-height: 500px) and (max-width: 932px) {
  .app-shell .tf-root {
    --tf-sticky-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------------------------------------------------------------- stampa (A4) */
.tf-print-sheet {
  display: none;
}
@media print {
  @page {
    size: A4;
    margin: 16mm 14mm;
  }
  html:has(body.tf-printing),
  body.tf-printing {
    background: #fff !important;
    color: #000 !important;
  }
  body.tf-printing > *:not(.tf-print-sheet) {
    display: none !important;
  }
  body.tf-printing .tf-print-sheet {
    display: block;
  }
}
.tf-print-sheet {
  color: #000;
  font: 10.5pt/1.4 "Segoe UI", Arial, sans-serif;
}
.tf-print-sheet h1 {
  margin: 2mm 0 4mm;
  font-size: 16pt;
}
.tfp-office {
  font-size: 11pt;
  font-weight: 700;
}
.tf-print-sheet table {
  width: 100%;
  border-collapse: collapse;
}
.tfp-meta {
  margin-bottom: 5mm;
}
.tfp-meta th {
  width: 55mm;
  padding: 1mm 0;
  font-weight: 400;
  text-align: left;
  color: #333;
}
.tfp-meta td {
  padding: 1mm 0;
}
.tfp-items th,
.tfp-items td {
  padding: 1.6mm 1.5mm;
  border: 0.3mm solid #999;
  vertical-align: top;
  text-align: left;
}
.tfp-items thead th {
  background: #eee;
  font-size: 9pt;
}
.tfp-items tr {
  break-inside: avoid;
}
.tfp-calc {
  font-size: 8.5pt;
  color: #333;
}
.tfp-note,
.tfp-warn {
  margin-top: 1mm;
  font-size: 8.5pt;
  color: #333;
}
.tfp-warn {
  font-style: italic;
}
.tfp-num {
  text-align: right !important;
  white-space: nowrap;
}
.tfp-totals {
  width: 60% !important;
  margin: 5mm 0 0 auto;
  break-inside: avoid;
}
.tfp-totals th {
  padding: 1mm 2mm;
  font-weight: 400;
  text-align: left;
}
.tfp-totals td {
  padding: 1mm 2mm;
}
.tfp-totals tr.is-sub th,
.tfp-totals tr.is-sub td {
  border-top: 0.3mm solid #000;
  font-weight: 700;
}
.tfp-totals tr.is-grand th,
.tfp-totals tr.is-grand td {
  border-top: 0.6mm solid #000;
  font-size: 12pt;
  font-weight: 800;
}
.tfp-notes {
  margin-top: 6mm;
  font-size: 8.5pt;
  break-inside: avoid;
}
.tfp-notes ul {
  margin: 1mm 0 0;
  padding-left: 5mm;
}
.tfp-sign {
  display: flex;
  justify-content: space-between;
  gap: 20mm;
  margin-top: 18mm;
  break-inside: avoid;
}
.tfp-sign div {
  flex: 1;
  padding-top: 1.5mm;
  border-top: 0.3mm solid #000;
  font-size: 9pt;
  text-align: center;
}

.tfp-items td:nth-child(3),
.tfp-items th:nth-child(3) {
  white-space: nowrap;
}
