* { 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-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-panel { display: none; }
#tab-kat:checked ~ .panel-kat,
#tab-leto:checked ~ .panel-leto,
#tab-pol:checked ~ .panel-pol { 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;
}

/* Dashboard kartice - S50ZT */
section.cards.cards-dashboard {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
}

section.cards.cards-dashboard > .card.card-wide {
  grid-column: 1 / -1 !important;
  text-align: center;
  padding: 26px 18px;
}

section.cards.cards-dashboard > .card.card-wide strong {
  font-size: 40px;
  line-height: 1.1;
}

section.cards.cards-dashboard > .card.card-wide span {
  font-size: 16px;
}

@media (max-width: 900px) {
  section.cards.cards-dashboard {
    grid-template-columns: 1fr !important;
  }

  section.cards.cards-dashboard > .card.card-wide {
    grid-column: auto !important;
  }

  section.cards.cards-dashboard > .card.card-wide strong {
    font-size: 32px;
  }
}



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

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.cat-leasing {
  --cat-color: #9333ea;
  --cat-bg: #f3e8ff;
  --cat-text: #6b21a8;
}


.type-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.type-switch label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-switch input {
  width: auto;
}

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

.hint {
  font-size: 14px;
  margin-bottom: 12px;
}

.installment-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}

.btn.danger-soft {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff7f7;
}

@media (max-width: 650px) {
  .type-switch,
  .installment-head {
    flex-direction: column;
    align-items: stretch;
  }

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


.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;
}
