* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 { font-size: 1.4rem; font-weight: 700; }
.subtitle { font-size: 0.82rem; opacity: 0.75; }

.header-actions { display: flex; gap: 10px; align-items: center; }

.btn-link {
  color: white;
  text-decoration: none;
  font-size: 0.88rem;
  opacity: 0.85;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-link:hover { background: rgba(255,255,255,0.15); opacity: 1; }

.btn-odjava {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s;
}
.btn-odjava:hover { background: rgba(255,255,255,0.25); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.tab {
  background: none;
  border: none;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab:hover { color: #4a5568; }
.tab.active { color: #2c5282; border-bottom-color: #2c5282; }

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: white;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header-row h2 { margin-bottom: 0; }

/* Forms */
.form-row {
  display: flex;
  gap: 10px;
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="date"] {
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus { border-color: #4299e1; }

.form-row input[type="text"] { flex: 1; }

button {
  padding: 10px 20px;
  background: #2c5282;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover { background: #1a365d; }

.btn-izvoz {
  background: #276749;
}
.btn-izvoz:hover { background: #1c4532; }

/* Filter row */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filter-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4a5568;
}

/* Table */
.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.tabela th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
  border-bottom: 2px solid #e2e8f0;
}
.tabela td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
}
.tabela tr:last-child td { border-bottom: none; }
.tabela tr:hover td { background: #f7fafc; }

/* Pills */
.tip-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tip-pill.PRIHOD { background: #c6f6d5; color: #276749; }
.tip-pill.ODHOD  { background: #fed7d7; color: #9b2c2c; }

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pill.aktiven  { background: #c6f6d5; color: #276749; }
.status-pill.neaktiven { background: #e2e8f0; color: #718096; }

/* Action buttons in table */
.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-danger { background: #e53e3e; }
.btn-danger:hover { background: #c53030; }
.btn-toggle { background: #718096; }
.btn-toggle:hover { background: #4a5568; }
.btn-toggle.aktiviraj { background: #38a169; }
.btn-toggle.aktiviraj:hover { background: #276749; }

/* Inline messages */
.inline-napaka {
  color: #9b2c2c;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}
.inline-uspeh {
  color: #276749;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.badge {
  background: #e2e8f0;
  color: #4a5568;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* PIN management */
.td-pin { min-width: 160px; }

.pin-celica {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pin-koda {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #2c5282;
  background: #ebf4ff;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 2px;
}

.pin-ni { color: #a0aec0; }

.pin-uredi-vrstica {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pin-input {
  width: 70px;
  padding: 6px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  font-family: monospace;
}
.pin-input:focus { border-color: #4299e1; outline: none; }

.btn-pin-uredi { background: #4a5568; font-size: 0.75rem; padding: 4px 10px; }
.btn-pin-uredi:hover { background: #2d3748; }
.btn-pin-shrani { background: #38a169; font-size: 0.75rem; padding: 4px 10px; }
.btn-pin-shrani:hover { background: #276749; }
.btn-pin-brisi { background: #e53e3e; font-size: 0.75rem; padding: 4px 10px; }
.btn-pin-brisi:hover { background: #c53030; }
.btn-pin-preklic { background: #a0aec0; font-size: 0.75rem; padding: 4px 10px; }
.btn-pin-preklic:hover { background: #718096; }

.prazno {
  text-align: center;
  color: #a0aec0;
  padding: 24px;
  font-style: italic;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 200;
  transition: opacity 0.3s;
}
.toast.hidden { display: none; }
.toast.uspeh { background: #276749; }
.toast.napaka { background: #9b2c2c; }

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .filter-row { flex-direction: column; align-items: flex-start; }
}

/* NK badge (naknadno evidentiranje) */
.nk-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fefcbf;
  color: #744210;
  border: 1px solid #f6e05e;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* Pin setup pill */
.pin-setup-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #fc8181;
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.3px;
}

/* Ponastavi PIN gumb */
.btn-pin-ponastavi {
  background: #fff5f5;
  color: #c53030;
  border-color: #fc8181;
}
.btn-pin-ponastavi:hover { background: #fed7d7; }

/* Obračun tab */
.obr-nav-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 20px;
}
.obr-mesec-napis {
  font-size: 1.1rem; font-weight: 700; color: #1a202c;
  min-width: 160px; text-align: center;
}
.btn-nav-obr {
  background: #edf2f7; border: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer; color: #4a5568;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; padding: 0; line-height: 1;
}
.btn-nav-obr:hover { background: #e2e8f0; }
.btn-nav-obr:disabled { opacity: 0.3; cursor: default; }

.th-r { text-align: right; }
.td-r { text-align: right; font-variant-numeric: tabular-nums; }
.td-skupaj { font-weight: 700; color: #2c5282; }
.obr-skupaj-row td { border-top: 2px solid #e2e8f0; background: #f7fafc; }

/* Urna postavka input */
.td-up { min-width: 110px; }
.up-celica { display: flex; align-items: center; gap: 3px; }
.up-euro-znak { color: #4a5568; font-size: 0.88rem; }
.up-input {
  width: 68px; padding: 4px 6px;
  border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: 0.88rem; color: #1a202c;
  outline: none; text-align: right;
}
.up-input:focus { border-color: #4299e1; }
.up-unit { color: #718096; font-size: 0.78rem; }

/* Stimulacija form */
.stim-form-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 6px;
}
.stim-select {
  padding: 7px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 0.9rem; min-width: 160px; outline: none;
}
.stim-input {
  padding: 7px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 0.9rem; width: 110px; outline: none;
}
.stim-input-opomba {
  padding: 7px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 0.9rem; flex: 1; min-width: 120px; outline: none;
}
.stim-select:focus, .stim-input:focus, .stim-input-opomba:focus { border-color: #4299e1; }

.pin-privzet {
  background: #fffaf0 !important;
  color: #c05621 !important;
  border-color: #fbd38d !important;
}

.btn-seed {
  background: #2d3748; color: #e2e8f0; border: 1.5px solid #4a5568;
  padding: 9px 18px; border-radius: 8px; font-size: 0.9rem; cursor: pointer;
}
.btn-seed:hover { background: #4a5568; }
.btn-seed:disabled { opacity: 0.5; cursor: not-allowed; }
