:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --border: #e2e0da;
  --text: #2b2a27;
  --muted: #6b6860;
  --accent: #8a5a3b;
  --accent-dark: #6e4730;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  background: var(--accent-dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

header nav a {
  color: #f1e8de;
  text-decoration: none;
  margin-right: 16px;
  font-size: 0.92rem;
}
header nav a:hover { text-decoration: underline; }

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.filters label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input, select, button {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  width: 100%;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  width: auto;
  padding: 8px 18px;
}
button:hover { background: var(--accent-dark); }

.checkbox-row { display: flex; align-items: center; gap: 6px; }
.checkbox-row input { width: auto; }

.rezultat {
  border-bottom: 1px solid var(--border);
  padding: 12px 4px;
}
.rezultat:last-child { border-bottom: none; }

.rezultat .naziv { font-weight: 600; margin-bottom: 4px; }
.rezultat .meta { font-size: 0.82rem; color: var(--muted); }
.rezultat .meta a { color: var(--accent-dark); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 10px;
  background: #efe6d8;
  color: var(--accent-dark);
  margin-left: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.stat-tile .n { font-size: 1.3rem; font-weight: 700; }
.stat-tile .lbl { font-size: 0.78rem; color: var(--muted); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.pagination button { width: auto; }

.muted { color: var(--muted); font-size: 0.85rem; }

.rezultat .naziv-link { cursor: pointer; }
.rezultat .naziv-link:hover { color: var(--accent-dark); text-decoration: underline; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 28, 24, 0.55);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-box {
  background: var(--panel);
  border-radius: 8px;
  max-width: 760px;
  width: 100%;
  padding: 22px 26px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: auto;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
  border: none;
}
.modal-close:hover { color: var(--text); background: none; }

.modal-naslov {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 28px 8px 0;
}

.modal-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-meta a { color: var(--accent-dark); }

.modal-tekst-sadrzaj {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0;
}
