* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px;
}
.narrow { max-width: 720px; }
header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}
.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
h1 { margin: 0 0 6px; font-size: 30px; }
h2 { margin: 0 0 14px; font-size: 20px; }
p { margin: 0; color: #6b7280; }
.btn {
  display: inline-block;
  border: 1px solid #d1d5db;
  background: white;
  color: #111827;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.btn.primary {
  background: #111827;
  color: white;
  border-color: #111827;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
.card span { display: block; color: #6b7280; font-size: 14px; margin-bottom: 8px; }
.card strong { font-size: 21px; }
.card small { display:block; margin-top:8px; color:#6b7280; line-height:1.35; }
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.custom-range { margin-bottom: 12px; }
input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: white;
}
.tabs {
  margin-bottom: 22px;
}
.tabs > input { display: none; }
.tab-labels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tab-labels label {
  border: 1px solid #d1d5db;
  background: white;
  color: #111827;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
#tab-mesec:checked ~ .tab-labels label[for="tab-mesec"],
#tab-leto:checked ~ .tab-labels label[for="tab-leto"],
#tab-pol:checked ~ .tab-labels label[for="tab-pol"],
#tab-kat:checked ~ .tab-labels label[for="tab-kat"] {
  background: #111827;
  color: white;
  border-color: #111827;
}
.tab-panel { display: none; }
#tab-mesec:checked ~ .panel-mesec,
#tab-leto:checked ~ .panel-leto,
#tab-pol:checked ~ .panel-pol,
#tab-kat:checked ~ .panel-kat { display: block; }
.chart-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
.bars {
  display: grid;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  gap: 10px;
  align-items: center;
}
.bar-label {
  font-weight: 700;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 24px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--cat-color, #111827);
  border-radius: 999px;
}
.bar-value {
  text-align: right;
  font-weight: 700;
  color: #374151;
}
.table-box {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
th {
  background: #f9fafb;
  font-size: 13px;
  text-transform: uppercase;
  color: #6b7280;
  white-space: nowrap;
}
small { color: #6b7280; }
.badge {
  display: inline-block;
  background: var(--cat-bg, #eef2ff);
  color: var(--cat-text, #3730a3);
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.actions {
  white-space: nowrap;
  text-align: right;
}
.actions a {
  margin-left: 10px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
.actions a.danger { color: #dc2626; }
.empty { text-align: center; color: #6b7280; padding: 24px; }
.form {
  background: white;
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}
.form label {
  display: block;
  font-weight: 700;
  margin-bottom: 16px;
}
.form label input,
.form label select { margin-top: 6px; }
.buttons { display: flex; gap: 10px; }
.alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}
footer {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  margin-top: 22px;
}
@media (max-width: 900px) {
  header, .filters { flex-direction: column; align-items: stretch; }
  .cards { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 5px; }
  .bar-value { text-align: left; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .card strong { font-size: 19px; }
}

/* Barve šifrantov */
.cat-lpg {
  --cat-color: #16a34a;
  --cat-bg: #dcfce7;
  --cat-text: #166534;
}
.cat-bencin {
  --cat-color: #f97316;
  --cat-bg: #ffedd5;
  --cat-text: #9a3412;
}
.cat-servis {
  --cat-color: #2563eb;
  --cat-bg: #dbeafe;
  --cat-text: #1e40af;
}
.cat-pnevmatike {
  --cat-color: #374151;
  --cat-bg: #e5e7eb;
  --cat-text: #111827;
}
.cat-registracija {
  --cat-color: #7c3aed;
  --cat-bg: #ede9fe;
  --cat-text: #5b21b6;
}
.cat-zavarovanje {
  --cat-color: #0891b2;
  --cat-bg: #cffafe;
  --cat-text: #155e75;
}
.cat-tehnicni {
  --cat-color: #ca8a04;
  --cat-bg: #fef3c7;
  --cat-text: #854d0e;
}
.cat-vinjeta {
  --cat-color: #db2777;
  --cat-bg: #fce7f3;
  --cat-text: #9d174d;
}
.cat-pranje {
  --cat-color: #0ea5e9;
  --cat-bg: #e0f2fe;
  --cat-text: #075985;
}
.cat-drugo {
  --cat-color: #6b7280;
  --cat-bg: #f3f4f6;
  --cat-text: #374151;
}

/* V3.16 - graf na mobilnih napravah: znesek samo v oklepaju ob šifrantu */
@media (max-width: 760px) {
  .chart-card .bar-value {
    display: none !important;
  }

  .chart-card .bar-label-mobile-value {
    display: inline !important;
    font-weight: 700;
    color: var(--cat-text, #374151);
  }
}

@media (min-width: 761px) {
  .chart-card .bar-label-mobile-value {
    display: none !important;
  }
}

/* V3.16 - ločena mobilna mini tabela: samo datum, registrska, šifrant, znesek, ikoni */
.table-mobile {
  display: none;
}

@media (max-width: 760px) {
  .table-desktop {
    display: none !important;
  }

  .table-mobile {
    display: block !important;
    overflow-x: auto;
  }

  .table-mobile table {
    width: 100%;
    min-width: 390px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
  }

  .table-mobile th,
  .table-mobile td {
    padding: 8px 5px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    white-space: nowrap;
  }

  .table-mobile th:nth-child(1),
  .table-mobile td:nth-child(1) { width: 66px; }

  .table-mobile th:nth-child(2),
  .table-mobile td:nth-child(2) {
    width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
  }

  .table-mobile th:nth-child(3),
  .table-mobile td:nth-child(3) { width: 92px; }

  .table-mobile th:nth-child(4),
  .table-mobile td:nth-child(4) {
    width: 76px;
    text-align: right;
    font-weight: 700;
  }

  .table-mobile th:nth-child(5),
  .table-mobile td:nth-child(5) {
    width: 66px;
    text-align: right;
  }

  .table-mobile .badge {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    padding: 4px 6px;
  }

  .table-mobile .icon-action {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    margin-left: 3px;
  }

  .table-mobile .icon-action svg {
    width: 14px;
    height: 14px;
  }
}

/* V3.17 SAFE PATCH - grafi brez mesečnega prikaza + paginacija */

/* Novi vrstni red zavihkov:
   Po šifrantu | Po letih | Poljubno obdobje */
#tab-kat:checked ~ .tab-labels label[for="tab-kat"],
#tab-leto:checked ~ .tab-labels label[for="tab-leto"],
#tab-pol:checked ~ .tab-labels label[for="tab-pol"] {
  background: #111827;
  color: white;
  border-color: #111827;
}

#tab-kat:checked ~ .panel-kat,
#tab-leto:checked ~ .panel-leto,
#tab-pol:checked ~ .panel-pol {
  display: block;
}

/* Če je v CSS ostal star mesečni tab, ga ta popravek ne uporablja.
   Index.php ne sme več imeti tab-mesec. */

/* Paginacija */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  flex-wrap: wrap;
}

.pagination .disabled {
  opacity: .45;
  cursor: not-allowed;
}

.page-info {
  color: #64748b;
  font-weight: 700;
  font-size: 14px;
}

/* Mobilno: paginacija naj se lepo prelomi */
@media (max-width: 560px) {
  .pagination {
    gap: 8px;
  }

  .pagination .btn {
    padding: 9px 11px;
    font-size: 13px;
  }

  .page-info {
    width: 100%;
    text-align: center;
    order: -1;
  }
}

/* V3.18.1 - ličen okvir obvestila */
.info-note {
  margin: -6px 0 18px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #475569;
  font-size: 14px;
  line-height: 1.4;
}

.info-note a {
  display: inline-block;
  margin-left: 8px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.info-note a:hover {
  text-decoration: underline;
}

/* V3.18.1 - SVG ikone za urejanje in brisanje */
.icon-action {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  margin-left: 6px;
  vertical-align: middle;
}

.icon-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-action.edit {
  color: #2563eb;
}

.icon-action.delete {
  color: #dc2626;
}

.icon-action:hover {
  background: #f8fafc;
}

.actions .icon-action {
  margin-left: 6px;
}

@media (max-width: 760px) {
  .table-mobile .icon-action {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    margin-left: 3px;
  }

  .table-mobile .icon-action svg {
    width: 14px;
    height: 14px;
  }
}

/* V3.18.4 - Strošek/km ločen blok nad karticami, vedno čez celotno širino */
.kpi-km {
  display: block !important;
  width: 100% !important;
  margin: 0 0 14px 0 !important;
}

.kpi-km .card-km-main {
  width: 100% !important;
  text-align: center !important;
  padding: 28px 18px !important;
  border-radius: 16px !important;
}

.kpi-km .card-km-main span {
  display: block !important;
  font-size: 16px !important;
  margin-bottom: 8px !important;
}

.kpi-km .card-km-main strong {
  display: block !important;
  font-size: 42px !important;
  line-height: 1.1 !important;
}

@media (max-width: 900px) {
  .kpi-km .card-km-main strong {
    font-size: 34px !important;
  }
}

/* V3.18.9 SAFE - oranžna ikona Stroški na strani vozil */
.icon-action.costs {
  color: #f97316;
  border-color: #fed7aa;
  background: #fff7ed;
}

.icon-action.costs:hover {
  background: #ffedd5;
}

/* V3.18.9 SAFE - radio gumbi v eni vrstici */
.type-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.type-switch label,
.type-switch .radio-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  width: auto !important;
  line-height: 1.2;
}

.type-switch input[type="radio"],
.form .type-switch input[type="radio"] {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 20px !important;
}

/* V3.18.9 SAFE - form polja na mobilnih napravah */
.form,
.form * {
  box-sizing: border-box;
}

.form input:not([type="radio"]),
.form select,
.form textarea {
  width: 100%;
  max-width: 100%;
}

.form input[type="date"],
.form input[type="text"],
.form input[type="number"],
.form select {
  min-height: 44px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.form-grid label {
  min-width: 0;
}

.period-fields {
  width: 100%;
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .wrap.narrow {
    max-width: 100%;
  }

  .type-switch {
    gap: 12px;
  }

  .type-switch label,
  .type-switch .radio-line {
    width: auto !important;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form input[type="date"],
  .form input[type="text"],
  .form input[type="number"],
  .form select {
    font-size: 16px;
    min-height: 46px;
  }
}

/* V3.18.9 SAFE - paginacija s prvo/zadnjo stranjo */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  flex-wrap: wrap;
}

.pagination .disabled {
  opacity: .45;
  cursor: not-allowed;
}

.page-info {
  color: #64748b;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 560px) {
  .page-info {
    width: 100%;
    text-align: center;
    order: -1;
  }
}

/* V3.18.12 - končni popravek mobilnega obrazca in barve zneska v grafu */

/* Pri grafu naj bo tekst naziva in zneska v oklepaju navadne barve.
   Barvna ostane samo vrstica grafa. */
.bar-row.cat-lpg .bar-label,
.bar-row.cat-bencin .bar-label,
.bar-row.cat-servis .bar-label,
.bar-row.cat-pnevmatike .bar-label,
.bar-row.cat-registracija .bar-label,
.bar-row.cat-zavarovanje .bar-label,
.bar-row.cat-leasing .bar-label,
.bar-row.cat-tehnicni .bar-label,
.bar-row.cat-vinjeta .bar-label,
.bar-row.cat-pranje .bar-label,
.bar-row.cat-drugo .bar-label,
.bar-label-mobile-value {
  color: #374151 !important;
}

/* Stroški ikona: oranžna ikona, ostalo enako kot druge ikone */
.icon-action.costs {
  color: #f97316 !important;
  border-color: #dbe3ef !important;
  background: #ffffff !important;
}

.icon-action.costs:hover {
  background: #f8fafc !important;
}

/* Osnovno: vsa polja v obrazcu ostanejo znotraj kartice */
.form,
.form * {
  box-sizing: border-box;
}

.form input:not([type="radio"]),
.form select,
.form textarea {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}

/* Enotna višina polj */
.form input[type="text"],
.form input[type="number"],
.form input[type="date"],
.form select {
  min-height: 46px;
  height: 46px;
  line-height: 1.2;
  padding: 10px 12px;
}

/* Datumska polja na iOS/Safari ne smejo uhajati čez rob */
.form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 10px;
  overflow: hidden;
}

/* Radio vrstica */
.type-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px !important;
}

.type-switch label,
.type-switch .radio-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  width: auto !important;
  line-height: 1.2;
}

.type-switch input[type="radio"],
.form .type-switch input[type="radio"] {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 20px !important;
}

/* Obdobje od/do */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.form-grid label {
  min-width: 0;
}

.period-fields {
  width: 100%;
  margin-bottom: 0;
}

/* Obroki */
#installmentFields {
  margin-top: 4px;
  margin-bottom: 14px;
}

.installment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px !important;
}

.installment-head h2 {
  margin: 0 !important;
  line-height: 1.2;
}

#installmentFields .hint {
  display: block;
  margin: 0 0 12px !important;
  line-height: 1.35;
}

#installmentRows {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.installment-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 0 !important;
}

.installment-row input {
  margin: 0 !important;
}

.installment-row .btn {
  align-self: stretch;
}

/* Mobilni prikaz */
@media (max-width: 760px) {
  .wrap.narrow {
    max-width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .form {
    overflow: hidden;
  }

  .type-switch {
    gap: 14px;
    margin-bottom: 22px !important;
  }

  .type-switch label,
  .type-switch .radio-line {
    width: auto !important;
    max-width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form input[type="text"],
  .form input[type="number"],
  .form input[type="date"],
  .form select {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px;
    height: 48px;
    font-size: 16px;
  }

  .installment-head {
    align-items: center;
    margin-bottom: 12px !important;
  }

  #installmentFields .hint {
    margin-bottom: 12px !important;
  }

  .installment-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .installment-row .btn {
    justify-self: start;
    align-self: auto;
  }

  #installmentFields + label {
    margin-top: 14px !important;
  }
}

@media (max-width: 430px) {
  .form input[type="text"],
  .form input[type="number"],
  .form input[type="date"],
  .form select {
    min-height: 48px;
    height: 48px;
  }
}

/* V3.18.13 - klik na šifrant v tabeli/grafu + usklajene barve */
.badge-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.badge-link:hover .badge {
  filter: brightness(0.96);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.bar-filter-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
}

.bar-filter-link:hover {
  text-decoration: underline;
}

.bar-row .bar-fill {
  background: var(--cat-color, #111827) !important;
}

.badge.cat-lpg,
.badge.cat-bencin,
.badge.cat-servis,
.badge.cat-pnevmatike,
.badge.cat-registracija,
.badge.cat-zavarovanje,
.badge.cat-leasing,
.badge.cat-tehnicni,
.badge.cat-vinjeta,
.badge.cat-pranje,
.badge.cat-drugo {
  background: var(--cat-bg, #eef2ff) !important;
  color: var(--cat-text, #3730a3) !important;
}

.bar-label,
.bar-filter-link,
.bar-label-mobile-value {
  color: #374151 !important;
}

/* V3.18.14 - graf uporablja povsem enako barvo kot značka šifranta v tabeli */
.bar-row.cat-lpg .bar-fill,
.bar-row.cat-bencin .bar-fill,
.bar-row.cat-servis .bar-fill,
.bar-row.cat-pnevmatike .bar-fill,
.bar-row.cat-registracija .bar-fill,
.bar-row.cat-zavarovanje .bar-fill,
.bar-row.cat-leasing .bar-fill,
.bar-row.cat-tehnicni .bar-fill,
.bar-row.cat-vinjeta .bar-fill,
.bar-row.cat-pranje .bar-fill,
.bar-row.cat-drugo .bar-fill {
  background: var(--cat-bg, #eef2ff) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

/* Pri grafu naj napis ostane temen in čitljiv */
.bar-label,
.bar-filter-link,
.bar-label-mobile-value,
.bar-value {
  color: #374151 !important;
}

/* V3.19 - zelen gumb za nov strošek */
.btn-new-cost,
.btn.primary.btn-new-cost,
.btn-add-user,
.btn.primary.btn-add-user {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22);
}

.btn-new-cost:hover,
.btn.primary.btn-new-cost:hover,
.btn-add-user:hover,
.btn.primary.btn-add-user:hover {
  background: #15803d !important;
  border-color: #15803d !important;
}

/* V3.19 - zavihek Po šifrantu po letih */
#tab-kat-leto:checked ~ .tab-labels label[for="tab-kat-leto"] {
  background: #111827;
  color: white;
  border-color: #111827;
}

#tab-kat-leto:checked ~ .panel-kat-leto {
  display: block;
}

.year-category-groups {
  display: grid;
  gap: 18px;
}

.year-category-group {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.year-category-group h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #111827;
}

/* V3.20 - izbor leta za grafe */
.chart-year-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.035);
}

.chart-year-filter span {
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.chart-year-filter select {
  width: auto;
  min-width: 120px;
}

.chart-subtitle {
  margin: -6px 0 14px;
  color: #64748b;
  font-size: 14px;
}

@media (max-width: 560px) {
  .chart-year-filter {
    align-items: stretch;
  }

  .chart-year-filter span,
  .chart-year-filter select,
  .chart-year-filter .btn {
    width: 100%;
  }
}

/* V3.21 - bolj viden izbor leta za grafe */
.chart-year-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 560px) {
  .chart-year-badge {
    width: 100%;
    justify-content: center;
  }
}

/* V3.23 - filter leta znotraj grafa Po šifrantu po letih */
.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card-head h2 {
  margin-bottom: 6px;
}

.chart-inline-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  min-width: 150px;
}

.chart-inline-filter label {
  display: block;
  font-weight: 700;
  color: #374151;
  font-size: 13px;
  margin: 0;
}

.chart-inline-filter label span {
  display: block;
  margin-bottom: 5px;
}

.chart-inline-filter select {
  min-width: 130px;
}

@media (max-width: 760px) {
  .chart-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-inline-filter,
  .chart-inline-filter label,
  .chart-inline-filter select {
    width: 100%;
  }
}

/* V3.27 - mobilni popravek za graf Po šifrantu po letih */
#tab-kat-leto:checked ~ .panel-kat-leto {
  display: block !important;
}

#tab-kat-leto:checked ~ .tab-labels label[for="tab-kat-leto"] {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
}

.mobile-chart-jump {
  display: none;
}

@media (max-width: 760px) {
  .tab-labels {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-labels label {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  .mobile-chart-jump {
    display: block;
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.035);
  }

  .mobile-chart-jump label {
    display: block;
    font-weight: 800;
    color: #374151;
    margin-bottom: 6px;
  }

  .mobile-chart-jump select {
    width: 100%;
    min-height: 46px;
  }

  .panel-kat-leto .chart-card {
    display: block !important;
    visibility: visible !important;
  }

  .panel-kat-leto .bars {
    display: grid !important;
  }
}

/* V3.28 - mobilno: skrij gumbe za grafe, pusti samo drop-down */
@media (max-width: 760px) {
  .tabs .tab-labels {
    display: none !important;
  }

  .mobile-chart-jump {
    display: block !important;
  }
}

/* V3.29 - vizualni popravki */
.filters .btn,
.filters a.btn,
.custom-range .btn,
.custom-range a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 46px !important;
  line-height: 1.2 !important;
}

@media (max-width: 760px) {
  .filters .btn,
  .filters a.btn,
  .custom-range .btn,
  .custom-range a.btn {
    width: 100% !important;
  }

  .panel-kat-leto .chart-card-head {
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .panel-kat-leto .chart-subtitle {
    margin: 0 0 12px !important;
    line-height: 1.45 !important;
  }

  .panel-kat-leto .chart-inline-filter {
    margin: 2px 0 12px !important;
  }

  .panel-kat-leto .chart-inline-filter label span {
    display: none !important;
  }

  .panel-kat-leto .chart-inline-filter select {
    min-height: 46px !important;
  }
}

/* V3.30 - vizualni popravek filtra leta pri grafu Po šifrantu po letih */
.chart-inline-filter .year-select-no-label span {
  display: none !important;
}

.chart-inline-filter .year-select-no-label select {
  margin-top: 0 !important;
}

@media (max-width: 760px) {

  .panel-kat-leto .chart-inline-filter {
    margin: 4px 0 12px !important;
  }
}

/* V3.32 - gumb Dodaj nov strošek vedno zelen tudi na mobilni verziji */
.btn-new-cost,
.btn.primary.btn-new-cost,
a.btn-new-cost,
a.btn.btn-new-cost,
a.btn.primary.btn-new-cost,
.top-actions .btn-new-cost,
.top-actions .btn.primary.btn-new-cost {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22) !important;
}

.btn-new-cost:hover,
.btn.primary.btn-new-cost:hover,
a.btn-new-cost:hover,
a.btn.btn-new-cost:hover,
a.btn.primary.btn-new-cost:hover,
.top-actions .btn-new-cost:hover,
.top-actions .btn.primary.btn-new-cost:hover {
  background: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

@media (max-width: 760px) {
  .top-actions .btn-new-cost,
  .top-actions .btn.primary.btn-new-cost,
  a.btn.primary.btn-new-cost {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
  }
}


/* V3.33 - dokončna varovalka: gumb Dodaj nov strošek zelen tudi na mobilnem pogledu */
html body .wrap header .top-actions a.btn.primary.btn-new-cost,
html body .wrap header .top-actions a.btn.btn-new-cost,
html body a.btn.primary.btn-new-cost {
  background-color: #16a34a !important;
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22) !important;
}

html body .wrap header .top-actions a.btn.primary.btn-new-cost:hover,
html body .wrap header .top-actions a.btn.btn-new-cost:hover,
html body a.btn.primary.btn-new-cost:hover {
  background-color: #15803d !important;
  background: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

@media (max-width: 760px) {
  html body .wrap header .top-actions a.btn.primary.btn-new-cost,
  html body .wrap header .top-actions a.btn.btn-new-cost,
  html body a.btn.primary.btn-new-cost {
    background-color: #16a34a !important;
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
  }
}


/* V3.36 - prijava in zaščita dostopa */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #f4f6f8;
}

.login-wrap {
  width: 100%;
  max-width: 520px;
}

.login-card {
  width: 100%;
}

.login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.login-brand h1 {
  margin-bottom: 6px;
}

.login-form {
  padding: 22px;
}

.login-buttons {
  align-items: stretch;
}

.login-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.btn-login,
.btn.primary.btn-login {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22);
}

.btn-login:hover,
.btn.primary.btn-login:hover {
  background: #15803d !important;
  border-color: #15803d !important;
}

.success-note {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 700;
}

.setup-warning {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

/* V3.36 - gumb Dodaj nov strošek mora ostati zelen tudi na mobilnem pogledu */
.top-actions .btn-new-cost,
.top-actions a.btn-new-cost,
.top-actions .btn.primary.btn-new-cost,
.top-actions a.btn.primary.btn-new-cost,
header .top-actions .btn-new-cost,
header .top-actions a.btn-new-cost {
  background: #16a34a !important;
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22) !important;
}

.top-actions .btn-new-cost:hover,
.top-actions a.btn-new-cost:hover,
.top-actions .btn.primary.btn-new-cost:hover,
.top-actions a.btn.primary.btn-new-cost:hover,
header .top-actions .btn-new-cost:hover,
header .top-actions a.btn-new-cost:hover {
  background: #15803d !important;
  background-color: #15803d !important;
  border-color: #15803d !important;
}

@media (max-width: 900px) {
  .top-actions .btn-new-cost,
  .top-actions a.btn-new-cost,
  .top-actions .btn.primary.btn-new-cost,
  .top-actions a.btn.primary.btn-new-cost,
  header .top-actions .btn-new-cost,
  header .top-actions a.btn-new-cost {
    background: #16a34a !important;
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
  }
}

@media (max-width: 560px) {
  .login-page {
    align-items: flex-start;
  }

  .login-wrap {
    padding-top: 24px;
  }

  .login-buttons {
    flex-direction: column;
  }

  .login-buttons .btn {
    width: 100%;
  }
}


/* V3.37 - stran Uporabniki */
.users-table-box {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .top-actions .btn {
    width: 100%;
    text-align: center;
  }
}


/* V3.38 - gumb Odjava in urejanje uporabnikov */
.btn-logout,
a.btn-logout,
.top-actions .btn-logout,
header .top-actions .btn-logout {
  background: #dc2626 !important;
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .18) !important;
}

.btn-logout:hover,
a.btn-logout:hover,
.top-actions .btn-logout:hover,
header .top-actions .btn-logout:hover {
  background: #b91c1c !important;
  background-color: #b91c1c !important;
  border-color: #b91c1c !important;
}

.user-form-title {
  margin: 0 0 14px;
  font-size: 18px;
  color: #111827;
}

.users-table-box .actions {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .users-table-box {
    overflow-x: auto;
  }

  .users-table-box table {
    min-width: 640px;
  }
}


/* V3.39 - uporabniki: checkbox v isti vrstici in vedno vidna ikona za brisanje */
.user-active-line,
.form label.user-active-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  width: auto !important;
  margin: 0 0 16px !important;
  line-height: 1.2 !important;
}

.user-active-line input[type="checkbox"],
.form .user-active-line input[type="checkbox"] {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 20px !important;
}

.icon-action.disabled,
.icon-action.disabled:hover {
  opacity: .35 !important;
  cursor: not-allowed !important;
  background: #ffffff !important;
}

.users-table-box .icon-action.delete {
  color: #dc2626 !important;
}

/* V3.40 - vezava uporabnikov na vozila */
.vehicle-access-box {
  margin: 2px 0 18px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}

.vehicle-access-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.vehicle-access-head strong {
  color: #111827;
  font-size: 15px;
}

.vehicle-access-head span,
.vehicle-access-list .muted,
.muted {
  color: #64748b;
  font-size: 13px;
}

.vehicle-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.vehicle-check-line,
.form label.vehicle-check-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  width: auto !important;
  font-weight: 700;
  color: #374151;
  line-height: 1.25;
}

.vehicle-check-line input[type="checkbox"],
.form .vehicle-check-line input[type="checkbox"] {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 20px !important;
}

.vehicle-access-list {
  max-width: 280px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .vehicle-check-grid {
    grid-template-columns: 1fr;
  }

  .users-table-box table {
    min-width: 760px;
  }
}


/* V3.41 - vozila pri uporabniku: eno vozilo v svoji vrstici, registrska krepko, opis normalno */
.vehicle-check-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.vehicle-check-line,
.form label.vehicle-check-line {
  display: flex !important;
  align-items: flex-start !important;
  width: 100% !important;
  gap: 10px !important;
  padding: 2px 0 !important;
  white-space: normal !important;
}

.vehicle-check-line input[type="checkbox"],
.form .vehicle-check-line input[type="checkbox"] {
  margin-top: 2px !important;
}

.vehicle-check-text {
  display: block !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.vehicle-check-text strong {
  display: block !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

.vehicle-check-text span {
  display: block !important;
  font-weight: 400 !important;
  color: #374151 !important;
}


/* V3.42 - vozila pri uporabniku v eni vrstici: registrska oznaka • opis */
.vehicle-check-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.vehicle-check-line,
.form label.vehicle-check-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
  gap: 10px !important;
  padding: 2px 0 !important;
  white-space: normal !important;
}

.vehicle-check-line input[type="checkbox"],
.form .vehicle-check-line input[type="checkbox"] {
  margin-top: 0 !important;
  flex: 0 0 20px !important;
}

.vehicle-check-text {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.vehicle-check-text strong,
.vehicle-check-text > span,
.vehicle-reg,
.vehicle-separator,
.vehicle-desc {
  display: inline !important;
}

.vehicle-reg {
  font-weight: 600 !important;
  color: #111827 !important;
}

.vehicle-separator {
  margin: 0 6px !important;
  color: #6b7280 !important;
  font-weight: 400 !important;
}

.vehicle-desc {
  font-weight: 400 !important;
  color: #374151 !important;
}


/* V3.45 - primarno vozilo uporabnika */
.primary-vehicle-select,
.form label.primary-vehicle-select {
  display: block !important;
  margin: 14px 0 0 !important;
  font-weight: 700 !important;
  color: #374151 !important;
}

.primary-vehicle-select select {
  margin-top: 6px !important;
}

/* V3.46 - vloge uporabnikov */
.role-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.role-administrator {
  background: #ede9fe;
  color: #5b21b6;
}

.role-uporabnik {
  background: #e0f2fe;
  color: #075985;
}

.role-note {
  margin: 0 0 16px !important;
}

.vehicle-check-line input[disabled] {
  opacity: .75;
}


/* V3.47 - e-naslov in ponastavitev gesla */
.login-help {
  margin-top: 14px;
  text-align: center;
}

.login-help a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.login-help a:hover {
  text-decoration: underline;
}

input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: white;
}

.form input[type="email"] {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 46px;
  height: 46px;
  line-height: 1.2;
  padding: 10px 12px;
}

@media (max-width: 760px) {
  .form input[type="email"] {
    min-height: 48px;
    height: 48px;
    font-size: 16px;
  }
}


/* V3.48 - Uporabniki: najprej tabela čez celotno širino, obrazec šele po kliku */
.users-page {
  min-height: 100vh;
  background: #f4f6f8;
}

.users-wrap {
  width: 100%;
  max-width: 1280px !important;
  margin: 0 auto;
  padding: 28px 16px;
}

.users-card {
  width: 100%;
}

.users-page .login-brand {
  text-align: left;
  margin-bottom: 18px;
}

.users-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}

.users-count-note {
  margin: 0 !important;
  text-align: left !important;
}

.users-table-box {
  width: 100%;
  margin: 0 0 22px !important;
}

.user-form-panel {
  margin-top: 22px;
}

.btn-add-user,
.btn.primary.btn-add-user,
a.btn.primary.btn-add-user {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
}

.btn-add-user:hover,
.btn.primary.btn-add-user:hover,
a.btn.primary.btn-add-user:hover {
  background: #030712 !important;
  border-color: #030712 !important;
}

@media (max-width: 760px) {
  .users-page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .users-page-actions .top-actions,
  .users-page-actions .btn {
    width: 100%;
  }

  .users-page .login-brand {
    text-align: left;
  }
}

/* V3.50 - dokončna varovalka: gumb Dodaj uporabnika zelen v vseh pogledih */
html body .users-page-actions .top-actions a.btn.primary.btn-add-user,
html body .users-page-actions .top-actions a.btn.btn-add-user,
html body a.btn.primary.btn-add-user,
html body a.btn.btn-add-user,
.btn-add-user,
.btn.primary.btn-add-user,
a.btn-add-user,
a.btn.primary.btn-add-user {
  background: #16a34a !important;
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22) !important;
}

html body .users-page-actions .top-actions a.btn.primary.btn-add-user:hover,
html body .users-page-actions .top-actions a.btn.btn-add-user:hover,
html body a.btn.primary.btn-add-user:hover,
html body a.btn.btn-add-user:hover,
.btn-add-user:hover,
.btn.primary.btn-add-user:hover,
a.btn-add-user:hover,
a.btn.primary.btn-add-user:hover {
  background: #15803d !important;
  background-color: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

@media (max-width: 900px) {
  html body .users-page-actions .top-actions a.btn.primary.btn-add-user,
  html body .users-page-actions .top-actions a.btn.btn-add-user,
  html body a.btn.primary.btn-add-user,
  html body a.btn.btn-add-user,
  .btn-add-user,
  .btn.primary.btn-add-user,
  a.btn-add-user,
  a.btn.primary.btn-add-user {
    background: #16a34a !important;
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
  }
}



/* V3.53 uporabniki/vozila gumbi */
.users-page-actions .top-actions a[href="index.php"]{
  background:#111827 !important;
  color:#fff !important;
  border-color:#111827 !important;
}

.btn-add-user,
.btn.primary.btn-add-user,
.btn-add-vehicle,
.btn.primary.btn-add-vehicle{
  background:#16a34a !important;
  color:#fff !important;
  border-color:#16a34a !important;
}

.btn-add-user:hover,
.btn.primary.btn-add-user:hover,
.btn-add-vehicle:hover,
.btn.primary.btn-add-vehicle:hover{
  background:#15803d !important;
  border-color:#15803d !important;
}

/* V3.56 - poenotena glava strani in akcijski gumbi na vseh podstraneh */
.page-header,
header.page-header,
.wrap > header.page-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-bottom: 22px !important;
}

.page-title {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.page-title h1,
.page-header h1 {
  margin: 0 0 6px !important;
}

.page-title p,
.page-header p {
  margin: 0 !important;
  color: #6b7280 !important;
  line-height: 1.4 !important;
}

.page-actions,
.page-header .top-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.page-actions .btn,
.page-header .top-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.btn-page-back,
a.btn-page-back,
.page-actions .btn-page-back {
  background: #111827 !important;
  background-color: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
}

.btn-page-back:hover,
a.btn-page-back:hover,
.page-actions .btn-page-back:hover {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
}

.btn-add-user,
.btn.primary.btn-add-user,
.btn-add-vehicle,
.btn.primary.btn-add-vehicle,
a.btn-add-user,
a.btn.primary.btn-add-user,
a.btn-add-vehicle,
a.btn.primary.btn-add-vehicle {
  background: #16a34a !important;
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .22) !important;
}

.btn-add-user:hover,
.btn.primary.btn-add-user:hover,
.btn-add-vehicle:hover,
.btn.primary.btn-add-vehicle:hover,
a.btn-add-user:hover,
a.btn.primary.btn-add-user:hover,
a.btn-add-vehicle:hover,
a.btn.primary.btn-add-vehicle:hover {
  background: #15803d !important;
  background-color: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.users-card .login-brand {
  text-align: left !important;
}

.users-count-note {
  text-align: left !important;
  margin: 10px 0 0 !important;
}

@media (max-width: 900px) {
  .page-header,
  header.page-header,
  .wrap > header.page-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .page-actions,
  .page-header .top-actions {
    width: 100% !important;
    justify-content: stretch !important;
  }

  .page-actions .btn,
  .page-header .top-actions .btn {
    flex: 1 1 0 !important;
  }
}

@media (max-width: 560px) {
  .page-actions,
  .page-header .top-actions {
    flex-direction: column !important;
  }

  .page-actions .btn,
  .page-header .top-actions .btn {
    width: 100% !important;
  }
}

