/* Anparo Risk — minimalan, čitljiv UI (mobile-friendly) */
:root {
  --brand: #235a78;
  --brand-light: #e8f1f6;
  --green: #2e9b46;
  --orange: #d98b00;
  --red: #c8372d;
  --border: #d9dee3;
  --bg: #f5f7f9;
  --text: #1d2b35;
}
[x-cloak] { display: none !important; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── login ─────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem; width: 100%; max-width: 360px; box-shadow: 0 4px 24px rgb(0 0 0 / 6%);
}
.login-card h1 { margin: 0 0 .25rem; font-size: 1.4rem; color: var(--brand); }
.login-card .sub { margin: 0 0 1.25rem; color: #66757f; font-size: .9rem; }
.login-card label { display: block; font-weight: 600; font-size: .85rem; margin-top: .75rem; }
.login-card input {
  width: 100%; padding: .55rem .7rem; margin-top: .25rem;
  border: 1px solid var(--border); border-radius: 8px; font-size: 1rem;
}
.login-card button {
  width: 100%; margin-top: 1.25rem; padding: .65rem;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}

/* ── topbar + layout ───────────────────────────────── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--brand); color: #fff; padding: .6rem 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar a { color: #cfe3ee; margin-left: 1rem; text-decoration: none; }
.layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 1rem;
  max-width: 1280px; margin: 1rem auto; padding: 0 1rem;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ── sidebar form ──────────────────────────────────── */
.sidebar {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem; align-self: start;
}
.sidebar h2 { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--brand); }
.sidebar label { display: block; font-size: .82rem; font-weight: 600; margin-top: .6rem; }
.sidebar input, .sidebar textarea, .sidebar select {
  width: 100%; padding: .45rem .6rem; margin-top: .2rem;
  border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: .92rem;
}
.sidebar textarea { resize: vertical; }
.sidebar details { margin-top: .8rem; border-top: 1px dashed var(--border); padding-top: .6rem; }
.sidebar summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.req { color: var(--red); }
.hint { font-size: .78rem; color: #8a949c; margin: .35rem 0 0; }

button.primary {
  width: 100%; margin-top: 1rem; padding: .65rem;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  font-size: .98rem; font-weight: 600; cursor: pointer;
}
button.primary:disabled { opacity: .55; cursor: not-allowed; }

/* ── content ───────────────────────────────────────── */
.content { min-width: 0; padding-bottom: 5rem; }
.empty {
  background: #fff; border: 1px dashed var(--border); border-radius: 12px;
  padding: 2.5rem 1.5rem; text-align: center; color: #66757f;
}
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chip {
  background: var(--brand-light); color: var(--brand);
  border-radius: 999px; padding: .2rem .75rem; font-size: .82rem; font-weight: 600;
}
.chip.ok { background: #e5f4e8; color: var(--green); }

.matched {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: .5rem .8rem; margin-bottom: .9rem; font-size: .88rem;
}
.matched summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.matched table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.matched th, .matched td { text-align: left; padding: .25rem .4rem; border-bottom: 1px solid #eef1f3; }

/* ── kartice ───────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: .6rem; overflow: hidden;
}
.card.inactive { opacity: .55; background: #fafbfc; }
.card-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; }
.card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-title .dim { font-size: .8rem; }
.dim { color: #8a949c; }
.small { font-size: .8rem; }
.nn112 {
  background: #eef3f6; color: #55606a; border-radius: 5px;
  font-size: .72rem; padding: .1rem .45rem; white-space: nowrap;
}
.band { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.band.high { background: var(--green); }
.band.medium { background: var(--orange); }
.band.low { background: var(--red); }
.vr-badge {
  font-weight: 700; font-size: .8rem; border-radius: 6px;
  padding: .15rem .5rem; color: #fff; min-width: 2.2rem; text-align: center;
}
.vr-badge.MR { background: var(--green); }
.vr-badge.SR { background: var(--orange); }
.vr-badge.VR { background: var(--red); }
.card details { border-top: 1px solid #eef1f3; }
.card summary {
  cursor: pointer; padding: .4rem .8rem; font-size: .82rem;
  color: var(--brand); font-weight: 600;
}
.card-body { padding: .4rem .9rem .9rem; }
.card-body label { display: block; font-size: .8rem; font-weight: 600; margin-top: .55rem; }
.card-body input, .card-body textarea, .card-body select {
  width: 100%; padding: .4rem .55rem; margin-top: .2rem;
  border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: .9rem;
}

/* aktivno-switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #c3ccd2; border-radius: 999px;
  transition: .15s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .15s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ── action bar / poruke ───────────────────────────── */
.actionbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; gap: .6rem; align-items: center;
  padding: .6rem 1rem; flex-wrap: wrap;
}
.actionbar button {
  padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.actionbar button.primary { width: auto; margin: 0; background: var(--brand); color: #fff; border: 0; }
.actionbar button:disabled { opacity: .55; cursor: not-allowed; }
.saved { color: var(--green); font-weight: 600; font-size: .88rem; }

.error {
  background: #fdecea; color: var(--red); border: 1px solid #f6c9c5;
  border-radius: 8px; padding: .6rem .9rem; margin-bottom: .75rem; font-size: .9rem;
}
.toast {
  position: fixed; top: 4rem; right: 1rem; z-index: 50;
  background: var(--green); color: #fff; border-radius: 8px;
  padding: .7rem 1rem; font-weight: 600; box-shadow: 0 4px 16px rgb(0 0 0 / 18%);
}
