:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --panel: #121212;
  --panel-2: #161616;
  --text: #eaeaea;
  --muted: #a9b0bb;
  --accent: #5b8cff;        /* primary */
  --accent-alpha: #5b8cff20;   
  --accent-2: #7b5bff;      /* secondary */
  --accent-2-alpha: #7c5bff20;      /* secondary */
  --error: #ff6b6b;

  --radius: 14px;
  --ring: 2px;
  --ring-color: 0 120 255;  /* rgb for focus ring */
  --shadow-lg: 0 10px 40px var(--accent-2-alpha);
  --shadow-lg-2: 0 10px 40px var(--accent-alpha);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.04) inset, 0 1px 10px rgba(0,0,0,.35);
  --blur: 16px;
  --card-bg: rgba(11, 11, 11, 0.3); 
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0;}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  position: relative;
  isolation: isolate;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse farthest-corner at 0 0,
      rgba(91,140,255,.2), transparent 60%),
    radial-gradient(ellipse farthest-side at 70% 100%,
      rgba(123,91,255,.1), transparent 55%);
  background-repeat: no-repeat;
}

/* Topbar (glassy, sticky) */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.1) blur(12px);
  background: linear-gradient(180deg, rgba(18,18,18,.75), rgba(18,18,18,.55));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav .user {
  margin-left: auto;
  opacity: .8; font-size: .92rem;
  color: var(--muted);
} 



/* Layout */
.container {
  padding: 1rem 2rem;
  display: grid;
  place-items: start center;
}
@media (min-width: 768px) {
  .container { padding: 2rem; }
}
main.container {
  flex: 1;
}

/* Footer styling */
footer {
  padding: 0.2rem 0 .5rem 0;
  text-align: center;
  background: #111;
  color: #888;
  backdrop-filter: saturate(1.1) blur(12px);
  background: linear-gradient(180deg, rgba(18,18,18,.55), rgba(18,18,18,.35));
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Card (soft gradient border + subtle depth) */
.card {
  position: relative;
  display: grid; gap: .9rem;
  min-width: 300px; max-width: 460px; width: 100%;
  padding: 1.2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  backdrop-filter:
    blur(var(--blur))
    saturate(140%)
    contrast(105%)
    brightness(110%);
  -webkit-backdrop-filter:
    blur(var(--blur))
    saturate(140%)
    contrast(105%)
    brightness(110%);
}
.card::before {
  /* gradient border overlay */
  content: "";
  position: absolute; inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(91,140,255,.35), rgba(123,91,255,.25), rgba(255,255,255,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.card-bar {
  width: 100%;
  display: grid;
  place-items: center;
}

.card-bar-items{
  width: 100%;
  display: flex;
  flex-wrap: wrap;          /* wrap onto new lines */
  gap: .6rem 1rem;
  justify-content: center;  /* center last line too */
  /* remove the no-wrap + overflow */
}

.card-bar-items .kv{
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  column-gap: .3rem;

  /* let each pill grow/shrink with a floor */
  flex: 1 1 230px;          /* basis = min width; grows to fill row */
  min-width: 200px;
  max-width: 100%;

  padding: 0.4rem 0.9rem;
  background: #000;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.card-bar-items .ttle{ color: var(--muted-fg, #8a8f98); white-space: nowrap; }
.card-bar-items .kv > :last-child{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }




/* removes default button styling */
.btn-reset {
  all: unset;                 /* wipe inherited UA styles */
  display: inline-block;      /* restore box behavior */
  cursor: pointer;            /* keep pointer cursor */
  font: inherit;              /* match surrounding text */
  color: inherit;
  line-height: inherit;
}

/* keep an accessible focus indicator */
.btn-reset:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}




/* Controls */
input, button, select, textarea {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--text);
  background: #101010;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .7rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
  box-shadow: var(--shadow-sm);
}

input::placeholder, textarea::placeholder { color: #8b93a1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(var(--ring-color), .55);
  box-shadow:
    0 0 0 var(--ring) rgba(var(--ring-color), .35),
    inset 0 1px 0 rgba(255,255,255,.06);
}
input:disabled, button:disabled { opacity: .6; cursor: not-allowed; }

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .4rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: all .15s ease;

  /* Dark subtle base */
  background: #0a0a0ac2;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);

  /* Slight inner shadow for depth */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

button:hover, .btn:hover {
  border-color: color-mix(in srgb, var(--accent-2), #000 50%);
  color: #fff;
  background: #111111;
}

button:active, .btn:active {
  background: #101010;
  border-color: color-mix(in srgb, var(--accent), #000 50%);
  transform: translateY(1px);
}


/* Button variants */
.btn.secondary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent-2), #fff 10%), var(--accent-2));
  border-color: color-mix(in oklab, var(--accent-2), #000 30%);
  box-shadow: 0 6px 18px rgba(123,91,255,.28);
}


/* Helpers */
.error { color: var(--error); font-weight: 600; }
.small { font-size: .9rem; color: var(--muted); }

/* Form rows */
.row {
  display: grid; gap: .5rem;
}
.row.inline {
  grid-template-columns: 1fr auto;
  align-items: center; gap: .75rem;
}

/* Subtle divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.07), rgba(255,255,255,0));
  margin: .25rem 0 .5rem;
}

/* Smoothness */
a, button, input, select, textarea { will-change: filter, transform; }


#edgeChart { display:block; width:100%; max-height:560px; }


.nav {
  display: flex; align-items: center; gap: .75rem;
  max-width: 1100px; margin: 0 auto; padding: .6rem 1rem;
}
.brand {  padding-top: 6px; }
.inline { display: inline-flex; align-items: center; }
.nav select {
  appearance: none;  color: #e5e7eb;
  border: 1px solid #334155; border-radius: 8px; padding: .4rem .6rem; min-width: 220px;
  cursor: pointer; 
}
.nav select:disabled { opacity: .5; cursor: not-allowed; }


.sr-only { position: absolute; width: 115px; padding-top: .3rem;}





.sys-stat{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }
  .sys-stat .card{
    background: var(--card-bg, #fff);
    border: 1px solid var(--card-border, #e2e8f01a);
    border-radius: 12px;
    padding: .75rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: box-shadow .15s ease, transform .15s ease;
    height: 100%;
    cursor: pointer;
  }

  .table-wrap { margin-top: 0.2rem; }
  .table {
    width: 100%;
    border-collapse: separate;        /* keep gaps for "card" rows */
    border-spacing: 0 8px;            /* row gap to look like cards */
    table-layout: fixed;              /* consistent column widths */
  }
  .table thead th {
    text-align: left;
    padding: .5rem 1rem;
    font-weight: 600;
    color: #475569;                
  }
  .table td { padding: .6rem 1.2rem; vertical-align: middle; }
  .table th:nth-child(1), .table td:nth-child(1) { width: 55%; }  /* Edge */
  .table th:nth-child(2), .table td:nth-child(2) { width: 140px; }/* Status */
  .table th:nth-child(3), .table td:nth-child(3) { width: 200px; }/* Connected since */
  .table tbody tr.row-link td:first-child{ border-top-left-radius:12px; border-bottom-left-radius:12px; }
  .table tbody tr.row-link td:last-child { border-top-right-radius:12px; border-bottom-right-radius:12px; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; margin-right: .5rem; transform: translateY(-1px); }
  .dot.on { background: #22c55e; } /* green */
  .status-off { color: #64748b; }  /* muted */
  .table tbody tr.row-link{
    background: transparent;          /* let cells own the background */
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    position: relative;          /* lets z-index work */
    transform-origin: center;
    transform: translateZ(0);    /* promote to its own layer */
    transition:
      transform .18s cubic-bezier(.2,.6,.2,1),
      filter .18s ease,
      box-shadow .18s ease;
    will-change: transform, filter;
  }
  .table tbody tr.row-link:hover{ transform: scale(1.01); }
  .table tbody tr.row-link td{
    background: rgba(11, 11, 11, 0.3);
    backdrop-filter:
      blur(var(--blur, 0px))
      saturate(140%)
      contrast(105%)
      brightness(110%);
    -webkit-backdrop-filter:
      blur(var(--blur, 0px))
      saturate(140%)
      contrast(105%)
      brightness(110%);
  }
  .table tbody tr.row-link:hover td { background-color: rgb(0, 0, 0); }












  





/* tool tip */
  /* .tt{ position:relative; }
.tt::after{
  content: attr(data-tip);
  position:absolute; left:50%; bottom:calc(100% + 8px);
  transform:translateX(-50%) translateY(4px);
  background:#0a0a0af2; color:#fff;
  padding:.4rem .55rem; border-radius:.5rem;
  border:1px solid rgba(255,255,255,.15);
  box-shadow:0 8px 20px rgba(0,0,0,.35);
  font-size:.85rem; line-height:1;
  white-space:nowrap; pointer-events:none;
  opacity:0; visibility:hidden;
  transition:opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  z-index: 2147483647;
}
.tt::before{
  content:""; position:absolute; left:50%; bottom:calc(100% + 4px);
  width:8px; height:8px; transform:translateX(-50%) translateY(4px) rotate(45deg);
  background:#0a0a0af2;
  border-left:1px solid rgba(255,255,255,.15);
  border-top:1px solid rgba(255,255,255,.15);
  opacity:0; visibility:hidden; 
  z-index: 2147483646;
  transition:opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.tt:hover::after, .tt:focus-visible::after,
.tt:hover::before, .tt:focus-visible::before{
  opacity:1; visibility:visible; transform:translateX(-50%) translateY(0);
} */

/* Optional: multiline tips */
/* .tt[data-multiline="true"]::after{
  white-space:normal; max-width:22ch;
} */
