/* Paušalni obrt – dodaci na zajednički app.css (plava tema iz HR Managera / Evidencije rada). */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal.md { max-width: 640px; }
.modal.lg { max-width: 900px; }
.page-wide { max-width: 1400px; }
.ro-banner { display: flex; align-items: center; gap: 8px; background: #fff6dd; color: #8a5d00; border-bottom: 1px solid #f1dfa8; padding: 8px 32px; font-size: 13px; }
body.readonly [data-w] { display: none !important; }

/* Oznake */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.t-blue { background: var(--primary-50); color: var(--primary); }
.t-green { background: var(--green-bg); color: #17654a; }
.t-teal { background: #dcf3f6; color: #116b78; }
.t-amber { background: #fdf3d6; color: #8a5d00; }
.t-violet { background: #ebe7fb; color: #4b3aa6; }
.t-red { background: var(--red-bg); color: #a12f2f; }
.t-gray { background: var(--surface-3); color: var(--text-2); }

/* Alatna traka s godinom */
.year-nav { display: flex; align-items: center; gap: 6px; }
.year-nav .select { width: 100px; }
.tot-row td { font-weight: 700; background: var(--surface-2); }
.tbl tr.sub-row td { background: #f7f9fc; font-weight: 600; color: var(--text-2); }
.tbl tr.dim td { color: var(--muted); }
.tbl td .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.tbl tr.sel td { background: var(--primary-50); }
.tbl td.chk, .tbl th.chk { width: 34px; text-align: center; }

/* Statistika – limit paušala */
.limit-card { padding: 18px 20px; margin-bottom: 22px; }
.limit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.limit-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.limit-bar { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 12px 0 8px; display: flex; }
.limit-bar > span { display: block; height: 100%; }
.limit-bar .b1 { background: linear-gradient(90deg, var(--accent), var(--primary)); }
.limit-bar .b2 { background: #8fb3e0; }
.limit-bar.warn .b1 { background: linear-gradient(90deg, #f0b429, #e3a008); }
.limit-bar.over .b1 { background: linear-gradient(90deg, #ef6b6b, var(--red)); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Pregled */
.dash2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dash2 { grid-template-columns: 1fr; } }
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-list .tl-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.top-list .tl-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top-list .tl-h b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.top-list .tl-b { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.top-list .tl-b span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 999px; }

/* Mjesečni stupci */
.mchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 190px; padding: 8px 4px 0; }
.mchart .mc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.mchart .bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.mchart .bar { width: 42%; max-width: 20px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--primary)); min-height: 2px; position: relative; }
.mchart .bar.prev { background: #cfdbea; }
.mchart .bar.cash { background: linear-gradient(180deg, #7ad3b0, var(--green)); }
.mchart .ml { font-size: 11px; color: var(--muted); }
.mchart .bar:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 3; }

/* Faktura – uređivanje */
.inv-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.inv-head .span-2 { grid-column: span 2; }
.inv-items td { vertical-align: top; padding: 6px 8px; }
.inv-items .input, .inv-items .select { height: 34px; }
.inv-items .num-in { text-align: right; }
.inv-items td.act { width: 40px; }
.inv-sum { display: flex; justify-content: flex-end; margin-top: 14px; }
.inv-sum dl { display: grid; grid-template-columns: auto 140px; gap: 6px 18px; margin: 0; font-size: 14px; }
.inv-sum dt { color: var(--text-2); text-align: right; }
.inv-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inv-sum .tot { font-size: 18px; font-weight: 700; color: var(--text); }
.inv-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pick-item .sub { color: var(--muted); font-size: 12px; }

/* Polje za odabir (autocomplete) */
.ac { position: relative; }
.ac .ac-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; }
.ac .ac-oib { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); pointer-events: none; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; max-height: 300px; overflow-y: auto; padding: 4px; }
.ac-item { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ac-item small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.ac-item.on, .ac-item:hover { background: var(--primary-50); }
.ac-item.muted { cursor: default; background: none; }
.ac-new { color: var(--primary); font-weight: 500; justify-content: flex-start; align-items: center; border-top: 1px solid var(--border); margin-top: 4px; }

/* Veze uplate na fakture */
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-row { display: grid; grid-template-columns: 26px 1fr 110px 120px; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px; }
.link-row.on { border-color: var(--primary-100); background: var(--primary-50); }
.link-row .input { height: 32px; text-align: right; }

/* Korisnici */
.chk-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }

@media (max-width: 900px) {
  .inv-head { grid-template-columns: 1fr 1fr; }
  .mchart { gap: 3px; }
}

/* Knjiga prometa: sklopive mjesečne grupe */
.tbl tr.month-row td { background: linear-gradient(90deg, var(--primary), #3576c4); color: #fff; cursor: pointer; padding-top: 11px; padding-bottom: 11px; border-bottom: 2px solid #fff; user-select: none; }
.tbl tr.month-row:hover td { background: linear-gradient(90deg, var(--primary-600), #2f6bb5); }
.tbl tr.month-row .mr-chev svg { width: 18px; height: 18px; transition: transform .18s; display: block; }
.tbl tr.month-row.closed .mr-chev svg { transform: rotate(-90deg); }
.tbl tr.month-row .mr-name { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.tbl tr.month-row .mr-count { margin-left: 10px; font-size: 12px; opacity: .8; font-weight: 500; }
.tbl tr.month-row .mr-part { font-size: 12.5px; opacity: .85; }
.tbl tr.month-row .mr-tot { font-size: 15px; font-weight: 700; white-space: nowrap; }
