/* Avenor admin-panel */
:root {
  --blue: #1a8cff;
  --blue-2: #6cb8ff;
  --bg: #07090d;
  --panel: #0e1117;
  --card: #12161e;
  --raise: #181d27;
  --text: #eef2f8;
  --muted: #8a94a7;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --green: #2fd27a;
  --red: #ff5a5a;
  --amber: #ffb547;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: radial-gradient(900px 500px at 100% -10%, rgba(26, 140, 255, .07), transparent 60%), var(--bg);
  color: var(--text);
  font: 400 14px/1.5 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-2); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px -6px rgba(26, 140, 255, .7); }
.btn.primary:hover { background: #0f7ef0; }
.btn.ghost { background: var(--raise); border-color: var(--line-2); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .22); }
.btn.green { background: rgba(47, 210, 122, .14); border-color: rgba(47, 210, 122, .35); color: var(--green); }
.btn.red { background: rgba(255, 90, 90, .12); border-color: rgba(255, 90, 90, .35); color: #ff8a8a; }
.btn.green:hover { background: rgba(47, 210, 122, .22); }
.btn.red:hover { background: rgba(255, 90, 90, .2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  width: 100%; padding: 9px 12px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); border-radius: 10px;
  outline: 0; transition: border-color .15s, box-shadow .15s; resize: vertical;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 140, 255, .18); }
select { width: auto; cursor: pointer; }
/* browserens egne lister (dropdown, dato) i mørkt tema */
:root { color-scheme: dark; }
#modal-fields input, #modal-fields select, #modal-fields textarea, .filters input, .filters select { color: var(--text); font-weight: 400; text-transform: none; letter-spacing: 0; }
select option, select optgroup { background: #12161e; color: var(--text); }
select option:checked { background: var(--blue); color: #fff; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---------- login ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card {
  width: 100%; max-width: 380px; padding: 40px 32px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: 0 40px 100px -40px rgba(26, 140, 255, .35);
}
.gate-card img { width: 72px; margin: 0 auto 16px; }
.gate-card h1 { font-size: 22px; font-weight: 800; }
.gate-card p { margin: 8px 0 24px; color: var(--muted); }
.gate-card .btn { width: 100%; height: 42px; margin-top: 8px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px; background: var(--panel); border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--text); font-size: 15px; }
.logo img { width: 30px; }
.logo b { font-weight: 800; }
.side nav { display: grid; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.side nav a svg { width: 18px; height: 18px; }
.side nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side nav a.active { background: rgba(26, 140, 255, .12); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
.side nav em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.side nav em.hot:not(:empty) { padding: 1px 7px; border-radius: 10px; background: var(--blue); color: #fff; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.me img { width: 32px; height: 32px; border-radius: 50%; }
.me div { min-width: 0; flex: 1; }
.me b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.me a { color: var(--muted); display: grid; }
.me a svg { width: 18px; }

.main { min-width: 0; padding: 0 28px 40px; }
.top { display: flex; align-items: center; gap: 14px; padding: 22px 0; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, transparent); }
.top h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.top p { color: var(--muted); font-size: 13px; }
.burger { display: none; background: none; border: 0; width: 34px; height: 34px; cursor: pointer; }
.burger span { display: block; height: 2px; margin: 6px; background: var(--text); }
.server-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.server-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.server-chip.on i { background: var(--green); box-shadow: 0 0 10px var(--green); }
.server-chip.off i { background: var(--red); }

/* ---------- kort ---------- */
.card { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.flush { padding: 0; overflow: auto; }
.card h2 { font-size: 15px; font-weight: 700; }
.card > .muted { margin: 4px 0 12px; font-size: 13px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head a { font-size: 12px; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; overflow: hidden; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { display: block; margin: 6px 0 2px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.accent { background: linear-gradient(135deg, rgba(26, 140, 255, .2), rgba(26, 140, 255, .04)); border-color: rgba(26, 140, 255, .3); }

.feed { list-style: none; }
.feed li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed .dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--blue); }
.feed .dot.ban, .feed .dot.denied { background: var(--red); }
.feed .dot.kick, .feed .dot.warn, .feed .dot.mute { background: var(--amber); }
.feed .dot.approved { background: var(--green); }
.feed b { font-weight: 600; }
.feed p { color: var(--muted); font-size: 12px; }
.feed .when { margin-left: auto; flex-shrink: 0; color: var(--muted); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- tabel ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { max-width: 360px; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table tbody tr.click { cursor: pointer; }
.table td:last-child { text-align: right; }
.id { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--raise); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--raise); color: var(--muted); }
.pill.blue { background: rgba(26, 140, 255, .15); color: var(--blue-2); }
.pill.red { background: rgba(255, 90, 90, .15); color: #ff8a8a; }
.pill.green { background: rgba(47, 210, 122, .15); color: var(--green); }
.pill.amber { background: rgba(255, 181, 71, .15); color: var(--amber); }
.ping { font-variant-numeric: tabular-nums; color: var(--muted); }
.ping.bad { color: var(--amber); }

/* ---------- ansøgninger ---------- */
.tabs, .segment { display: inline-flex; padding: 3px; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.tabs button, .segment button { padding: 7px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.tabs button.active, .segment button.active { background: var(--raise); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.tabs:empty { display: none; }
.app-top .pill + .pill { margin-left: 6px; }
.pill.type-politi { background: rgba(61, 123, 255, .16); color: #8fb1ff; }
.pill.type-ems { background: rgba(255, 77, 106, .14); color: #ff9aab; }
.pill.type-whitelist { background: rgba(255, 255, 255, .06); color: var(--muted); }
.tabs em { font-style: normal; margin-left: 4px; color: var(--blue-2); }
.segment { margin-top: 6px; }

.apps { display: grid; gap: 12px; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.app-card.new { border-color: rgba(26, 140, 255, .45); box-shadow: 0 0 0 3px rgba(26, 140, 255, .1); }
.app-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.app-top img { width: 38px; height: 38px; border-radius: 50%; }
.app-top div { min-width: 0; }
.app-top b { display: block; }
.app-top small { color: var(--muted); font-size: 12px; }
.app-top .pill { margin-left: auto; }
.app-body { padding: 0 16px 16px; display: none; }
.app-card.open .app-body { display: block; }
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa div { padding: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 10px; }
.qa .wide { grid-column: 1 / -1; }
.qa span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.qa p { white-space: pre-wrap; word-break: break-word; }
.decision { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--raise); color: var(--muted); font-size: 13px; }

/* ---------- skuffe ---------- */
.drawer-bg, .modal-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(440px, 100%); overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line-2);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.drawer.open { transform: none; }
.d-head { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.d-head h2 { font-size: 18px; }
.d-head p { color: var(--muted); font-size: 13px; }
.d-head button { margin-left: auto; }
.d-sec { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.d-sec h3 { margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.facts div { padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.facts span { display: block; color: var(--muted); font-size: 11px; }
.facts b { font-variant-numeric: tabular-nums; word-break: break-all; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ids { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); display: grid; gap: 4px; word-break: break-all; }

/* ---------- dialog ---------- */
.modal-bg { display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { width: 100%; max-width: 420px; padding: 22px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .18s; }
.modal h2 { font-size: 17px; }
.modal .muted { margin: 4px 0 14px; }
#modal-fields { display: grid; gap: 10px; }
#modal-fields label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  width: 320px; max-width: calc(100vw - 32px); padding: 12px 14px;
  background: var(--raise); border: 1px solid var(--line-2); border-left: 3px solid var(--blue); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: slide .25s;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast b { display: block; font-size: 13px; }
.toast p { color: var(--muted); font-size: 12px; }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* ---------- overvågning ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; padding: 0; border-radius: 20px; background: var(--raise); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked { background: var(--blue); border-color: var(--blue); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }
.switch input:focus { box-shadow: none; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.screen { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, transform .15s; }
.screen:hover { border-color: rgba(26, 140, 255, .5); transform: translateY(-2px); }
.screen .shot { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.screen .shot .live { position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.screen .meta { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.screen .meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen .meta small { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }

.viewer-bg { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .8); backdrop-filter: blur(6px); animation: fade .15s; }
.viewer { width: min(1280px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-head div { margin-right: auto; }
.viewer-head b { display: block; }
.viewer-head small { color: var(--muted); font-size: 12px; }
.viewer-img { position: relative; aspect-ratio: 16 / 9; background: #000; }
.viewer-img img, .viewer-img video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.viewer-img video { position: absolute; inset: 0; }
.mode-pill { padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.mode-pill.video { background: rgba(47, 210, 122, .15); color: var(--green); }
.mode-pill.photo { background: rgba(255, 181, 71, .15); color: var(--amber); }
.rec-badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(255, 60, 60, .9); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .05em; font-variant-numeric: tabular-nums; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.viewer-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(0, 0, 0, .5); }

.d-shot { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000 center / cover no-repeat; border: 1px solid var(--line); cursor: zoom-in; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.inv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 220px; overflow-y: auto; }
.inv div { display: flex; justify-content: space-between; gap: 6px; padding: 7px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.inv span { color: var(--muted); font-variant-numeric: tabular-nums; }
.actions .btn[disabled] { opacity: .35; }
.res-card { margin-top: 14px; }
.card-head.pad { padding: 14px 16px 4px; gap: 12px; }
.card-head.pad .search { max-width: 240px; }
.state { font-size: 12px; font-weight: 600; }
.state.started { color: var(--green); }
.state.stopped { color: var(--red); }

/* ---------- spillersøgning ---------- */
.search.big { max-width: 520px; height: 42px; font-size: 14px; }
.lookup { display: grid; gap: 12px; }
.lk { padding: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line-2); border-radius: var(--radius); }
.lk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lk-head h3 { font-size: 16px; }
.lk-head .muted { font-size: 13px; }
.lk-head .row { margin: 0 0 0 auto; }
.lk-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.lk-facts div { padding: 10px 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 10px; }
.lk-facts span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.lk-facts b { font-size: 13px; word-break: break-all; }
.lk details { margin-top: 12px; }
.lk summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- live kort ---------- */
.map-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 14px; height: calc(100vh - 130px); min-height: 480px; }
.map { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line-2); background: #0f2a3d; cursor: grab; touch-action: none; }
.map:active { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-world img { position: absolute; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.blip { position: absolute; z-index: 2; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(26, 140, 255, .3), 0 2px 8px rgba(0, 0, 0, .6); cursor: pointer; transition: left .9s linear, top .9s linear; }
.blip.police { background: #3d7bff; } .blip.ambulance { background: #ff4d6a; } .blip.mechanic { background: #ffb547; }
.blip.sel { box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 2px 8px rgba(0, 0, 0, .6); }
.blip span { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 2px 7px; border-radius: 6px; background: rgba(5, 7, 11, .85); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.map-side { display: flex; flex-direction: column; min-height: 0; }
.map-list { list-style: none; margin-top: 10px; overflow-y: auto; flex: 1; }
.map-list li { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.map-list li:hover { background: rgba(255, 255, 255, .04); }
.map-list i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.map-list i.police { background: #3d7bff; } .map-list i.ambulance { background: #ff4d6a; } .map-list i.mechanic { background: #ffb547; }
.map-list small { margin-left: auto; color: var(--muted); }
.map-hint { margin-top: 10px; font-size: 11px; }
@media (max-width: 1000px) { .map-wrap { grid-template-columns: 1fr; height: auto; } .map { height: 60vh; } .map-side { max-height: 320px; } }

/* ---------- log og rettigheder ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 14px; }
.filters label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.filters select { width: 100%; }
.filter-actions { display: flex; gap: 8px; }
.log-tabs { margin-bottom: 14px; }
.table td.wrap { white-space: normal; min-width: 200px; }
.perm-intro { margin-bottom: 14px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.perm-group h3 { margin-bottom: 8px; font-size: 13px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.perm-row:first-of-type { border-top: 0; }
.perm-row span { font-size: 13px; }
.perm-row small { display: block; color: var(--muted); font-size: 11px; font-family: ui-monospace, Consolas, monospace; }
.perm-row select { min-width: 130px; }
.notice-bar { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .35); background: rgba(255, 181, 71, .08); color: #ffd28a; font-size: 13px; }
.role-chip { display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 6px; background: rgba(26, 140, 255, .15); color: var(--blue-2); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- moderne lag ---------- */
:root {
  --bg: #05070b;
  --panel: rgba(13, 16, 23, .82);
  --card: rgba(255, 255, 255, .028);
  --raise: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --radius: 16px;
}
body {
  background:
    radial-gradient(1100px 600px at 85% -15%, rgba(26, 140, 255, .14), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(88, 101, 242, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -.005em;
}
.side { background: var(--panel); backdrop-filter: blur(20px); border-right-color: var(--line); padding: 20px 14px; }
.logo { padding-bottom: 26px; }
.logo img { filter: drop-shadow(0 4px 14px rgba(26, 140, 255, .45)); }
.side nav a { padding: 10px 12px; font-size: 13.5px; }
.side nav a.active { background: linear-gradient(90deg, rgba(26, 140, 255, .2), rgba(26, 140, 255, .04)); box-shadow: inset 2px 0 0 var(--blue); }
.side nav a.active svg { color: var(--blue-2); }
.me { background: rgba(255, 255, 255, .03); }
.me small { text-transform: none; line-height: 1.5; }
.me small a { color: var(--blue-2); text-transform: none; }

.top { padding: 26px 0 22px; background: linear-gradient(var(--bg) 60%, transparent); }
.top h1 { font-size: 26px; letter-spacing: -.025em; }
.server-chip { background: rgba(255, 255, 255, .03); backdrop-filter: blur(10px); padding: 7px 14px; }

.card, .kpi, .app-card, .screen {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border-color: var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -30px rgba(0, 0, 0, .8);
}
.card h2 { font-size: 14px; letter-spacing: -.01em; }

.kpi { padding: 20px 20px 18px; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(26, 140, 255, .14), transparent 70%); }
.kpi span { text-transform: uppercase; letter-spacing: .07em; font-size: 11px; }
.kpi b { font-size: 34px; margin-top: 10px; background: linear-gradient(180deg, #fff, #a9bbd4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.accent { background: linear-gradient(135deg, rgba(26, 140, 255, .28), rgba(26, 140, 255, .05)); border-color: rgba(26, 140, 255, .35); }
.kpi.accent::after { background: radial-gradient(circle, rgba(108, 184, 255, .3), transparent 70%); }

.table th { background: rgba(255, 255, 255, .015); }
.table td { padding: 13px 16px; }
.table tbody tr:hover { background: rgba(26, 140, 255, .05); }
.id { background: rgba(26, 140, 255, .12); color: var(--blue-2); }

.btn { border-radius: 10px; letter-spacing: -.005em; }
.btn.primary { background: linear-gradient(135deg, #3aa0ff, #1a8cff 55%, #0a6ad8); }
.btn.ghost { background: rgba(255, 255, 255, .04); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }

.drawer { background: rgba(10, 13, 19, .96); backdrop-filter: blur(24px); }
.d-head { padding: 22px 20px; background: linear-gradient(180deg, rgba(26, 140, 255, .1), transparent); }
.actions .btn { height: 38px; }
.screen .shot { border-bottom: 1px solid var(--line); }
.modal, .viewer { background: rgba(12, 15, 22, .97); backdrop-filter: blur(24px); }
.toast { background: rgba(20, 25, 35, .95); backdrop-filter: blur(16px); }

/* ---------- topbar (som på tabletten) ---------- */
.app { display: flex; flex-direction: column; }
.side {
  position: sticky; top: 0; z-index: 20; height: auto; transform: none;
  flex-direction: row; align-items: center; gap: 12px;
  padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 23, .9); backdrop-filter: blur(20px) saturate(1.3);
}
.side::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--blue), transparent); opacity: .7; }
.logo { padding: 0; flex-shrink: 0; }
.logo img { width: 40px; height: 40px; }
.logo span { font-size: 14px; }
.side nav { display: flex; flex: 1; justify-content: space-between; gap: 3px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.side nav::-webkit-scrollbar { display: none; }
.side nav a { position: relative; flex-shrink: 0; min-height: 42px; padding: 0 13px; gap: 7px; border-radius: 9px; font-size: 14px; white-space: nowrap; box-shadow: none; }
.side nav a svg { width: 20px; height: 20px; }
.side nav a .lbl { display: none; }
.side nav a.active { background: var(--blue); color: #fff; box-shadow: 0 6px 18px -8px rgba(26, 140, 255, .8); }
.side nav a.active svg { color: #fff; }
.side nav a.active .lbl { display: inline; }
.side nav a:not(.active):hover { background: rgba(255, 255, 255, .06); }
.side nav a[data-tip]:not(.active):hover::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 5px 9px; border-radius: 7px; background: #1b212c; border: 1px solid var(--line-2);
  color: var(--text); font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 30;
}
.side nav em { position: absolute; top: 4px; right: 4px; margin: 0; }
.side nav a.active em { position: static; }
.side nav em:not(.hot) { display: none; }
.side nav a.active em:not(.hot) { display: inline; color: rgba(255, 255, 255, .8); }
.me { margin: 0; flex-shrink: 0; padding: 4px 6px 4px 4px; border-radius: 99px; gap: 8px; }
.me img { width: 32px; height: 32px; }
.me div { max-width: 170px; }
.top { position: static; padding: 24px 0 18px; background: none; }
.burger { display: none !important; }

/* ---------- graf og statuskort ---------- */
.dash-row { display: grid; grid-template-columns: 1fr 260px; gap: 14px; margin-bottom: 14px; }
.chart { position: relative; height: 190px; }
.chart svg { display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: Inter, sans-serif; }
/* #2f8fef er valideret mod den mørke flade (lyshed og kontrast) */
.chart .line { fill: none; stroke: #2f8fef; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #2f8fef; stroke: var(--card-solid, #12161e); stroke-width: 2; }
.chart .peak { fill: var(--text); font-size: 11px; font-weight: 600; font-family: Inter, sans-serif; }
.chart .hover-line { stroke: rgba(255, 255, 255, .25); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; padding: 5px 9px; border-radius: 7px; background: #1b212c; border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; transform: translate(-50%, -120%); }
.status-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; background: linear-gradient(160deg, rgba(47, 210, 122, .22), rgba(47, 210, 122, .04)) !important; border-color: rgba(47, 210, 122, .35) !important; }
.status-card.off { background: linear-gradient(160deg, rgba(255, 90, 90, .2), rgba(255, 90, 90, .04)) !important; border-color: rgba(255, 90, 90, .35) !important; }
.status-ico { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 8px; border-radius: 50%; background: rgba(47, 210, 122, .2); }
.status-ico::before { content: ''; width: 22px; height: 12px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg) translate(2px, -2px); }
.status-card.off .status-ico { background: rgba(255, 90, 90, .18); }
.status-card.off .status-ico::before { width: 20px; height: 20px; border: 0; background: linear-gradient(45deg, transparent 43%, var(--red) 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, var(--red) 43% 57%, transparent 57%); transform: none; }
.status-card small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.status-card b { font-size: 28px; font-weight: 800; color: var(--green); }
.status-card.off b { color: #ff8a8a; }
.status-card p { font-size: 12.5px; }
@media (max-width: 1000px) { .dash-row { grid-template-columns: 1fr; } }

/* nøgletal over lister */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-strip div { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); }
.stat-strip span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stat-strip b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .stat-strip { grid-template-columns: 1fr 1fr; } }

/* ---------- skabelon-editor ---------- */
.tpl-modal { max-width: 860px; max-height: 90vh; overflow-y: auto; }
.tpl-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.tpl-head h2 { margin-bottom: 2px; }
.tpl-head .muted { margin: 0; font-size: 13px; }
.tpl-desc { display: grid; gap: 5px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tpl-cols, .tpl-row { display: grid; grid-template-columns: 1fr 120px 70px 70px 104px; gap: 8px; align-items: center; }
.tpl-cols { padding: 0 2px 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tpl-row { margin-bottom: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.tpl-row input, .tpl-row select { width: 100%; min-width: 0; }
.tpl-row .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tpl-row .acts button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, .04); cursor: pointer; font-size: 13px; }
.tpl-row .acts button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.tpl-row .acts button:disabled { opacity: .3; cursor: not-allowed; }
.tpl-row .lock { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
@media (max-width: 720px) { .tpl-cols { display: none; } .tpl-row { grid-template-columns: 1fr 1fr 1fr; } .tpl-row > :first-child { grid-column: 1 / -1; } .tpl-row .acts { grid-column: 1 / -1; justify-content: flex-start; } .tpl-head { flex-direction: column; } }

/* ---------- klip ---------- */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.clip { overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); cursor: pointer; transition: border-color .15s, transform .15s; }
.clip:hover { border-color: rgba(26, 140, 255, .5); transform: translateY(-2px); }
.clip-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.clip-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.clip-thumb .len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .7); font-size: 11px; font-weight: 700; }
.clip-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; background: rgba(0, 0, 0, .25); }
.clip:hover .play { opacity: 1; }
.clip-thumb .play::before { content: ''; width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
.clip-meta { padding: 11px 13px; }
.clip-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.clip-meta small { display: flex; gap: 6px; align-items: center; margin-top: 4px; color: var(--muted); font-size: 12px; }
.clip-meta img { width: 16px; height: 16px; border-radius: 50%; }

/* ---------- grupperede dropdown-menuer (som TW Admin) ---------- */
.side nav { justify-content: center; gap: 6px; overflow: visible; }
.dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 13px;
  border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.dd-btn svg { width: 20px; height: 20px; }
.dd-btn:hover, .dd.open .dd-btn { background: rgba(255, 255, 255, .06); color: var(--text); }
.dd.has-active .dd-btn { background: var(--blue); color: #fff; box-shadow: 0 6px 18px -8px rgba(26, 140, 255, .8); }
.dd-btn em { font-style: normal; font-size: 11px; font-weight: 700; color: inherit; opacity: .75; }
.dd-btn em.hot:not(:empty) { padding: 1px 7px; border-radius: 10px; background: #ff5a5a; color: #fff; opacity: 1; }
.caret { width: 7px; height: 7px; margin-left: 2px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; transition: transform .15s; }
.dd.open .caret { transform: rotate(225deg) translateY(-1px); }
.dd-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0; z-index: 40;
  min-width: 220px; padding: 6px; display: grid; gap: 2px;
  background: rgba(16, 20, 28, .98); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.side nav .dd-menu a { min-height: 38px; padding: 0 12px; justify-content: flex-start; font-size: 13.5px; color: var(--muted); }
.side nav .dd-menu a .lbl { display: inline; }
.side nav .dd-menu a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.side nav .dd-menu a.active { background: rgba(26, 140, 255, .16); color: #fff; box-shadow: none; }
.side nav .dd-menu a.active svg { color: var(--blue-2); }
.side nav .dd-menu a[data-tip]:hover::after { display: none; }
.dd[hidden] { display: none; }

.cmd-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; flex-shrink: 0;
  border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 13px; cursor: pointer;
}
.cmd-btn:hover { border-color: rgba(255, 255, 255, .2); color: var(--text); }
.cmd-btn svg { width: 16px; height: 16px; }
kbd { padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font: 600 10.5px Inter, sans-serif; color: var(--muted); }
.cmd-bg { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; padding: 12vh 16px 16px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(5px); animation: fade .12s; }
.cmd { width: 100%; max-width: 620px; height: fit-content; overflow: hidden; background: rgba(14, 18, 25, .98); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 100px rgba(0, 0, 0, .7); animation: pop .15s; }
.cmd-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmd-input svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.cmd-input input { border: 0; background: none; padding: 0; font-size: 15px; box-shadow: none !important; }
.cmd-list { list-style: none; max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmd-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.cmd-list li.sel, .cmd-list li:hover { background: rgba(26, 140, 255, .14); }
.cmd-list li svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.cmd-list li small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.cmd-list .cmd-head { padding: 10px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); cursor: default; }
.cmd-list .cmd-head:hover { background: none; }

/* ---------- mobil ---------- */
@media (max-width: 1250px) { .cmd-btn span, .cmd-btn kbd { display: none; } }
@media (max-width: 760px) { .dd-btn .dd-lbl { display: none; } .dd-btn { padding: 0 10px; } .dd-menu { left: auto; right: 0; translate: 0; } .side nav { justify-content: flex-start; overflow-x: visible; } }
@media (max-width: 1250px) { .me div { display: none; } .logo span { display: none; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .qa { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { padding: 8px 10px; gap: 6px; }
  .side nav { justify-content: flex-start; padding: 0 4px; }
  .side nav a { padding: 0 10px; min-height: 38px; }
  .main { padding: 0 16px 32px; }
  .server-chip span { display: none; }
  .kpi b { font-size: 24px; }
  .qa { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr 1fr; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}
