:root {
  --ink-900: #101528;
  --ink-700: #1d2641;
  --ink-500: #4f5d82;
  --paper: #f7f8fc;
  --white: #ffffff;
  --line: #d8deef;
  --cobalt: #1768ff;
  --cyan: #15b2d3;
  --tangerine: #ff7f3f;
  --mint: #7de2b8;
  --shadow: 0 16px 42px rgba(16, 21, 40, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--ink-900);
  background: radial-gradient(circle at 10% -10%, #d6edff 0%, transparent 45%),
              radial-gradient(circle at 90% 0%, #ffe3d2 0%, transparent 42%),
              var(--paper);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Bitter', Georgia, serif;
  margin: 0;
}

a {
  color: var(--cobalt);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1400px, 96vw);
  margin: 0 auto;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: rgba(23, 104, 255, 0.2);
  top: 120px;
  left: -120px;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: rgba(255, 127, 63, 0.2);
  top: 40%;
  right: -100px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(79, 93, 130, 0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(79, 93, 130, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  pointer-events: none;
}

.site-header,
.main-wrap,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  padding-top: 1rem;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(216, 222, 239, 0.85);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-900);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--cobalt), var(--cyan));
  color: var(--white);
  font-weight: 700;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-version {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-700);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0.16rem 0.45rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-nav a {
  color: var(--ink-700);
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.top-nav a:hover,
.top-nav a.is-active {
  background: var(--ink-900);
  color: var(--white);
  text-decoration: none;
}

.nav-logout {
  color: var(--ink-700);
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.nav-logout:hover {
  background: var(--ink-900);
  color: var(--white);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink-700);
}

.main-wrap {
  padding: 0.6rem 0 1rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
  background: linear-gradient(135deg, #0f1630 0%, #1b2a56 45%, #114169 100%);
  border-radius: 22px;
  padding: 2rem;
  color: var(--white);
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mint);
  font-size: 0.76rem;
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.3vw, 2.9rem);
  line-height: 1.12;
}

.lede {
  margin-top: 0.9rem;
  color: #dce7ff;
  max-width: 62ch;
}

.hero-stats {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.stat-box {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 1rem;
}

.stat-box span {
  color: #b9cef7;
  font-size: 0.85rem;
}

.stat-box strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 2rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.6rem 0 0.35rem;
  gap: 1rem;
}

.section-head h2 {
  font-size: 1.15rem;
}

.tile-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

a.tile {
  display: block;
  text-decoration: none;
  color: var(--ink-900);
  transition: border-color 150ms, box-shadow 150ms;
}

a.tile:hover {
  border-color: var(--cobalt);
  box-shadow: 0 4px 14px rgba(23, 104, 255, 0.18);
  text-decoration: none;
}

a.tile h3 {
  color: var(--ink-900);
}

a.tile:hover h3 {
  color: var(--cobalt);
}

.tile,
.category-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 4px 10px rgba(26, 36, 70, 0.06);
}

.tile h3,
.category-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.3;
}

.tile p,
.category-card p {
  color: var(--ink-500);
  font-size: 0.9rem;
  margin: 0;
}

.category-head a {
  display: inline-flex;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ink-500);
  white-space: nowrap;
}

.category-list {
  margin-top: 0.3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  align-items: start;
}

.category-list .section-head {
  grid-column: 1 / -1;
  margin-top: 0;
}

.category-card {
  margin-bottom: 0;
}

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.category-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.category-card li {
  border-top: 1px dashed var(--line);
  padding-top: 0.25rem;
}

.category-card li:first-child {
  border-top: none;
  padding-top: 0;
}

.category-card li a {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
}

.category-card li span {
  display: block;
  margin-top: 0.08rem;
  color: var(--ink-500);
  font-size: 0.78rem;
  line-height: 1.3;
}

.category-hero {
  background: linear-gradient(140deg, rgba(23, 104, 255, 0.14), rgba(21, 178, 211, 0.2));
  border: 1px solid rgba(23, 104, 255, 0.26);
  border-radius: 16px;
  padding: 1.25rem;
}

.tag-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(23, 104, 255, 0.1);
  border: 1px solid rgba(23, 104, 255, 0.2);
  color: #0f4fcf;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  margin-bottom: 0.2rem;
}

.error-wrap {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
}

.login-form {
  display: grid;
  gap: 0.55rem;
}

.login-form label {
  font-weight: 700;
  color: var(--ink-700);
  margin-top: 0.2rem;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font: inherit;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--ink-500);
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(79, 93, 130, 0.12);
  color: var(--ink-900);
}

.password-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-form button {
  margin-top: 0.45rem;
  border: none;
  border-radius: 10px;
  background: var(--ink-900);
  color: var(--white);
  padding: 0.62rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-error {
  border: 1px solid #f0c3c1;
  background: #fff1f1;
  color: #7f1f1f;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.legacy-doc-wrap {
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legacy-doc-wrap table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
}

.legacy-doc-wrap td,
.legacy-doc-wrap th {
  border: 1px solid #bfc8de !important;
  padding: 0.35rem 0.45rem;
}

.site-footer {
  border-top: 1px solid rgba(79, 93, 130, 0.18);
  padding: 0.7rem 0 1rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-500);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-block;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 4vw;
    right: 4vw;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.6rem;
    box-shadow: var(--shadow);
  }

  .top-nav.is-open {
    display: flex;
  }

  .top-nav a {
    border-radius: 8px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-direction: column;
  }
}

/* ── Network Inventory ─────────────────────────────────────── */
.inv-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2rem 0 1.2rem;
  flex-wrap: wrap;
}
.inv-count { color: var(--ink-500); font-size: .875rem; margin: .25rem 0 0; }
.inv-error { color: #c0392b; background: #fdf0ee; border: 1px solid #e8b4ae; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.inv-empty { text-align: center; padding: 3rem; color: var(--ink-500); }

.inv-search {
  display: block;
  width: 100%;
  max-width: 340px;
  margin-bottom: .75rem;
  padding: .5rem .9rem;
  font-family: inherit;
  font-size: .9rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-900);
}
.inv-search:focus { outline: none; border-color: var(--cobalt); }

.inv-table-wrap { overflow-x: auto; position: relative; z-index: 1; }

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  background: rgba(255,255,255,.88);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.inv-table thead th {
  background: var(--ink-900);
  color: rgba(255,255,255,.85);
  padding: .6rem .75rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.inv-table tbody tr { border-bottom: 1px solid var(--line); }
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody tr:hover { background: #eef3ff; }
.inv-table td { padding: .45rem .75rem; vertical-align: middle; color: var(--ink-700); }
.inv-cell-host { font-weight: 600; color: var(--ink-900); white-space: nowrap; }
.inv-cell-mono code { font-family: 'Courier New', monospace; font-size: .8rem; color: var(--cobalt); background: #eef3ff; padding: 1px 5px; border-radius: 4px; }
.inv-notes { font-size: .78rem; color: var(--ink-500); max-width: 200px; }
.inv-actions { white-space: nowrap; }

.inv-btn {
  display: inline-block;
  padding: .45rem 1rem;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-700);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.inv-btn:hover { background: #f0f4ff; border-color: var(--cobalt); color: var(--cobalt); text-decoration: none; }
.inv-btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }
.inv-btn-primary:hover { background: #0f52cc; border-color: #0f52cc; color: var(--white); }
.inv-btn-danger { border-color: #e0a0a0; color: #c0392b; }
.inv-btn-danger:hover { background: #fdf0ee; border-color: #c0392b; }
.inv-btn-sm { padding: .25rem .65rem; font-size: .78rem; border-radius: 6px; }

.inv-form-card {
  background: rgba(255,255,255,.9);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  max-width: 900px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
  margin-bottom: 2rem;
}
.inv-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
}
.inv-field { display: flex; flex-direction: column; gap: .35rem; }
.inv-field-wide { grid-column: span 2; }
.inv-field-full { grid-column: 1 / -1; }
.inv-field label { font-size: .8rem; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em; }
.inv-field input, .inv-field textarea {
  padding: .5rem .75rem;
  font-family: inherit;
  font-size: .9rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-900);
  width: 100%;
  box-sizing: border-box;
}
.inv-field input:focus, .inv-field textarea:focus { outline: none; border-color: var(--cobalt); }
.inv-field textarea { resize: vertical; }
.inv-form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
