/* The Network area (#/network, pages/network.js and pages/network/): sites, the site hub, security, discovery, VPN and domains. Layout only:
   every colour, size and radius is a token from next.css, and every component (buttons, status, chips, link cards, tables, sections, banners)
   is drawn by next.css. No inline styles (style-src 'self'). The site hub reuses the device hub's band (.dhub). */

/* (the bar, the table-row button, the warning word, the "nothing here" line, sub-headings, lists, steps, sub-lines, the form error and the
   banner on a phone are the shared parts in next.css) */
.nw-toolbar { align-items: center; }
.nw-toolbar .searchbox { flex: 1 1 220px; max-width: 380px; }
.nw-chips { display: flex; min-width: 0; max-width: 100%; overflow-x: auto; }
.nw-cellsite { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.nw-cellsite > span:last-child { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.nw-cellsite__name { font-weight: 500; }

/* one firewall (Security): its section, the addresses, the alert switch at the foot */
.nw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-5); align-items: start; }
.nw-cards .section__body { display: flex; flex-direction: column; gap: var(--s-4); }
.nw-cardtitle { overflow-wrap: anywhere; }
.nw-cardfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.nw-ips { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }
.nw-label { display: block; font-size: var(--t-13); color: var(--muted); margin-bottom: var(--s-1); }

/* panels: the paste blocks, long lists */
.nw-list { margin: var(--s-3) 0 0; padding-left: var(--s-5); display: flex; flex-direction: column; gap: 4px; font-size: var(--t-14); max-height: 40vh; overflow: auto; }
.nw-custs { list-style: none; padding: 0; }
.nw-custs li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: var(--h-sm); }
.nw-dialog-more { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line-soft); }

/* forms in the one dialog and drawer: fields one under the other with air between them; the error and the status line */
.sheet__body form[data-nw-form], .sheet__body form[data-nw-cred] { display: flex; flex-direction: column; gap: var(--s-4); }
.nw-msg { margin: 0; font-size: var(--t-14); color: var(--ink-2); min-height: 1.4em; }
.nw-msg:empty { min-height: 0; }
.nw-msg--ok { color: var(--green); font-weight: 500; }
.nw-msg--warn { color: var(--amber); font-weight: 500; }
.nw-msg--crit { color: var(--red); font-weight: 500; }
.nw-credsteps { padding: var(--s-3) var(--s-4); border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2); }

/* the internet provider */
.nw-isp { display: flex; align-items: center; gap: var(--s-3); }
.nw-isp__name { font-size: var(--t-15); font-weight: 600; }

/* a domain's checks: each finding, the record to add with Copy, the Fix guide */
.nw-finds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.nw-find { padding: var(--s-3) var(--s-4); border: 1px solid var(--line-soft); border-radius: var(--r); display: flex; flex-direction: column; gap: var(--s-2); }
.nw-find__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); font-size: var(--t-14); }
.nw-find__text, .nw-find__fix { margin: 0; font-size: var(--t-14); color: var(--ink-2); overflow-wrap: anywhere; }
.nw-rec { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2) var(--s-3); border-radius: var(--r); background: var(--sunk); }
.nw-rec__row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); font-size: var(--t-13); }
.nw-rec__row code { overflow-wrap: anywhere; white-space: normal; }
.nw-guide { display: flex; flex-direction: column; gap: var(--s-1); }

/* the Sites list: what needs you now. One card per site that is down, degraded or has gear offline; the site's name is the link and covers the
   card (its ::after), the call and the copy button sit above it. A coloured edge carries the level beside the light and its word (never colour alone). */
.nw-out { list-style: none; margin: 0; padding: var(--s-4); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s-3); }
.nw-out__item { position: relative; display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-4); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--r-lg); background: var(--surface); }
.nw-out__item--down { background: var(--red-bg); border-color: var(--red-line); border-left-color: var(--red); }
.nw-out__item:hover { border-color: var(--accent); }
.nw-out__item--down:hover { border-color: var(--red); }
.nw-out__head { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.nw-out__head > .status { margin-left: auto; flex: none; }
.nw-out__title { display: flex; flex-direction: column; min-width: 0; }
.nw-out__name { font-size: var(--t-15); font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.nw-out__name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.nw-out__name:hover { color: var(--ink); }
.nw-out__name:focus-visible { outline: none; }
.nw-out__item:has(.nw-out__name:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.nw-out__cust { font-size: var(--t-13); color: var(--muted); overflow-wrap: anywhere; }
.nw-out__why { margin: 0; font-size: var(--t-14); color: var(--ink); overflow-wrap: anywhere; }
.nw-out__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 2px var(--s-4); font-size: var(--t-14); color: var(--ink-2); }
.nw-out__for { color: var(--muted); }
.nw-out__acts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-1); }
.nw-allok { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font-size: var(--t-14); }
.nw-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.nw-foot .note { margin: 0; }

/* the site hub: the facts that matter first (internet, firewall or gateway, gear, provider, outages), one tile each */
.nw-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.nw-glance__tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: var(--s-4) var(--s-5); border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin: 0 -1px -1px 0; }
.nw-glance__label { font-size: var(--t-13); color: var(--muted); }
.nw-glance__value { font-size: var(--t-17); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); }
.nw-glance__value--down { color: var(--red); } .nw-glance__value--warn { color: var(--amber); } .nw-glance__value--ok { color: var(--green); }
.nw-glance__sub { font-size: var(--t-14); color: var(--ink-2); overflow-wrap: anywhere; }
.nw-glance__sub a { font-weight: 500; }
.nw-glance__act { margin-top: var(--s-1); }

@media (max-width: 719px) {
  .nw-toolbar .searchbox { max-width: none; flex-basis: 100%; }
  .nw-cards { grid-template-columns: minmax(0, 1fr); }
  .nw-cards .section__head > .section__title { flex: 1 1 100%; }
  .nw-rec__row { grid-template-columns: minmax(0, 1fr) auto; }
  .nw-rec__row > .muted { grid-column: 1 / -1; }
  .nw-out { padding: var(--s-3); gap: var(--s-2); }
  .nw-out__item { padding: var(--s-3); }
  .nw-out__acts .btn { flex: 1 1 auto; }
  .nw-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-glance__tile { padding: var(--s-3) var(--s-4); }
  .nw-glance__tile:first-child { grid-column: 1 / -1; }
  .nw-glance__value { font-size: var(--t-15); }
}

/* a related card's status word wraps inside the card on a narrow screen instead of running past its edge */
.nw-site .lcard > .status { max-width: 100%; min-width: 0; white-space: normal; }
