* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #15224f;
  --blue: #2563eb;
  --ink: #1a1a1e;
  --text: #4b5563;
  --muted: #586070;
  --icon: #636a76;
  --line: #e6e7eb;
  --line-soft: #edeef1;
  --bg-main: #f5f6f8;
  --pill: #ececef;
  --red: #e5484d;
}

html, body { height: 100%; }

body {
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: linear-gradient(155deg, #16245e 0%, #244fb8 42%, #3b82f6 100%);
}
.page-title, .section-title, .brand-name, .sc-num, .panel-head h2 { font-family: "Schibsted Grotesk", "Hanken Grotesk", sans-serif; }

.app {
  position: fixed;
  top: 10px; left: 12px; right: 0; bottom: 0;
  background: #fff;
  border-top-left-radius: 16px;
  display: flex;
  overflow: hidden;
  box-shadow: -2px -2px 24px rgba(10, 25, 70, .25);
}

/* ░░░ SIDEBAR ░░░ */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.brand-badge {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #2a3d86, #15224f);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.brand-sub { font-size: 12px; color: #667085; }

.nav { flex: 1; display: flex; flex-direction: column; overflow-y: auto; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #3a3f48;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: #f4f5f7; }
.nav-item.active { background: var(--pill); color: #15181d; font-weight: 600; }

.ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--icon);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.active .ico { stroke: #20242c; }

.nav-footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-bottom: 0;
}

/* ░░░ MAIN ░░░ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}

.topbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 30px;
}
.topbar-right { display: flex; align-items: center; gap: 20px; }

.icon-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  color: #5b6470;
  display: flex; align-items: center;
}
.ico-top { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: #20242c; }
.badge {
  position: absolute; top: -6px; right: -7px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--bg-main);
}

.user { display: flex; align-items: center; gap: 9px; cursor: pointer; padding-left: 6px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3a5fc4, #6841c4);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13.5px; font-weight: 600; color: #1f2430; }
.user-org { font-size: 12px; color: #667085; }
.chev-down { width: 16px; height: 16px; fill: none; stroke: #667085; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ░░░ CONTENT ░░░ */
.content { flex: 1; overflow-y: auto; padding: 6px 42px 64px; }

.page-title { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.012em; margin: 12px 0 10px; }
.page-sub { font-size: 15px; color: var(--muted); max-width: 690px; line-height: 1.5; margin-bottom: 24px; }

.tabs {
  display: flex; gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.tab {
  position: relative;
  padding: 0 0 13px;
  font-size: 14px; font-weight: 500;
  color: #5b6470; text-decoration: none;
  transition: color .14s;
}
.tab:hover { color: #20242c; }
.tab.active { color: var(--blue); font-weight: 600; }
.tab.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--blue); border-radius: 2px;
}

.block { margin-bottom: 34px; animation: fadeUp .5s ease both; }
.block:nth-child(3) { animation-delay: .05s; }
.block:nth-child(4) { animation-delay: .10s; }
.block:nth-child(5) { animation-delay: .15s; }
.block:nth-child(6) { animation-delay: .20s; }
.block:nth-child(7) { animation-delay: .25s; }

.section-title { font-size: 17px; font-weight: 600; color: #1f2430; margin-bottom: 6px; }
.section-desc { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; max-width: 780px; }
.learn { color: var(--blue); text-decoration: none; font-weight: 500; white-space: nowrap; }
.learn:hover { text-decoration: underline; }
.ext { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -1px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card:hover {
  border-color: #c5d3f0;
  box-shadow: 0 5px 16px rgba(20, 40, 90, .08);
  transform: translateY(-1px);
}

.logo {
  width: 44px; height: 44px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff;
  background: var(--c, #888);
}
.logo-os, .logo-muted { background: #f3f4f6; border: 1px solid var(--line-soft); }
.card-label { flex: 1; font-size: 15px; font-weight: 600; color: #1f2430; }
.chev { width: 18px; height: 18px; fill: none; stroke: #b7bcc6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ░░░ SCREENS (demo views) ░░░ */
.screen { display: none; }
.screen.active { display: block; animation: screenIn .42s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* status pills */
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill-amber { background: #fef0c7; color: #b54708; }
.pill-green { background: #d1fadf; color: #027a48; }
.pill-red   { background: #fee4e2; color: #b42318; }
.pill-grey  { background: #eaecf0; color: #475467; }

/* stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.sc-label { font-size: 13px; color: #586070; font-weight: 500; }
.sc-num { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.015em; line-height: 1; }
.sc-trend { font-size: 12.5px; color: #667085; }
.sc-trend.up { color: #027a48; }

/* panels (chart + activity) */
.panel-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h2 { font-size: 15px; font-weight: 600; color: #1f2430; }
.panel-meta { font-size: 12px; color: #9aa1ad; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 168px; }
.chart-bars span { flex: 1; background: linear-gradient(180deg, #84caff, #2563eb); border-radius: 5px 5px 0 0; min-height: 6px; }
.activity { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.activity li { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: #344054; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.green { background: #12b76a; } .dot.amber { background: #f79009; } .dot.blue { background: #2563eb; } .dot.red { background: #f04438; }
.activity .ago { margin-left: auto; font-size: 12px; color: #9aa1ad; }

/* change-request table */
.tbl { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: 2.4fr 1.5fr 1.3fr .9fr 1.1fr; gap: 12px; align-items: center; padding: 13px 18px; }
.tbl-head { background: #f7f8fa; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #667085; }
.tbl-row { border-top: 1px solid var(--line-soft); font-size: 13.5px; color: #475467; }
.tbl-row strong { font-weight: 600; color: #1f2430; }
.tbl-row .pill { justify-self: start; }

/* firewall device grid */
.dev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.dev-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; }
.dev-card .logo { width: 40px; height: 40px; font-size: 16px; }
.dev-card .meta { display: flex; flex-direction: column; gap: 2px; }
.dev-card .meta strong { font-size: 14.5px; color: #1f2430; }
.dev-card .meta span { font-size: 12.5px; color: #586070; }
.dev-card .pill { margin-left: auto; }

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .dev-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } .sidebar { width: 220px; } }

/* ── DARK MODE (syncs with parent site via the 'theme' storage key) ── */
[data-theme="dark"] {
  --ink: #e9eef6; --text: #aeb9ca; --muted: #828ea3; --icon: #8b97aa;
  --line: #28313f; --line-soft: #222a36; --bg-main: #10151e; --pill: #222b39;
}
[data-theme="dark"] body { background: linear-gradient(155deg, #0c1430 0%, #13234d 58%, #1b3a73 100%); }
[data-theme="dark"] .app, [data-theme="dark"] .sidebar { background: #161d28; }
[data-theme="dark"] .brand-name, [data-theme="dark"] .page-title, [data-theme="dark"] .section-title,
[data-theme="dark"] .panel-head h2, [data-theme="dark"] .sc-num, [data-theme="dark"] .card-label,
[data-theme="dark"] .tbl-row strong, [data-theme="dark"] .user-name, [data-theme="dark"] .dev-card .meta strong { color: var(--ink); }
[data-theme="dark"] .nav-item { color: #c4cddb; }
[data-theme="dark"] .nav-item:hover { background: #1d2531; }
[data-theme="dark"] .nav-item.active { background: #222b39; color: #fff; }
[data-theme="dark"] .nav-item.active .ico { stroke: #cfe0fb; }
[data-theme="dark"] .main { background: var(--bg-main); }
[data-theme="dark"] .card, [data-theme="dark"] .stat-card, [data-theme="dark"] .panel,
[data-theme="dark"] .tbl, [data-theme="dark"] .dev-card { background: #161d28; border-color: var(--line); }
[data-theme="dark"] .tbl-head { background: #11171f; color: #828ea3; }
[data-theme="dark"] .tbl-row { border-top-color: var(--line-soft); color: #aeb9ca; }
[data-theme="dark"] .tabs { border-bottom-color: var(--line); }
[data-theme="dark"] .tab { color: #9aa6b8; }
[data-theme="dark"] .logo-os, [data-theme="dark"] .logo-muted { background: #1d2531; border-color: var(--line-soft); }
[data-theme="dark"] .badge { border-color: var(--bg-main); }
[data-theme="dark"] .chev, [data-theme="dark"] .chev-down { stroke: #5b6678; }
[data-theme="dark"] .card:hover { border-color: color-mix(in srgb, #3b82f6 36%, var(--line)); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
