/* ── Forma za prijavu ── */
.login-zone {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 40px; background: var(--surface);
  max-width: 480px; margin: 0 auto;
}
.login-zone h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.login-zone p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 5px;
}
.form-group input {
  width: 100%; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-dim); }

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

.btn-primary {
  width: 100%; padding: 11px; margin-top: 8px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.login-error {
  margin-top: 12px; padding: 10px 14px;
  background: rgba(255, 80, 80, 0.1); border: 1px solid rgba(255,80,80,0.3);
  border-radius: var(--radius-sm); font-size: 13px; color: #ff6b6b;
  display: none;
}

/* ── Dijalog za podatke platitelja ── */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--overlay-bg);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 36px;
  width: min(460px, 90vw);
  box-shadow: 0 16px 60px var(--panel-shadow);
  transform: translateY(16px); transition: transform 0.25s;
}
.modal-backdrop.open .modal-card { transform: translateY(0); }
.modal-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }

/* ── Traka s filterima datuma ── */
.date-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.date-filter label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.date-filter input[type="text"] {
  padding: 5px 26px 5px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12px;
  outline: none; transition: border-color 0.2s; width: 115px;
}
.date-filter input[type="text"]:focus { border-color: var(--accent); }

/* ── Wrapper za datumske inpute s kalendarom ── */
.date-input-wrap {
  position: relative; display: inline-flex; align-items: center;
}
.date-cal-btn {
  position: absolute; right: 5px;
  background: none; border: none; padding: 0; margin: 0;
  cursor: pointer; color: var(--text-dim);
  display: flex; align-items: center; line-height: 0;
  transition: color 0.15s;
}
.date-cal-btn:hover { color: var(--accent); }
.date-cal-btn svg { width: 13px; height: 13px; }
.date-picker-hidden {
  position: absolute; opacity: 0; pointer-events: none;
  width: 0; height: 0; padding: 0; border: 0; right: 0; top: 0;
}

.btn-refresh {
  padding: 5px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-family: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-refresh:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.btn-refresh svg { width: 13px; height: 13px; }
.btn-refresh.loading { opacity: 0.55; pointer-events: none; }

/* ── Akcijska traka (selekcija) ── */
.action-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 16px;
  background: var(--accent-dim); border: 1px solid var(--accent-glow);
  border-radius: var(--radius-sm); margin-bottom: 12px;
  animation: fadeUp 0.2s ease;
}
.action-bar-left { font-size: 13px; color: var(--accent); font-weight: 600; }
.btn-sepa {
  padding: 8px 18px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-sepa:hover { opacity: 0.88; }
.btn-sepa svg { width: 15px; height: 15px; }
.btn-download {
  padding: 8px 18px; background: #2d7a4f; color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-download:hover { opacity: 0.85; }
.btn-download:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-download svg { width: 15px; height: 15px; }
html.light .btn-download { background: #3a9e65; }
.btn-accept {
  padding: 8px 18px; background: #1a6e3e; color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-accept:hover { opacity: 0.85; }
.btn-accept:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-accept svg { width: 15px; height: 15px; }
html.light .btn-accept { background: #2e9158; }
.btn-reject {
  padding: 8px 18px; background: #7a1a1a; color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-reject:hover { opacity: 0.85; }
.btn-reject:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-reject svg { width: 15px; height: 15px; }
html.light .btn-reject { background: #b03030; }
.btn-reject-confirm {
  padding: 10px 20px; background: #7a1a1a; color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-reject-confirm:hover { opacity: 0.85; }
.btn-reject-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
html.light .btn-reject-confirm { background: #b03030; }
.modal-card select, .modal-card textarea {
  width: 100%; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.modal-card select:focus, .modal-card textarea:focus { border-color: var(--accent); }
.modal-card textarea { resize: vertical; min-height: 70px; }
.modal-card input[type="date"] {
  width: 100%; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.modal-card input[type="date"]:focus { border-color: var(--accent); }

/* ── Checkbox u tablici ── */
.check-col { width: 38px; min-width: 38px; text-align: center; }
.check-col input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent);
}

/* ── Status badge ── */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.status-40 { background: var(--green-dim); color: var(--green); }
.status-30 { background: var(--accent-dim); color: var(--accent); }
.status-20 { background: rgba(255,200,0,0.10); color: #e6c000; }
.status-50 { background: rgba(255,80,80,0.10); color: #ff6b6b; }
.status-70 { background: var(--surface-3); color: var(--text-muted); }

/* ── Poslovni status badge ── */
.proc-status-0  { background: var(--green-dim); color: var(--green); }
.proc-status-1  { background: rgba(255,80,80,0.10); color: #ff6b6b; }
.proc-status-2  { background: rgba(0,180,120,0.12); color: #00b478; }
.proc-status-3  { background: rgba(255,200,0,0.10); color: #e6c000; }
.proc-status-4  { background: var(--accent-dim); color: var(--accent); }
.proc-status-99 { background: var(--surface-3); color: var(--text-muted); }

/* ── Ploča za SEPA pripremu ── */
.sepa-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(1100px, 96vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px var(--panel-shadow);
}
.sepa-panel.open { transform: translateX(0); }

.sepa-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sepa-header h2 { font-size: 16px; font-weight: 700; }

.sepa-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.sepa-date-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.sepa-date-row label { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.sepa-date-row input[type="text"] {
  padding: 6px 28px 6px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none; transition: border-color 0.2s; width: 120px;
}
.sepa-date-row input[type="text"]:focus { border-color: var(--accent); }
.sepa-date-row .date-cal-btn svg { width: 15px; height: 15px; }

/* Tablica za SEPA pripremu */
.sepa-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
.sepa-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sepa-table-wrap thead th {
  padding: 10px 12px; text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.sepa-table-wrap tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; color: var(--text); font-size: 12px;
  vertical-align: middle;
}
.sepa-table-wrap tbody tr:last-child td { border-bottom: none; }
.sepa-table-wrap input[type="text"] {
  padding: 5px 8px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12px;
  outline: none; transition: border-color 0.2s;
  min-width: 110px; width: 100%;
}
.sepa-table-wrap .date-input-wrap input[type="text"] { padding-right: 26px; }
.sepa-table-wrap input:focus { border-color: var(--accent); }
.sepa-table-wrap .date-input-wrap { width: 100%; }
.sepa-table-wrap td.col-ref { min-width: 160px; }
.sepa-table-wrap td.col-date { min-width: 118px; }
.sepa-table-wrap td.col-amount,
.sepa-table-wrap th.col-amount { text-align: right; }

.sepa-loading {
  padding: 48px; text-align: center; color: var(--text-dim); font-size: 14px;
}
.sepa-loading-spinner {
  width: 28px; height: 28px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sepa-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: wrap;
}
.btn-generate {
  background: var(--green); color: var(--bg);
  padding: 10px 22px; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-generate:hover { opacity: 0.88; }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; }
html.light .btn-generate { color: #fff; }
.btn-generate svg { width: 16px; height: 16px; }
.btn-generate-xlsx {
  background: #1d6f42;
}
html.light .btn-generate-xlsx { color: #fff; }

.sepa-total {
  font-size: 13px; color: var(--text-muted); margin-left: auto;
}
.sepa-total strong {
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 14px;
}

/* ── Gumb za postavke u zaglavlju ── */
.header-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
  display: grid; place-items: center;
  color: var(--text-muted); transition: all 0.2s;
}
.header-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.header-btn svg { width: 18px; height: 18px; }

.btn-logout {
  height: 40px; padding: 0 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-family: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Tab switcher (Primljeni / Poslani) ── */
.tab-switcher {
  display: flex; gap: 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px;
}
.tab-btn {
  padding: 6px 16px; border-radius: calc(var(--radius-sm) - 2px);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; background: none;
  color: var(--text-muted); transition: all 0.15s;
  text-decoration: none; display: inline-flex; align-items: center;
}
.tab-btn:hover { color: var(--text); background: var(--surface-3); }
.tab-btn.active {
  background: var(--accent); color: #fff; cursor: default;
}
html.light .tab-btn.active { color: #fff; }

@media (max-width: 768px) {
  .login-zone { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .sepa-panel { width: 100vw; }
}
