:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #dde1e7;
  --text: #1f2933;
  --text-muted: #5c6773;
  --primary: #1f3a5f;
  --primary-hover: #16294380;
  --accent: #b5651d;
  --danger: #a4333c;
  --success: #2f6b4f;
  --info: #2b5f75;
  --radius: 4px;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Topbar */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--accent);
}

.topbar__brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.topbar__nav a {
  color: #e7ecf2;
}

.topbar__nav a:hover {
  color: #fff;
}

.topbar__user {
  color: #b9c6d6;
}

/* Layout */
.container {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 420px;
}

.container--wide {
  max-width: 1040px;
}

.container--full {
  max-width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.card h1,
.card h2 {
  margin-top: 0;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.login-logo + h1 {
  text-align: center;
}

h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}

.btn:hover {
  background: #16294a;
  text-decoration: none;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #8a2933;
}

/* Flash messages */
.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}

.flash-success {
  background: #eaf3ee;
  border-color: var(--success);
  color: var(--success);
}

.flash-danger {
  background: #f7eaec;
  border-color: var(--danger);
  color: var(--danger);
}

.flash-info {
  background: #eaf1f5;
  border-color: var(--info);
  color: var(--info);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin {
  background: #fdf0e2;
  color: var(--accent);
}

.badge-korisnik {
  background: #e9edf2;
  color: var(--text-muted);
}

.badge-active {
  background: #eaf3ee;
  color: var(--success);
}

.badge-inactive {
  background: #f2f2f2;
  color: #8a8f96;
}

.table-actions {
  display: flex;
  gap: 0.4rem;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1.25rem;
}

/* Filter traka (provjera podataka) */
.filter-bar {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.filter-bar .form-group {
  margin-bottom: 0;
}

.filter-bar input[type="date"],
.filter-bar select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
}

.grid-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.grid-toolbar input[type="text"] {
  width: 260px;
}

/* Rekapitulacija provjere */
.rekap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.8rem;
}

.rekap-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.rekap-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.rekap-card li {
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.rekap-datum {
  color: var(--text-muted);
  font-weight: 600;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #ddd; margin-bottom: 16px; }
.tab-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; }
.tab-btn.active { border-bottom-color: #333; font-weight: 600; }
.filters { display: flex; gap: 16px; align-items: end; margin-bottom: 12px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; font-size: 13px; gap: 2px; }
.muted { color: #888; }