/* NetMon - Zetrik look: light sidebar, colour icon tiles, blue primary */
@font-face { font-family: Inter; font-weight: 400; src: url(../fonts/inter-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 500; src: url(../fonts/inter-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 600; src: url(../fonts/inter-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 700; src: url(../fonts/inter-700.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e3e7ee;
  --line-soft: #edf0f5;
  --text: #1d2433;
  --muted: #5b6475;
  --primary: #0a66d6;
  --primary-dark: #0850a8;
  --transit: #e0761b;
  --peering: #0a66d6;
  --green-bg: #e3f6e8; --green: #1e7a34;
  --red-bg: #fde8e8;   --red: #a8232a;
  --amber-bg: #fff1db; --amber: #8a5300;
  --grey-bg: #edf0f5;  --grey: #3c4456;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }

/* Frame */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.brand-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 12px; color: var(--muted); }
.menu { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); }
.menu:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.menu.active { background: var(--primary); color: #fff; font-weight: 600; }
.menu.active .tile { background: rgba(255,255,255,.22) !important; }
.tile { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.main { flex: 1; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.topbar h1 { font-size: 24px; font-weight: 700; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.user { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Controls */
.btn, button { font-family: inherit; font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 999px; border: 1px solid #d5dae3; background: #fff; color: var(--text); cursor: pointer; display: inline-block; line-height: 1.3; }
.btn:hover, button:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--red); border-color: #f1c4c6; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.seg { display: flex; background: #e8ecf2; border-radius: 999px; padding: 3px; }
.seg a { font-size: 13px; padding: 6px 14px; border-radius: 999px; color: var(--grey); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(29,36,51,.08); }
input, select { font-family: inherit; font-size: 13px; padding: 8px 12px; border-radius: 10px; border: 1px solid #d5dae3; background: #fff; color: var(--text); }
input[type=search] { border-radius: 999px; padding: 8px 14px; width: 200px; }
select { border-radius: 999px; }
label { font-size: 13px; color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select { width: 100%; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.hint { font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Cards and panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.card .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card .v { font-size: 26px; font-weight: 700; }
.card .s { font-size: 12px; color: var(--muted); }
.card.hl { background: #eef4ff; border-color: #c9dafb; }
.card.hl .k, .card.hl .s { color: #24427a; }
.card.hl .v { color: #0b3f8f; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h2 { font-size: 16px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.chart-box { position: relative; height: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--grey); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 8px; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.num { text-align: right; white-space: nowrap; }
.strong { font-weight: 600; }
td a { font-weight: 500; }

/* Status labels - colour always with text */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.grey { background: var(--grey-bg); color: var(--grey); }
.badge.blue { background: #e6efff; color: #0b3f8f; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Split bar Transit / Peering */
.split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line-soft); min-width: 120px; }
.split .p { background: var(--peering); }
.split .t { background: var(--transit); }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 10px; }

/* Router list */
.dev { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: #f7f9fc; }
.dev .meta { display: flex; flex-direction: column; gap: 2px; }
.dev small { color: var(--muted); font-size: 12px; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 12px; font-size: 13px; }
.flash.success { background: var(--green-bg); color: var(--green); }
.flash.error { background: var(--red-bg); color: var(--red); }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { padding: 0 0 8px; }
.login-card button { width: 100%; padding: 10px; }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; padding-bottom: 8px; }
  .main { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}
