/* ================================================================
   AWMN Node #6233 — SV1BGM — Global Stylesheet
   Theme: Electric Blue High-Tech Dark
   ================================================================ */

:root {
  /* Palette — Electric Blue theme */
  --bg:           #050810;
  --bg2:          #090d18;
  --panel:        #0c1220;
  --panel2:       #101828;
  --border:       #1a2540;
  --border2:      #243260;
  --text:         #c8d8f0;
  --muted:        #5a78a8;
  --muted2:       #334466;
  --strong:       #eef4ff;

  /* Primary accent: electric blue */
  --accent:       #00aaff;
  --accent-dim:   rgba(0,170,255,.12);
  --accent2:      #40c8ff;
  --accent3:      #7b9fff;

  /* Status colors — green stays for online */
  --ok:           #00e5a0;
  --warn:         #ffc947;
  --danger:       #ff4466;

  /* Signal colors */
  --sig-good:     #00e5a0;
  --sig-mid:      #ffc947;
  --sig-warn:     #ff9020;
  --sig-bad:      #ff4466;
  --sig-na:       #334466;

  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --nav-h:        60px;
  --side-pad:     2.5rem;

  --shadow:       0 8px 32px rgba(0,0,0,.5);
  --shadow-sm:    0 2px 10px rgba(0,0,0,.35);
  --glow:         0 0 20px rgba(0,170,255,.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: repeating-linear-gradient(
    0deg, transparent 0px, transparent 3px,
    rgba(0,170,255,.006) 3px, rgba(0,170,255,.006) 4px
  );
  pointer-events: none;
}

/* ── Typography ─────────────────────────────────────────────── */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }
h1,h2,h3,h4 { color: var(--strong); font-weight: 800; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ── Layout ─────────────────────────────────────────────────── */
#app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Navigation ─────────────────────────────────────────────── */
#nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,8,16,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.nav-inner {
  display: flex; align-items: center; gap: 1rem;
  max-width: 1400px; margin: 0 auto;
  padding: 0 var(--side-pad);
  min-height: var(--nav-h);
}

/* Brand */
.nav-brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo { max-height: 42px; width: auto; object-fit: contain; }
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-callsign {
  font-size: 1.1rem; font-weight: 900; color: var(--strong); letter-spacing: .04em;
}
.nav-callsign span { color: var(--accent); }
.nav-nodeid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .62rem; letter-spacing: .2em; color: var(--accent); opacity: .7;
  text-transform: uppercase;
}

/* Nav links */
.nav-links {
  display: flex; align-items: center; gap: .05rem;
  list-style: none; flex: 1; margin-left: .5rem;
}
.nav-links a {
  display: flex; align-items: center; gap: .38rem;
  padding: .38rem .75rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); white-space: nowrap;
  transition: color .15s, background .15s;
  border: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); background: rgba(0,170,255,.06); }
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(0,170,255,.25);
  box-shadow: var(--glow);
}
.nav-icon { width: 15px; height: 15px; opacity: .7; flex-shrink: 0; }

/* Right side */
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.nav-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem; color: var(--muted); letter-spacing: .06em;
}

/* Hamburger */
#nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: .35rem .45rem; cursor: pointer; color: var(--muted);
  flex-direction: column; gap: 4px;
}
#nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ── Main content ───────────────────────────────────────────── */
#main {
  flex: 1; padding: 1.5rem var(--side-pad);
  max-width: 1400px; width: 100%; margin: 0 auto;
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.4rem;
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.4rem; font-weight: 900; color: var(--strong); }
.page-title .accent { color: var(--accent); }
.page-subtitle {
  margin-top: .2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .7rem; color: var(--muted); letter-spacing: .15em; text-transform: uppercase;
}
.page-meta { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; color: var(--muted); }

/* ── Summary pills ──────────────────────────────────────────── */
.summary-bar { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.25rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .75rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem; color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.pill b { color: var(--strong); font-weight: 700; }
.pill .pill-accent { color: var(--accent); font-weight: 700; }
.pill .pill-blue   { color: var(--accent2); font-weight: 700; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pill .dot.ok     { background: var(--ok); box-shadow: 0 0 6px rgba(0,229,160,.5); }
.pill .dot.warn   { background: var(--warn); }
.pill .dot.danger { background: var(--danger); }

/* ── Cards ──────────────────────────────────────────────────── */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }
.card.online    { border-left: 3px solid var(--ok); }
.card.offline   { border-left: 3px solid var(--danger); }
.card.link-down { border-left: 3px solid var(--warn); }

.card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.15);
}
.card-title { font-weight: 800; font-size: .95rem; color: var(--strong); flex: 1; }
.card-sub { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .7rem; color: var(--muted); }
.card-body { padding: .95rem 1rem; }

/* Indicator dot */
.indicator { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.indicator.online  { background: var(--ok); box-shadow: 0 0 8px rgba(0,229,160,.5); animation: pulse 1.8s infinite; }
.indicator.offline { background: var(--danger); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Badge */
.badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: var(--radius-sm);
}
.badge.online  { color: var(--ok);     border: 1px solid rgba(0,229,160,.25); }
.badge.offline { color: var(--danger); border: 1px solid rgba(255,68,102,.25); }
.badge.warn    { color: var(--warn);   border: 1px solid rgba(255,201,71,.25); }
.badge.info    { color: var(--accent); border: 1px solid rgba(0,170,255,.25); }

/* ── Metrics grid ───────────────────────────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: .85rem; }
.metric {
  background: rgba(0,0,0,.2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem .7rem;
  min-height: 62px; /* fixed height so all cards are uniform */
}
.metric .mk {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .25rem;
}
.metric .mv {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Signal */
.sig-good  { color: var(--sig-good) !important; }
.sig-mid   { color: var(--sig-mid)  !important; }
.sig-warn  { color: var(--sig-warn) !important; }
.sig-bad   { color: var(--sig-bad)  !important; }
.sig-na    { color: var(--sig-na)   !important; }

.sig-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; vertical-align: middle; }
.sig-bars span { display: block; width: 4px; border-radius: 1px; background: var(--border2); }
.sig-bars span.active { background: var(--accent); }
.sig-bars span:nth-child(1) { height: 25%; }
.sig-bars span:nth-child(2) { height: 50%; }
.sig-bars span:nth-child(3) { height: 75%; }
.sig-bars span:nth-child(4) { height: 100%; }

/* ── Tables ─────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
thead th {
  text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border2);
  font-size: .63rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
tbody td { padding: .48rem .65rem; border-bottom: 1px solid rgba(26,37,64,.6); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,170,255,.03); }

.state-up       { color: var(--ok); font-weight: 700; }
.state-idle     { color: var(--warn); }
.state-disabled { color: var(--danger); }
.state-unknown  { color: var(--muted); }

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: .9rem 1rem; }
.section + .section { border-top: 1px solid var(--border); }
.section-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .63rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .65rem;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.box { background: rgba(0,0,0,.15); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; }
.box h3 { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }

.mac-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; color: var(--muted); margin-top: .55rem; line-height: 1.9; }
.mac-line .val { color: var(--text); }
.mac-line .val.ip { color: var(--strong); font-weight: 700; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
input[type="text"], input[type="search"], select {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; padding: .48rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 180px;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,170,255,.12); }
select option { background: var(--bg2); }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .48rem 1rem; border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #03070f; box-shadow: 0 0 14px rgba(0,170,255,.25); }
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 22px rgba(0,170,255,.4); }
.btn-secondary { background: transparent; color: var(--muted); border: 1px solid var(--border2); }
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Terminal ───────────────────────────────────────────────── */
.terminal {
  background: #030508; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; line-height: 1.65; color: var(--accent);
  min-height: 120px; max-height: 440px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
.terminal .t-muted { color: var(--muted); }
.terminal .t-warn  { color: var(--warn); }
.terminal .t-err   { color: var(--danger); }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; padding: .5rem 0; }

/* ── Utilities ──────────────────────────────────────────────── */
.accent  { color: var(--accent) !important; }
.accent2 { color: var(--accent2) !important; }
.danger  { color: var(--danger) !important; }
.warn    { color: var(--warn) !important; }
.strong  { color: var(--strong); font-weight: 700; }
.mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; }
.mb1 { margin-bottom: .5rem; } .mb2 { margin-bottom: 1rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Footer ─────────────────────────────────────────────────── */
#footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  max-width: 1400px; margin: 0 auto;
  padding: 2.5rem var(--side-pad);
}
.footer-col-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .85rem; font-weight: 700;
}
.footer-col-brand {}
.footer-logo-link { display: inline-block; margin-bottom: .65rem; }
.footer-logo { height: 36px; width: auto; object-fit: contain; opacity: .85; transition: opacity .15s; }
.footer-logo:hover { opacity: 1; }
.footer-brand-name { font-size: .95rem; font-weight: 800; color: var(--strong); margin-bottom: .6rem; }
.footer-brand-name span { color: var(--accent); }
.footer-desc { font-size: .8rem; color: var(--muted); line-height: 1.65; margin-bottom: .5rem; }
.footer-meta { font-size: .76rem; color: var(--muted2); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.footer-links a { font-size: .82rem; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-info-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid rgba(26,37,64,.5); }
.footer-info-row:last-child { border-bottom: none; }
.footer-info-label { font-size: .75rem; color: var(--muted2); }
.footer-info-val { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  max-width: 1400px; margin: 0 auto;
  padding: .85rem var(--side-pad);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .67rem; color: var(--muted2);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --side-pad: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-col-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  :root { --side-pad: 1rem; }
  #nav-toggle { display: flex; }
  .nav-links  { display: none; }
  .nav-right  { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(5,8,16,.97);
    border-bottom: 1px solid var(--border);
    padding: .75rem var(--side-pad); gap: .2rem;
  }
  .nav-links.open a { padding: .65rem .9rem; font-size: .9rem; }
  .grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .pill { font-size: .67rem; padding: .3rem .6rem; }
}