@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Montserrat:wght@600;700&display=swap");
/* Atlas website. Palette from the Atlas Box itself (dark red), set on deep oxblood; the navy badge stays navy.
   Served as a file: the template minifier mangles inline CSS. */
:root {
  color-scheme: dark;
  --bg: #140A0C;          /* oxblood night */
  --surface: #1E1013;     /* panels */
  --raised: #29161A;      /* fields, hover */
  --line: #3D2128;        /* borders, map rings */
  --box: #8E1B24;         /* Atlas Box red: primary actions */
  --box-lit: #B3303A;     /* hover, router node */
  --rose: #E8A3AA;        /* links, map edges, active nav */
  --text: #F6ECEC;
  --muted: #B89EA3;
  --online: #4FD18B;
  --online-bg: #10291D;
  --attn: #F2A541;        /* needs you */
  --error-bg: #3A1418;
  --error: #FFB4B8;
  --display: "Montserrat", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--body); }
a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; max-width: 70ch; }
.muted { color: var(--muted); }

/* Shell: sidebar + content */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 6px 22px; color: var(--text); font: 700 18px var(--display); }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--muted); padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.side nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.side nav a.on { background: var(--raised); color: var(--text); box-shadow: inset 3px 0 0 var(--box-lit); }
.side .who { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.side .who a { display: inline-block; margin-top: 6px; }
main { padding: 36px 44px; max-width: 1180px; width: 100%; }
.crumbs { font-size: 13px; margin-bottom: 8px; color: var(--muted); }

/* Page header with Space tabs */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--box-lit); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.panel > h2:first-child { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; color: var(--text); }
.tile:hover { border-color: var(--box); text-decoration: none; }
.tile h3 { margin-bottom: 6px; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; background: var(--box); color: #fff; font: 600 14px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--box-lit); text-decoration: none; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn-quiet:hover { background: var(--raised); }
.btn-attn { background: var(--box); }
input, select, textarea { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input::placeholder { color: #8A7277; }
input:focus, select:focus { border-color: var(--rose); outline: none; }
form.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.row input { flex: 1 1 200px; }
form.inline { display: inline; }
label { color: var(--muted); font-size: 13px; }

/* Status */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 500; }
.chip.ok { background: var(--online-bg); color: var(--online); }
.chip.attn { background: #3A2610; color: var(--attn); }
.error { background: var(--error-bg); color: var(--error); padding: 10px 14px; border-radius: 8px; border: 1px solid #5A1E24; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--online); box-shadow: 0 0 0 3px rgba(79, 209, 139, .15); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list .item .sub { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }

/* The live map: the one bold thing */
.mapwrap { position: relative; background: radial-gradient(ellipse at 50% 50%, #2A1217 0%, #1A0B0E 60%, #140A0C 100%); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
svg.map { width: 100%; height: auto; display: block; }
svg.map .ring { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }
svg.map .edge { stroke: rgba(232, 163, 170, .28); stroke-width: 1.5; }
svg.map .node { fill: var(--rose); stroke: #140A0C; stroke-width: 3; }
svg.map .node.gw { fill: var(--box-lit); filter: drop-shadow(0 0 8px rgba(179, 48, 58, .8)); }
svg.map .node.gone { fill: #140A0C; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
svg.map text { font: 500 13px var(--body); fill: var(--text); }
svg.map a:hover .node { fill: #fff; }
.maplegend { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; }
.livebadge { position: absolute; right: 14px; top: 12px; font-size: 12px; color: var(--muted); }
code.link { display: block; padding: 10px; background: var(--raised); border-radius: 8px; word-break: break-all; }

/* Narrow screens: sidebar becomes a top bar */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
  .brand { margin: 0 12px 0 0; }
  .side nav { flex-direction: row; }
  .side .who { margin: 0 0 0 auto; border: 0; padding: 0; font-size: 0; }
  .side .who a { font-size: 13px; margin: 0; }
  .side nav a.on { box-shadow: inset 0 -2px 0 var(--box-lit); }
  svg.map text { font-size: 18px; }
  main { padding: 22px 16px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  svg.map .node.fresh { animation: arrive 1.6s ease-out 1; }
  @keyframes arrive { 0% { r: 4; opacity: .2; } 60% { r: 19; } 100% { r: 13; opacity: 1; } }
}

/* Printed box label (light, for paper) */
.label { width: 62mm; padding: 4mm; border: 1px dashed #C0D6EA; text-align: center; font-family: system-ui, sans-serif; color: #13263A; background: #fff; }
.label-logo { width: 40mm; }
.label-qr { width: 34mm; height: 34mm; display: block; margin: 2mm auto; }
.label-serial { font: 700 16pt ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.label-hint { font-size: 8pt; color: #5B6B7C; }
@media print { .label { border: 0; } }

/* Landing */
.landing { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.landing-logo { width: 220px; margin-bottom: 28px; }
.landing-title { font-size: 40px; max-width: 16ch; }
.landing-map { width: 100%; }
.landing-map .ring { fill: none; stroke: var(--line); stroke-dasharray: 2 5; }
.landing-map .edge { stroke: rgba(232, 163, 170, .3); stroke-width: 1.5; }
.landing-map .node { fill: var(--rose); stroke: var(--bg); stroke-width: 3; }
.landing-map .node.gw { fill: var(--box-lit); filter: drop-shadow(0 0 10px rgba(179, 48, 58, .9)); }
.landing-map .node.gone { fill: var(--bg); stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
@media (max-width: 860px) { .landing { grid-template-columns: 1fr; } .landing-title { font-size: 30px; } }
