:root {
  --accent: #1e6fd9;
  --bg: #f4f6f9;
  --line: #d9dee6;
  --text: #1f2733;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 4px;
  padding: 8px 14px; font-size: 14px; cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
.link-btn { background: none; color: #4a5568; padding: 4px 8px; }
.link-btn:hover { color: #1f2733; text-decoration: underline; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-box {
  background: #fff; padding: 32px; border-radius: 8px; width: 320px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 20px; margin: 0 0 20px; text-align: center; }
.accent { color: var(--accent); }
.login-box label, .filters label { display: block; font-size: 13px; margin-bottom: 12px; }
.login-box input, .filters input, .filters select {
  width: 100%; padding: 9px; margin-top: 4px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 14px;
}
.login-box button { width: 100%; padding: 10px; }
.remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #334; margin-bottom: 14px; cursor: pointer;
}
.remember input { width: auto; margin: 0; }
.error { color: #c0392b; font-size: 13px; margin: 0 0 12px; }

/* App shell */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: #edf0f4; color: #334; padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.brand-logo { height: 22px; width: auto; display: block; }
.login-logo { display: block; height: 30px; width: auto; margin: 0 auto 18px; }
.topnav { display: flex; gap: 4px; margin-left: 20px; }
.nav-link {
  color: #1f2733; font-weight: 500; padding: 6px 12px; border-radius: 4px; font-size: 14px;
}
.nav-link:hover { color: #1f2733; background: rgba(0,0,0,.06); text-decoration: none; }
.nav-link.active { color: #1f2733; background: rgba(0,0,0,.09); }

/* Nav dropdown (Export ▾) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none; color: #1f2733; padding: 6px 12px; border-radius: 4px;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.nav-dropdown-toggle:hover { color: #1f2733; background: rgba(0,0,0,.06); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 20;
  min-width: 160px; padding: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.nav-dropdown-menu a {
  display: block; color: #334; padding: 8px 12px; border-radius: 4px; font-size: 14px;
}
.nav-dropdown-menu a:hover { color: #1f2733; background: #f0f3f7; text-decoration: none; }
main { max-width: 1000px; margin: 24px auto; padding: 0 18px; }
main.wide { max-width: 1200px; }

.filters {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; padding: 16px; border: 1px solid var(--line); border-radius: 6px;
}
.filters label { margin: 0; }
.filters input, .filters select { width: 220px; }

.grid { width: 100%; border-collapse: collapse; margin-top: 16px; background: #fff; }
.grid th, .grid td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; font-size: 14px; }
.grid th { background: #eef2f7; }
.grid tr:nth-child(even) td { background: #fafbfc; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid tr.blocked td { color: #b0392b; }
.grid td.actions { white-space: nowrap; }
.grid td.actions .sep { color: var(--line); margin: 0 2px; }
.grid td.actions .muted { color: #b0392b; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.btn-link {
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 4px; font-size: 14px;
}
.btn-link:hover { color: #fff; text-decoration: none; opacity: .92; }
.link-ok { background: none; color: #1e874b; padding: 2px 6px; }
.link-ok:hover { text-decoration: underline; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; }

/* Detail card (Detalji kupca) */
.detail-card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 20px; max-width: 560px;
}
.detail-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
.detail-list dt { color: #6b7683; font-size: 13px; }
.detail-list dd { margin: 0; font-size: 14px; }
.detail-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 520px) {
  .detail-list { grid-template-columns: 1fr; gap: 2px 0; }
  .detail-list dd { margin-bottom: 8px; }
}

/* Kupovine page */
.back-link { display: inline-block; margin-bottom: 8px; }
.card-form {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 18px; max-width: 640px;
}
.card-form .frow {
  display: grid; grid-template-columns: 160px 1fr;
  align-items: center; gap: 12px; margin-bottom: 14px;
}
.card-form .frow:last-child { margin-bottom: 0; }
.card-form .frow[hidden] { display: none; }  /* grid display would otherwise override [hidden] */
.card-form .frow > label,
.card-form .frow > .field-label { font-size: 13px; text-align: right; color: #334; }
.card-form input[type="text"],
.card-form input[type="date"],
.card-form input[type="number"] {
  width: 100%; padding: 9px;
  border: 1px solid var(--line); border-radius: 4px; font-size: 14px;
}
.card-form input[readonly] {
  background: #eef1f5; color: #6b7683; cursor: not-allowed;
}
.card-form .field-check { display: flex; align-items: center; gap: 8px; }
.card-form .field-check input { margin: 0; }
.card-form .field-check small { color: #6b7683; }
.card-form .field-check input:disabled { cursor: not-allowed; }
.card-form .field-check input:disabled + small { color: #a0a8b3; font-style: italic; }
@media (max-width: 560px) {
  .card-form .frow { grid-template-columns: 1fr; }
  .card-form .frow > label,
  .card-form .frow > .field-label { text-align: left; }
}
h4#kupacInfo { margin: 4px 0 16px; color: #334; font-weight: 600; }
.link-danger { background: none; color: #c0392b; padding: 2px 6px; }
.link-danger:hover { text-decoration: underline; }
