/* Look inspireret af Cisco Catalyst Center: mørk venstre-rail, lyst data-tæt indhold, Cisco-blå accent. */
:root {
  --rail: #16222f; --rail-fg: #9fb0c0; --rail-on: #ffffff; --rail-line: #223243;
  --bg: #eef1f5; --surface: #ffffff; --sunken: #f4f6f9; --fg: #1a2430; --muted: #5d6b7c;
  --line: #dce2ea; --accent: #0d74b8; --accent-br: #00bceb; --accent-weak: #e7f6fb;
  --up: #2f9e44; --up-bg: #e5f5e9; --down: #c92a2a; --down-bg: #fbe7e7;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,32,52,.06), 0 1px 3px rgba(16,32,52,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --rail:#0d1620; --rail-fg:#8595a6; --rail-on:#fff; --rail-line:#1c2a39;
    --bg:#0f141c; --surface:#161d28; --sunken:#1b2330; --fg:#e4e9ef; --muted:#93a0b0;
    --line:#273343; --accent:#4cb3d6; --accent-br:#00bceb; --accent-weak:#13303b;
    --up:#51cf66; --up-bg:#15301c; --down:#ff6b6b; --down-bg:#331618; color-scheme: dark;
    --shadow: 0 1px 3px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 14.5px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; }

/* layout */
body.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar { background: var(--rail); color: var(--rail-fg); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.logo { font-size: 17px; font-weight: 700; color: var(--rail-on); padding: 16px 20px; letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rail-line); }
.logo-mark { color: var(--accent-br); }
.side-nav { display: flex; flex-direction: column; padding: 10px 0; gap: 1px; flex: 1; }
.navitem { display: flex; align-items: center; gap: 11px; padding: 9px 20px; color: var(--rail-fg);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.navitem i { font-style: normal; width: 16px; text-align: center; opacity: .8; }
.navitem:hover { background: rgba(255,255,255,.05); color: var(--rail-on); }
.navitem.on { color: var(--rail-on); border-left-color: var(--accent-br); background: rgba(0,188,235,.1); font-weight: 600; }
.navitem.off { color: #566675; cursor: default; }
.navitem.off:hover { background: none; color: #566675; }
.nav-sep { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #566675;
  padding: 14px 20px 6px; }
.side-foot { padding: 13px 20px; border-top: 1px solid var(--rail-line); display: flex;
  align-items: center; justify-content: space-between; margin: 0; }
.who { color: var(--rail-on); font-size: 13px; font-weight: 600; }
.linkbtn { background: none; border: 0; color: var(--accent-br); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.shell { min-width: 0; display: flex; flex-direction: column; }

/* topbar + søgning */
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 20px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.crumbs { font-size: 14px; color: var(--muted); } .crumbs a { color: var(--accent); text-decoration: none; }
.crumbs .sep { margin: 0 8px; color: var(--line); }
.search { position: relative; margin-left: auto; width: min(420px, 42vw); }
.search input { width: 100%; font: inherit; font-size: 13.5px; padding: 8px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--sunken); color: var(--fg); }
.search input:focus { outline: none; border-color: var(--accent-br); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-weak); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,32,52,.16);
  overflow: hidden; z-index: 30; }
.res { display: flex; flex-direction: column; gap: 1px; padding: 9px 13px; text-decoration: none; color: var(--fg); }
.res:hover, .res.on { background: var(--accent-weak); }
.res-main { font-size: 14px; font-weight: 500; } .res-sub { font-size: 12px; color: var(--muted); }
.content { padding: 24px; max-width: 1200px; }

@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; padding: 4px 8px; gap: 0; }
  .nav-sep { display: none; } .navitem { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .navitem.on { border-left: 0; border-bottom-color: var(--accent-br); }
  .side-foot { border-top: 0; } .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .search { margin-left: 0; width: 100%; }
}

.head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
h1 { font-size: 21px; margin: 0; } h2 { font-size: 14px; margin: 0; letter-spacing: .01em; }
.count { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.banner { background: var(--sunken); border: 1px solid var(--line); border-left: 3px solid var(--accent-br);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.banner.ok { border-left-color: var(--up); color: var(--fg); }

/* status-tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); position: relative; }
.tile::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--accent-br); }
.tile.up::before { background: var(--up); } .tile.down::before { background: var(--down); }
.t-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* kort + tabeller */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; } .card.mt { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--sunken); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[onclick] { cursor: pointer; }
tbody tr[onclick]:hover { background: var(--sunken); }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.pill.up { background: var(--up-bg); color: var(--up); } .pill.down { background: var(--down-bg); color: var(--down); }
.link { color: var(--muted); } .link.on { color: var(--up); font-weight: 600; }
.tag { background: var(--accent-weak); color: var(--accent); padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 20px; }
.facts > div { background: var(--surface); padding: 12px 16px; }
.facts dt { color: var(--muted); font-size: 12px; } .facts dd { margin: 3px 0 0; font-weight: 500; }

/* knapper - lettere og mere moderne */
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: 7px 13px;
  font-size: 13.5px; font-weight: 500; cursor: pointer; line-height: 1.2; transition: filter .1s, background .1s; }
.btn:hover { filter: brightness(1.07); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--sunken); filter: none; }
.btn.ghost.danger { color: var(--down); } .btn.ghost.danger:hover { background: var(--down-bg); }
.inline { margin: 0; } .inline.right { margin-left: auto; }
.actions { margin-top: 16px; }

/* formularer */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.field:first-of-type { margin-top: 0; }
.field.narrow { max-width: 260px; }
.field span { font-weight: 500; }
.field input, .field textarea, .field select, .rowform select, .rowform input, .addrow input, .addrow select {
  font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--fg); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent-br);
  box-shadow: 0 0 0 3px var(--accent-weak); }
.field textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 12px; } .hint code { font-family: var(--mono); font-size: 12px; }
.rowform { display: flex; gap: 8px; align-items: center; }
.rowform .sm, .addrow input, .addrow select { padding: 6px 9px; font-size: 13px; }
.addrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.addrow .field { margin-top: 0; }

details.edit > summary { cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; }
.editform { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px;
  background: var(--sunken); padding: 10px; border-radius: 7px; }
.editform label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.editform input { font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.link-a { color: var(--accent); text-decoration: none; font-size: 13px; margin-right: 12px; }
.link-a:hover { text-decoration: underline; }

/* RESTCONF-test */
.testrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.testrow input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--fg); min-width: 220px; }
.test-res { font-size: 13px; color: var(--muted); } .test-res.ok { color: var(--up); font-weight: 600; }
.test-res.bad { color: var(--down); font-weight: 600; }

/* kode + diff */
pre.code { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.5; white-space: pre; color: var(--fg); }
pre.code.diff span { display: block; }
.d-add { background: var(--up-bg); color: var(--up); } .d-del { background: var(--down-bg); color: var(--down); }
.d-hunk { color: var(--accent); }

/* tilføj-enhed popover */
details.add { position: relative; }
details.add > summary { list-style: none; }
details.add .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,32,52,.16);
  padding: 14px; width: 300px; }
details.add .pop .field { margin-top: 10px; } details.add .pop .field:first-child { margin-top: 0; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--rail); }
.loginbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 30px; width: 330px; max-width: 90vw; display: flex; flex-direction: column; gap: 14px;
  border-top: 4px solid var(--accent-br); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.loginbox h1 { font-size: 19px; margin: 0 0 4px; text-align: center; }
.loginbox label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.loginbox input { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); }
.loginbox .btn { margin-top: 4px; padding: 10px; }
.err { background: var(--down-bg); color: var(--down); border-radius: 7px; padding: 8px 11px; font-size: 13px; margin: 0; }
