:root {
  --navy: #1f3a5f; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec; --bg: #f6f7f9;
  --accent: #2f6fd6; --ok: #1d7a46; --err: #b42318; --warn-bg: #fff6e0;
  --dnv: #2f6fd6; --bsi: #d0453b; --utac: #2a9d8f; --tnc: #8a63d2; --dqs: #e0a020; --lsr: #6b7385;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .6rem; } h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
main { padding: 1.5rem 2rem 4rem; max-width: 1200px; }
body.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
body.plain main { margin: 6vh auto; }
nav.side { background: var(--navy); color: #fff; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 0; height: 100vh; }
nav.side a { color: #d7e1f2; padding: .55rem .75rem; border-radius: 8px; }
nav.side a.on, nav.side a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
nav.side .brand { font-weight: 700; font-size: 1.15rem; color: #fff; margin-bottom: 1rem; }
nav.side .brand span { font-weight: 400; opacity: .7; }
nav.side .logout { margin-top: auto; } nav.side .logout button { width: 100%; background: transparent; color: #d7e1f2; border: 1px solid rgba(255,255,255,.25); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 440px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .cols > .card { margin-bottom: 0; } .cols { margin-bottom: 1rem; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.err { color: var(--err); } .ok { color: var(--ok); }
.warn { background: var(--warn-bg); border: 1px solid #f0d58a; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.ok-box { border-color: #b7dfc6; background: #f1faf4; }
label { display: block; margin: .5rem 0; font-size: .9rem; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--ink); border: 1px solid #cfd4dd; border-radius: 8px; background: #fff; }
label.check, .checklist label { display: flex; gap: .5rem; align-items: flex-start; color: var(--ink); }
label.check input, .checklist input { width: auto; margin-top: .2rem; }
button, .btn { display: inline-block; padding: .5rem .9rem; font: inherit; border-radius: 8px; border: 1px solid #cfd4dd; background: #fff; color: var(--ink); cursor: pointer; }
button.primary, .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:hover { text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; align-items: center; }
.filters input, .filters select { width: auto; margin: 0; min-width: 160px; }
.form2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.form2 .wide { grid-column: 1 / -1; } .form2 .actions { margin-top: .75rem; display: flex; gap: 1rem; align-items: center; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
table.grid th, table.grid td { padding: .45rem .55rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid th { font-size: .8rem; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
table.list td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.r { text-align: right !important; }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: .35rem .75rem; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.tag { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: #eef2f8; font-size: .8rem; margin: 0 .2rem .2rem 0; } .tag.major { background: #fde8e7; color: var(--err); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; color: var(--muted); }
.tile span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.qr { width: 220px; height: 220px; display: block; margin: .5rem auto; image-rendering: pixelated; }
.codes { columns: 2; padding-left: 1.2rem; }
.bars { display: flex; align-items: flex-end; gap: .6rem; height: 180px; margin-top: 1rem; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar .stack { flex: 1; width: 70%; display: flex; flex-direction: column-reverse; }
.bar .seg { height: var(--h); } .bar span { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.legend { font-size: .85rem; color: var(--muted); } .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 .3rem 0 .6rem; }
.cb-DNV { background: var(--dnv); } .cb-BSI { background: var(--bsi); } .cb-UTAC { background: var(--utac); }
.cb-TNC { background: var(--tnc); } .cb-DQS { background: var(--dqs); } .cb-LSR { background: var(--lsr); }
form.inline { display: inline; }
code { font-size: .85em; background: #f1f3f6; padding: .05rem .3rem; border-radius: 4px; word-break: break-all; }
@media (max-width: 800px) {
  body.app { grid-template-columns: 1fr; }
  nav.side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; overflow-x: auto; padding: .4rem; z-index: 10; }
  nav.side .brand, nav.side .logout { display: none; }
  nav.side a { white-space: nowrap; font-size: .85rem; }
  main { padding: 1rem 1rem 5rem; }
  .cols, .tiles { grid-template-columns: 1fr; } .form2 { grid-template-columns: 1fr 1fr; }
  dl.kv { grid-template-columns: 1fr; }
}
.alert { background: #fde8e7; border: 1px solid #f3b8b3; color: #7a1a12; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.alert ul { margin: .4rem 0; }
.pre { white-space: pre-line; }
td.wrap { white-space: normal; min-width: 220px; }
.st { padding: 0 .45rem; border-radius: 6px; font-size: .85rem; }
.st-aktiv { background: #e5f4e4; color: #1d5a2e; } .st-ellenorizendo { background: #f9eeda; color: #7a5200; } .st-lezart { background: #f0efec; color: #6b7385; }
.warn ul { margin: .4rem 0 .2rem; }
.q h2 { font-size: 1rem; line-height: 1.4; } .qno { margin: 0 0 .2rem; font-size: .8rem; color: var(--muted); }
details { margin: .3rem 0; } summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.rating { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.rating .opt { display: inline-flex; margin: 0; color: var(--ink); }
.rating .opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating .opt span { padding: .5rem .75rem; border: 1px solid #cfd4dd; border-radius: 999px; font-size: .9rem; cursor: pointer; background: #fff; }
.rating .opt input:checked + span { border-color: var(--ink); font-weight: 600; }
.rating .opt-0 input:checked + span { background: #fde8e7; border-color: #d9534f; }
.rating .opt-1 input:checked + span { background: #fff6e0; border-color: #e0a020; }
.rating .opt-2 input:checked + span { background: #e7f1fb; border-color: var(--accent); }
.rating .opt-3 input:checked + span { background: #e5f4e4; border-color: var(--ok); }
.stickybar { position: sticky; bottom: 0; background: var(--bg); padding: .6rem 0; display: flex; gap: .6rem; z-index: 5; }
.areasel { min-width: 260px; }
@media (max-width: 800px) { .stickybar { bottom: 3.2rem; } }
.subnav { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.subnav a { padding: .3rem .7rem; border-radius: 999px; color: var(--ink); font-size: .9rem; }
.subnav a.on { background: var(--navy); color: #fff; }
.subnav a:hover { text-decoration: none; background: #e9edf3; } .subnav a.on:hover { background: var(--navy); }
.upload input[type=file] { margin: .5rem 0; }
form.catform { display: flex; gap: .3rem; align-items: center; margin: 0; }
form.catform select { margin: 0; width: auto; min-width: 170px; padding: .25rem .4rem; font-size: .85rem; }
form.catform select.overridden { background: #fff6e0; } form.catform select.unknown { border-color: #e0a020; }
button.small { padding: .25rem .5rem; font-size: .8rem; }
.hit { padding: .55rem 0; border-bottom: 1px solid var(--line); } .hit:last-child { border-bottom: 0; }
.hit mark, .pagetext mark { background: #ffe58a; padding: 0 .1em; border-radius: 2px; }
.pagetext { white-space: pre-wrap; font-size: .92rem; line-height: 1.5; }
.filters.search input[name=q] { flex: 1 1 320px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .2rem 1rem; }
.actions { display: flex; gap: .5rem; margin-top: 1rem; }
button.danger { color: #b42318; border-color: #f0b3ad; }
.tag.err { background: #fde8e6; color: #b42318; }
