/* NetPulse by Silverlane — console styles. Mobile-first; the media queries widen the
   layout on larger viewports. No build step. */
:root {
  --teal: #14b8a6; --teal-dark: #0d9488; --ink: #0f172a; --muted: #64748b;
  --bg: #f1f5f9; --card: #ffffff; --line: #e2e8f0; --line-soft: #eef2f7;
  --green: #16a34a; --green-bg: #dcfce7; --yellow: #d97706; --yellow-bg: #fef3c7;
  --red: #dc2626; --red-bg: #fee2e2; --slate-bg: #f1f5f9;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── header ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(150%) blur(8px); border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) 0 0 0;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; }
.brand .logo { width: 26px; height: 26px; flex: none; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.brand .dot { color: var(--teal); }
.brand .by { color: var(--muted); font-size: 12px; display: none; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 64px; }

/* ── generic bits ───────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
           letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 2px 0 14px; }
.crumbs a::after { content: " ›"; color: var(--line); }
.empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink);
       border-radius: 10px; padding: 9px 14px; font-size: 14px; min-height: 40px; }
.btn:hover { border-color: var(--teal); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btnbar { display: flex; gap: 8px; flex-wrap: wrap; }

input, textarea, select { font-family: inherit; font-size: 15px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff;
  color: var(--ink); }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
label.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ── status chips ───────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
        border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-green { color: var(--green); background: var(--green-bg); }
.chip-yellow { color: var(--yellow); background: var(--yellow-bg); }
.chip-red { color: var(--red); background: var(--red-bg); }
.chip-plain { color: var(--muted); background: var(--slate-bg); }
.sev-critical, .sev-high { color: var(--red); }
.sev-medium { color: var(--yellow); }
.sev-low, .sev-info { color: var(--muted); }

/* level dot for agent status */
.lvl { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lvl-nominal { background: var(--green); } .lvl-watch { background: var(--yellow); }
.lvl-impacted { background: #ea580c; } .lvl-critical { background: var(--red); }

/* ── customer / asset list rows ─────────────────────────────────────────── */
.tile { display: block; background: var(--card); border: 1px solid var(--line);
        border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tile:hover { border-color: var(--teal); }
.tile .name { font-weight: 600; font-size: 16px; }
.tile .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

.linkrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
           border-top: 1px solid var(--line-soft); }
.linkrow:first-of-type { border-top: 0; }
.linkrow .lbl { font-weight: 600; }
.linkrow .sub { color: var(--muted); font-size: 12px; }
.linkrow .grow { margin-left: auto; text-align: right; }

/* agent panel */
.agentpanel { background: linear-gradient(180deg, #ecfeff 0%, #ffffff 70%);
              border: 1px solid #cffafe; }
.agentpanel .head { display: flex; align-items: center; gap: 8px; }
.agentpanel .head .tag { font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal-dark); }
.agentpanel .headline { font-size: 15px; font-weight: 600; margin: 8px 0 2px; }
.feed { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { display: flex; gap: 9px; padding: 7px 0; border-top: 1px dashed var(--line-soft);
           font-size: 13px; }
.feed li .when { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* signals / events / feeds list */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.list li:first-child { border-top: 0; }
.tag-pill { font-size: 11px; background: var(--slate-bg); color: var(--muted);
            border-radius: 6px; padding: 2px 7px; }

.notice { font-size: 13px; border-radius: 10px; padding: 10px 12px; }
.notice-info { background: #ecfeff; color: #0e7490; border: 1px solid #cffafe; }
.notice-warn { background: var(--yellow-bg); color: #92400e; border: 1px solid #fde68a; }

/* ── login ──────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { width: 40px; height: 40px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* footer */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 16px 40px; }
.foot .ethos { color: var(--teal-dark); font-weight: 600; }

/* ── wider viewports ────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .brand .by { display: inline; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .detail-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 16px; align-items: start; }
  .detail-grid > * { margin-bottom: 0; }
}
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line);
        border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite;
        vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
