:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e9f1;
  --brand: #1f5eff;
  --brand-dark: #0f172a;
  --ok: #16804a;
  --ok-soft: #eaf8f0;
  --fail: #d92d20;
  --fail-soft: #fff0ee;
  --stale: #b76e00;
  --stale-soft: #fff7df;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
}

/* Identidad visual Wimbitek: turquesa corporativo y gris antracita. */
:root {
  --bg: #f5f8f8;
  --surface-muted: #f0f6f6;
  --ink: #404145;
  --muted: #6a6b70;
  --line: #dbe7e7;
  --brand: #00a4aa;
  --brand-dark: #404145;
  --ok: #008f76;
  --ok-soft: #e5f6f2;
  --shadow: 0 10px 30px rgba(64, 65, 69, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  backdrop-filter: blur(14px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1120px;
  min-height: 68px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  place-items: center;
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: 18px;
  font-weight: 800;
}

.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 1px;
  color: #aeb9cc;
  font-size: 12px;
}

.refresh-button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-left: 10px;
  padding: 0;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.refresh-button:active {
  transform: scale(0.96);
}

.refresh-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.refresh-button span {
  display: none;
}

.refresh-button.is-loading svg {
  animation: spin 0.75s linear infinite;
}

.dashboard {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 14px 48px;
}

.iot-dashboard { display: grid; gap: 26px; }
.iot-dashboard .systems { margin: 0; }
.iot-service-grid, .iot-activity-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.iot-activity-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.iot-series-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.iot-series-card { padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.iot-series-card h3 { margin: 0 0 6px; font-size: 17px; }
.iot-bar-chart { display: block; width: 100%; height: auto; }
.iot-line-chart__grid { stroke: var(--line); stroke-width: 1; }
.iot-line-chart__label { fill: var(--muted); font: 11px system-ui, sans-serif; }
.iot-bar-chart__value { fill: var(--ink); font: 600 9px system-ui, sans-serif; }
.iot-line-chart__current { fill: rgba(0, 164, 170, .10); }
.iot-series-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.iot-series-key { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 700; }
.iot-series-key::before { width: 12px; height: 12px; border-radius: 2px; content: ""; }
.iot-series-key--sigfox::before { background: #009da5; }
.iot-series-key--2g::before { background: #6354c7; }
.iot-series-current-note { margin-left: auto; }
.iot-series-empty { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .iot-series-card { padding: 16px 12px 14px; } .iot-bar-chart__value { font-size: 7px; } .iot-series-current-note { flex-basis: 100%; margin-left: 0; } }
.iot-activity-card h3 { margin: 0 0 16px; }
.iot-field { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
.iot-field span, .iot-time-note { color: var(--muted); font-size: 13px; }
.iot-field strong { overflow-wrap: anywhere; }

.overview,
.host-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview {
  padding: 20px;
}

.overview__heading {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.traffic-heading-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.period-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.period-picker select {
  min-height: 36px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 0;
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.global-status,
.status-badge,
.service-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.global-status {
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.global-status--ok,
.status-badge--ok,
.service-status--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.global-status--fail,
.status-badge--fail,
.service-status--fail {
  background: var(--fail-soft);
  color: var(--fail);
}

.status-dot {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 13%, transparent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.summary-grid--traffic {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.hourly-chart {
  margin-top: 18px;
  padding: 14px 15px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.hourly-chart__heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hourly-chart__heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.hourly-chart__plot {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  height: 116px;
  margin-top: 9px;
  column-gap: 7px;
}

.hourly-chart__axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 27px;
  height: calc(100% - 19px);
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  text-align: right;
}

.hourly-chart__axis span:first-child {
  transform: translateY(-1px);
}

.hourly-chart__axis span:last-child {
  transform: translateY(1px);
}

.hourly-chart__area {
  position: relative;
  min-width: 0;
}

.hourly-chart__grid {
  display: flex;
  position: absolute;
  inset: 0 0 19px;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.hourly-chart__grid span {
  width: 100%;
  border-top: 1px solid #d5e2e2;
}

.hourly-chart__bars {
  display: grid;
  position: relative;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  height: 100%;
  gap: 3px;
}

.hourly-chart__column {
  display: flex;
  position: relative;
  align-items: end;
  height: 100%;
  padding-bottom: 19px;
}

.hourly-chart__bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #20b7bb, var(--brand));
}

.hourly-chart__bars--bots .hourly-chart__bar {
  background: linear-gradient(180deg, #f7c948, #d99900);
}

.hourly-chart__bars--suspicious .hourly-chart__bar,
.hourly-chart__bars--fail2ban .hourly-chart__bar {
  background: linear-gradient(180deg, #f97066, var(--fail));
}

.hourly-chart__column small {
  position: absolute;
  bottom: 0;
  left: 50%;
  color: var(--muted);
  font-size: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.summary-card {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.summary-card--ok {
  border-color: #caead8;
  background: var(--ok-soft);
}

.summary-card--fail {
  border-color: #f7ccc7;
  background: var(--fail-soft);
}

.summary-card--stale {
  border-color: #f0d596;
  background: var(--stale-soft);
}

.summary-card--stale strong { color: var(--stale); }

.summary-card__label,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card__label {
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  margin: 3px 0 1px;
  font-size: 25px;
  line-height: 1;
}

.summary-card--ok strong {
  color: var(--ok);
}

.summary-card--fail strong {
  color: var(--fail);
}

.summary-card small {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.update-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.classification-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.traffic-domain-table {
  min-width: 940px;
}

.metric-human {
  color: var(--ok);
  font-weight: 800;
}

.metric-suspicious {
  color: var(--fail);
  font-weight: 800;
}

.incident-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 0;
  padding: 15px;
  border: 1px solid #f5c4be;
  border-radius: 16px;
  background: var(--fail-soft);
  color: #8f2118;
}

/* El atributo HTML hidden debe prevalecer sobre el layout de la alerta. */
.incident-banner[hidden] {
  display: none !important;
}

.incident-banner__icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--fail);
  color: #fff;
  font-weight: 800;
}

.incident-banner strong {
  font-size: 16px;
}

.incident-banner p {
  margin: 2px 0 0;
  color: #a74137;
  font-size: 14px;
}

.systems {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.section-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.host-grid {
  display: grid;
  gap: 14px;
}

.refresh-button--link {
  color: #fff;
  text-decoration: none;
  font-size: 25px;
  line-height: 1;
}

.table-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-muted); color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.is-selected { background: #edf3ff; }
td a, .filter-meta a { color: var(--brand); font-weight: 700; text-decoration: none; }
.backend-pill { display: inline-block; margin: 0 4px 4px 0; padding: 3px 7px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 12px; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.filter-meta, .privacy-note { color: var(--muted); font-size: 13px; }
.filter-meta { margin: 12px 2px 0; }
.privacy-note { margin: 14px 2px 0; }

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  place-items: center;
  overflow-x: hidden;
  isolation: isolate;
  background: #f0f6f6;
}

.login-page::before,
.login-page::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  will-change: transform;
}

.login-page::before {
  top: -95px;
  left: -90px;
  width: clamp(220px, 29vw, 420px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(0, 164, 170, .20) 0 58%, rgba(0, 164, 170, .12) 70%, transparent 72%);
  animation: login-orb-one 18s ease-in-out infinite alternate;
}

.login-page::after {
  right: -120px;
  bottom: -115px;
  width: clamp(280px, 35vw, 510px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(0, 143, 118, .18) 0 58%, rgba(0, 143, 118, .10) 70%, transparent 72%);
  animation: login-orb-two 23s ease-in-out infinite alternate;
}

@keyframes login-orb-one {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(7vw, 5vh, 0) scale(1.12); }
}

@keyframes login-orb-two {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(-6vw, -5vh, 0) scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .login-page::before,
  .login-page::after { animation: none; }
}

.login-widget {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  min-width: 0;
  padding: 34px;
  border: 1px solid #d4e7e5;
  border-top: 5px solid var(--brand);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(38, 74, 75, .16);
}

.login-widget__brand {
  width: min(100%, 260px);
  margin: 0 auto 18px;
}

.login-widget__brand img { display: block; width: 100%; height: auto; }
.login-widget__error { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--fail-soft); color: var(--fail); font-size: 13px; font-weight: 700; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 750; }
.login-form input { width: 100%; padding: 12px 13px; border: 1px solid #c9d8d8; border-radius: 10px; outline: none; color: var(--ink); font: inherit; }
.login-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 164, 170, .16); }
.login-form button { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 13px 15px; cursor: pointer; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 800; }
.login-form button:hover { background: #008d92; }

@media (max-width: 680px) {
  .detail-grid { grid-template-columns: 1fr; }
  .login-page {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .login-widget {
    width: min(100%, 420px);
    padding: 25px 20px;
    border-radius: 18px;
  }

  .login-widget__brand {
    width: min(100%, 210px);
    margin-bottom: 16px;
  }

  .login-form { gap: 14px; }

  .login-form input {
    min-height: 48px;
    font-size: 16px;
  }

  .login-form button {
    min-height: 52px;
    margin-top: 2px;
  }
}

.host-card {
  position: relative;
  overflow: hidden;
}

.host-card > summary {
  list-style: none;
  cursor: pointer;
}

.host-card > summary::-webkit-details-marker {
  display: none;
}

.host-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--ok);
  content: "";
}

.host-card--fail::before {
  background: var(--fail);
}

.host-card--stale::before { background: var(--stale); }

.host-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  gap: 12px;
  padding: 17px 16px 15px 19px;
  border-bottom: 1px solid var(--line);
}

.host-card:not([open]) .host-card__header {
  border-bottom: 0;
}

.host-card__header:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: -3px;
}

.host-card__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.host-card__labels {
  display: grid;
  min-width: 0;
  min-height: 52px;
  align-content: center;
}

.host-card__icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #edf2ff;
  color: var(--brand);
}

.host-card__icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.host-card__identity p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.host-card__identity h3 {
  overflow-wrap: anywhere;
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.15;
}

.status-badge {
  flex: 0 0 auto;
  gap: 7px;
  padding: 7px 10px;
  font-size: 12px;
}

.freshness-badge {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 10px;
  font-weight: 800;
}

.freshness-badge--stale { background: var(--stale-soft); color: var(--stale); }
.freshness-badge--no_data { background: #edf0f3; color: var(--muted); }

.host-card__controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.host-card__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.host-card__toggle > span:last-child {
  font-size: 17px;
  line-height: .7;
  transition: transform .18s ease;
}

.host-card[open] .host-card__toggle-text {
  font-size: 0;
}

.host-card[open] .host-card__toggle-text::after {
  content: "Ocultar";
  font-size: 12px;
}

.host-card[open] .host-card__toggle > span:last-child {
  transform: rotate(180deg);
}

.service-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.snapshot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.snapshot-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--fail-soft);
  color: #9f342b;
  font-size: 13px;
}

.history-strip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.history-strip__heading { display: flex; justify-content: space-between; color: var(--ink); font-size: 12px; }
.history-strip__heading small { color: var(--muted); }
.history-strip__items { display: flex; overflow-x: auto; gap: 9px; margin-top: 9px; padding-bottom: 3px; }
.history-dot { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.history-dot > span { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.history-dot--fail > span, .history-dot--error > span { background: var(--fail); }

.service-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.service-card--fail {
  border-color: #f1b9b3;
}

.service-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface-muted);
}

.service-card--fail .service-card__header {
  background: var(--fail-soft);
}

.service-card__label {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-card h4 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 16px;
}

.service-status {
  flex: 0 0 auto;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
}

.service-status .status-dot {
  flex-basis: 7px;
  width: 7px;
  height: 7px;
}

.component-list {
  padding: 0 12px;
}

.component-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px 0;
  color: var(--ok);
}

.component-row + .component-row {
  border-top: 1px solid var(--line);
}

.component-row--fail {
  color: var(--fail);
}

.component-row__indicator {
  margin-top: 5px;
}

.component-row__content {
  min-width: 0;
}

.component-row__content strong,
.component-row__content span {
  display: block;
}

.component-row__content strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
}

.component-row__content span {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.component-row--fail .component-row__content span {
  color: #9f342b;
}

.component-row__state {
  padding: 2px 0 0 5px;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.page-footer {
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Cabecera y superficies de marca. Se mantienen al final para sustituir
   el aspecto anterior sin afectar a la estructura ni a la accesibilidad. */
.topbar { border-bottom: 3px solid var(--brand); background: rgba(255, 255, 255, .97); color: var(--ink); }
.topbar__inner { max-width: 1180px; min-height: 76px; }
.brand__mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-right: 12px;
  overflow: hidden;
  place-items: center;
  border-radius: 11px;
  background: #fff;
}
.brand__mark img {
  /* El dibujo ocupa solo la zona central del SVG: este tamaño lo hace legible
     sin cortar ninguno de sus trazos. */
  width: 130%;
  height: 130%;
  object-fit: contain;
}
.brand small { color: var(--muted); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__link { padding: 9px 12px; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.topbar__link:hover { color: var(--brand); }
.logout-form { margin: 0; }
.logout-button { padding: 8px 12px; cursor: pointer; border: 1px solid #b9d8d8; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; }
.logout-button:hover { border-color: var(--brand); color: var(--brand); }
.refresh-button { border: 1px solid var(--brand); border-radius: 10px; background: var(--brand); color: #fff; }
.dashboard { max-width: 1180px; }
.overview { position: relative; overflow: hidden; padding: 26px; border-top: 5px solid var(--brand); }
.overview::after { position: absolute; top: -130px; right: -90px; width: 310px; height: 310px; border: 45px solid #e0f2f2; border-radius: 50%; content: ""; }
.overview > * { position: relative; z-index: 1; }
.eyebrow { color: #008d92; }
.summary-card { border-radius: 10px; }
.host-card__icon { background: #e1f3f3; }
tbody tr.is-selected { background: #e8f6f6; }

/* Inventario de servidores: variante B, una fila compacta por host. */
.server-inventory { max-width: 1180px; }
.server-inventory__overview { margin-bottom: 26px; }
.server-inventory__intro { max-width: 560px; margin: 7px 0 0; color: var(--muted); }
.server-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.server-table-scroll { overflow-x: auto; }
.server-network-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.server-network-filters__label { color: var(--muted); font-size: 12px; font-weight: 750; }
.server-network-filter { min-height: 32px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 750; }
.server-network-filter[aria-pressed="true"] { border-color: var(--brand); background: #e1f3f3; color: #08777b; }
.server-network-filter:focus-visible { outline: 3px solid rgba(0, 164, 170, .28); outline-offset: 2px; }
.server-table { width: 100%; min-width: 1160px; border-collapse: collapse; font-size: 13px; }
.server-table th { padding: 13px 18px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-muted); font-size: 11px; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.server-sort-button { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0; cursor: pointer; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; }
.server-sort-button::after { content: "↕"; color: #8ba4a4; font-size: 14px; line-height: 1; }
.server-table th[aria-sort="ascending"] .server-sort-button::after { content: "↑"; color: var(--brand); }
.server-table th[aria-sort="descending"] .server-sort-button::after { content: "↓"; color: var(--brand); }
.server-sort-button:hover { color: var(--brand); }
.server-sort-button:focus-visible { outline: 3px solid rgba(0, 164, 170, .28); outline-offset: 3px; border-radius: 3px; }
.server-table td { padding: 17px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.server-table tbody tr:last-child td { border-bottom: 0; }
.server-identity { display: flex; align-items: center; gap: 11px; min-width: 175px; }
.server-identity__icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #e1f3f3; color: var(--brand); }
.server-identity__icon svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.server-identity strong, .server-identity small { display: block; }
.server-identity strong { color: var(--ink); font-size: 14px; }
.server-identity small, .server-error { margin-top: 2px; color: var(--muted); font-size: 11px; }
.server-state { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 750; white-space: nowrap; }
.server-state--unavailable { color: var(--fail); }
.server-error { display: block; max-width: 180px; overflow-wrap: anywhere; }
.server-usage { min-width: 175px; }
.server-usage > div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.server-usage strong { color: var(--ink); }
.server-usage span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.server-progress { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: #dceaea; }
.server-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.server-empty { color: var(--muted); font-size: 12px; }
.server-addresses span, .server-updates span, .server-updates small { display: block; margin-bottom: 3px; font-size: 11px; }
.server-network-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #e1f3f3; color: #08777b; font-size: 11px; font-weight: 800; white-space: nowrap; }
.server-network-badge--edge { background: var(--surface-muted); color: var(--muted); }
.server-updates { min-width: 150px; }
.server-updates strong { display: block; color: var(--ink); font-size: 12px; }
.server-updates small { color: var(--muted); }
.server-table-footer { display: flex; justify-content: space-between; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-muted); color: var(--muted); font-size: 12px; }

@media (max-width: 559px) {
  .server-inventory__overview { margin-bottom: 20px; }
  .server-table-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
  .brand__mark { flex-basis: 38px; width: 38px; height: 38px; margin-right: 10px; }
  .topbar__link { display: none; }
  .overview { padding: 20px; }
  .overview::after { right: -150px; }
  .host-card__controls { gap: 7px; }
  .host-card__toggle-text { display: none; }
  .host-card[open] .host-card__toggle-text::after { display: none; }
}

@media (min-width: 560px) {
  .dashboard {
    padding: 32px 20px 60px;
  }

  .overview {
    padding: 26px;
  }

  .overview__heading {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .traffic-heading-controls {
    justify-content: flex-end;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .summary-card {
    padding: 17px;
  }

  .summary-card__label,
  .summary-card small {
    font-size: 12px;
  }

  .summary-card strong {
    font-size: 30px;
  }

  .host-card__header,
  .service-list {
    padding: 18px;
  }

  .service-card__header,
  .component-list {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (min-width: 860px) {
  .host-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .topbar {
    padding-right: 24px;
    padding-left: 24px;
  }

  .refresh-button {
    display: flex;
    width: auto;
    padding: 0 15px;
    gap: 8px;
  }

  .refresh-button span {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Diseño de bolsillo: conservar toda la navegación y evitar que los datos se
   compriman hasta resultar difíciles de leer o tocar. */
@media (max-width: 559px) {
  body {
    font-size: 15px;
  }

  .topbar {
    padding: calc(8px + env(safe-area-inset-top)) 12px 7px;
  }

  .topbar__inner {
    min-height: 54px;
    flex-wrap: nowrap;
    gap: 7px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .brand__mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small {
    font-size: 11px;
  }

  .topbar__actions {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .topbar__actions::-webkit-scrollbar {
    display: none;
  }

  .topbar__link {
    display: block;
    flex: 0 0 auto;
    padding: 8px 9px;
    border-radius: 8px;
    background: var(--surface-muted);
    font-size: 12px;
  }

  .logout-form {
    flex: 0 0 auto;
  }

  .logout-button {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .refresh-button {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin-left: 0;
    border-radius: 9px;
  }

  .dashboard {
    padding: 16px 12px calc(32px + env(safe-area-inset-bottom));
  }

  .overview,
  .iot-activity-card {
    border-radius: 16px;
  }

  .overview {
    padding: 18px;
    border-top-width: 4px;
  }

  .overview::after {
    top: -170px;
    right: -190px;
    width: 280px;
    height: 280px;
  }

  h1 {
    font-size: clamp(23px, 8vw, 30px);
  }

  .global-status {
    max-width: 100%;
    white-space: normal;
  }

  .summary-grid,
  .summary-grid--traffic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 18px;
  }

  .summary-card {
    padding: 12px 10px;
  }

  .summary-card strong {
    font-size: 24px;
  }

  .summary-card__label {
    white-space: normal;
    line-height: 1.2;
  }

  .update-meta {
    gap: 5px 7px;
    font-size: 12px;
  }

  .update-meta__separator {
    display: none;
  }

  .classification-note {
    font-size: 11px;
    line-height: 1.45;
  }

  .hourly-chart {
    margin-top: 14px;
    padding: 13px 10px 7px;
  }

  .hourly-chart__heading {
    align-items: flex-start;
    font-size: 12px;
  }

  .hourly-chart__heading small {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .hourly-chart__plot {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 5px;
  }

  .hourly-chart__axis {
    min-width: 24px;
    font-size: 8px;
  }

  .hourly-chart__bars {
    gap: 2px;
  }

  .hourly-chart__column small {
    font-size: 8px;
  }

  .incident-banner {
    gap: 10px;
    padding: 13px;
    border-radius: 14px;
  }

  .systems {
    margin-top: 22px;
  }

  .section-heading {
    align-items: flex-start;
    margin-bottom: 11px;
  }

  .section-heading h2 {
    font-size: 19px;
  }

  .host-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 8px;
    padding: 15px 13px 14px 17px;
  }

  .host-card__identity {
    grid-column: 1 / -1;
  }

  .host-card__identity h3 {
    font-size: 17px;
  }

  .host-card__controls {
    display: contents;
  }

  .status-badge {
    grid-column: 1;
    justify-self: start;
  }

  .freshness-badge {
    grid-column: 1;
    justify-self: start;
    margin-top: -7px;
  }

  .host-card__toggle {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    min-height: 40px;
    padding: 0 4px;
  }

  .host-card__toggle-text {
    display: inline;
  }

  .host-card[open] .host-card__toggle-text::after {
    display: inline;
  }

  .service-list {
    gap: 10px;
    padding: 12px;
  }

  .snapshot-meta {
    display: grid;
    justify-content: start;
  }

  .service-card__header {
    align-items: flex-start;
    padding: 11px;
  }

  .component-list {
    padding: 0 11px;
  }

  .component-row {
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 8px;
  }

  .component-row__state {
    grid-column: 2;
    padding: 0;
    font-size: 11px;
  }

  .component-row__content span {
    font-size: 12px;
  }

  .history-strip {
    padding: 11px;
  }

  .table-card {
    border-radius: 13px;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .iot-service-grid,
  .iot-activity-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .iot-activity-card {
    padding: 16px;
  }

  .login-page {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .login-widget {
    padding: 25px 20px;
    border-radius: 18px;
  }

  .topbar__actions {
    justify-content: flex-end;
    overflow: visible;
  }

  .topbar__actions > .topbar__link {
    display: none;
  }

  .mobile-menu {
    display: block;
    position: relative;
    flex: 0 0 auto;
  }

  .mobile-menu > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 6px 8px;
    cursor: pointer;
    list-style: none;
    border: 1px solid #b9d8d8;
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu[open] > summary {
    border-color: var(--brand);
    color: var(--brand);
  }

  .mobile-menu[open] > summary span {
    transform: rotate(180deg);
  }

  .mobile-menu__panel {
    display: grid;
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    right: 0;
    width: min(230px, calc(100vw - 28px));
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  }

  .mobile-menu__panel a {
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-menu__panel a:active,
  .mobile-menu__panel a:focus {
    background: var(--surface-muted);
    color: var(--brand);
  }
}

.mobile-menu {
  display: none;
}

@media (max-width: 559px) {
  .mobile-menu {
    display: block;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Panel IoT: prioridad visual para la última comunicación y las dos zonas horarias. */
.iot-dashboard {
  gap: 34px;
}

.iot-overview {
  position: relative;
  overflow: hidden;
  border-top: 5px solid var(--brand);
  background: linear-gradient(115deg, var(--surface) 0%, #f2fbfb 100%);
}

.iot-overview::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -130px;
  width: 300px;
  height: 300px;
  border: 30px solid rgba(0, 164, 170, .10);
  border-radius: 50%;
  pointer-events: none;
}

.iot-overview > * { position: relative; z-index: 1; }
.iot-overview__host { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.iot-overview__host strong { color: var(--ink); }
.iot-overview__actions,
.overview__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-refresh-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 14px; cursor: pointer; border: 1px solid var(--brand); border-radius: 11px; background: var(--brand); color: #fff; font: inherit; font-size: 13px; font-weight: 800; box-shadow: 0 5px 14px rgba(0, 164, 170, .18); transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.card-refresh-button:hover { background: #008f95; box-shadow: 0 7px 18px rgba(0, 164, 170, .24); }
.card-refresh-button:active { transform: translateY(1px); }
.card-refresh-button:focus-visible { outline: 3px solid rgba(0, 164, 170, .25); outline-offset: 3px; }
.card-refresh-button:disabled { cursor: wait; opacity: .72; }
.card-refresh-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.card-refresh-button.is-loading svg { animation: spin .75s linear infinite; }
.iot-section-note { max-width: 760px; margin: -4px 2px 0; color: var(--muted); font-size: 14px; }
.iot-refresh-feedback { flex-basis: 100%; color: var(--muted); font-weight: 700; }
.iot-refresh-feedback--ok { color: var(--ok); }
.iot-refresh-feedback--fail { color: var(--fail); }

.iot-dashboard .iot-activity-grid,
.iot-dashboard .iot-service-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}

.iot-dashboard .iot-activity-card {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfe5e5;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(46, 86, 86, .09);
}

.iot-activity-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: #edf9f8;
}

.iot-dashboard .iot-activity-card h3 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.iot-activity-card__eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.iot-message-device,
.iot-project { padding: 16px 20px; border-bottom: 1px solid var(--line); }

.iot-message-device span,
.iot-project span,
.iot-timestamp span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }

.iot-message-device strong { display: block; color: var(--ink); font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.iot-project strong { display: block; color: var(--ink); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }

.iot-timestamps { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); }
.iot-timestamp { min-width: 0; padding: 14px 20px 16px; background: var(--surface); }
.iot-timestamp--local { background: #f3fbfa; }
.iot-timestamp strong { display: block; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.iot-timestamp--local strong { color: #007b69; }

.iot-dashboard .iot-service-grid { gap: 0; overflow: hidden; border: 1px solid #cfe1e1; border-radius: 18px; background: var(--surface); box-shadow: 0 10px 28px rgba(46, 86, 86, .07); }
.iot-dashboard .service-card { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); min-width: 0; overflow: visible; border: 0; border-radius: 0; background: var(--surface); box-shadow: none; }
.iot-dashboard .service-card + .service-card { border-top: 1px solid var(--line); }
.iot-dashboard .service-card--fail { box-shadow: inset 4px 0 0 var(--fail); }
.iot-dashboard .service-card__header { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line); background: #f3f9f8; }
.iot-dashboard .service-card--fail .service-card__header { background: var(--fail-soft); }
.iot-dashboard .service-card__labels { display: flex; align-items: center; gap: 7px; }
.iot-dashboard .service-card__label { margin: 0; }
.iot-dashboard .service-card__optional { padding: 3px 7px; border: 1px solid #c7dddd; border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; line-height: 1; text-transform: uppercase; }
.iot-dashboard .service-card h3 { margin: 4px 0 0; color: var(--ink); font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.iot-dashboard .component-list { display: grid; align-content: center; padding: 3px 20px; }
.iot-dashboard .component-row { grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 64px; padding: 12px 0; }
.iot-dashboard .component-row__indicator { margin: 0; }
.iot-dashboard .component-row__state { padding: 5px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 11px; }
.iot-dashboard .component-row--fail .component-row__state { background: var(--fail-soft); color: var(--fail); }
.iot-dashboard .component-row__content { min-width: 0; }
.iot-dashboard .component-row__content strong,
.iot-dashboard .component-row__content span { overflow-wrap: break-word; word-break: normal; }

@media (min-width: 700px) {
  .iot-overview__actions,
  .overview__actions { flex: 0 0 auto; justify-content: flex-end; }
  .iot-dashboard .iot-activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iot-timestamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 780px) {
  .iot-dashboard .iot-service-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 559px) {
  .card-refresh-button { min-height: 40px; padding: 0 12px; }
  .iot-activity-card__heading,
  .iot-message-device,
  .iot-project,
  .iot-timestamp { padding-right: 16px; padding-left: 16px; }
  .iot-message-device strong { font-size: 18px; }
  .iot-activity-card__eyebrow { display: none; }
  .iot-dashboard .service-card { display: block; }
  .iot-dashboard .service-card__header { padding: 14px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .iot-dashboard .service-card h3 { font-size: 17px; }
  .iot-dashboard .component-list { padding: 0 15px; }
  .iot-dashboard .component-row { min-height: 0; padding: 13px 0; }
}

/* Resumen operativo de ayer y hoy en la portada. */
.monitor-iot-activity {
  margin-top: 26px;
}

.monitor-iot-activity__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.monitor-iot-activity__heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.025em;
}

.monitor-iot-activity__heading a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.monitor-iot-activity__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.monitor-iot-health {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.monitor-iot-health--ok { background: var(--ok-soft); color: var(--ok); }
.monitor-iot-health--fail { background: var(--fail-soft); color: var(--fail); }
.monitor-iot-health--stale { background: var(--stale-soft); color: var(--stale); }

.monitor-iot-signal {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 13px;
}

.monitor-iot-signal--fail { border-color: #f1b9b3; background: var(--fail-soft); color: var(--fail); }
.monitor-iot-signal--stale { border-color: #ebd49f; background: var(--stale-soft); color: var(--stale); }
.monitor-iot-signal span { color: var(--ink); }

.monitor-iot-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.monitor-iot-chart {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfe5e5;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(46, 86, 86, .06);
}

.monitor-iot-chart > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 12px;
  background: #edf9f8;
}

.monitor-iot-chart > header span,
.monitor-iot-chart > header small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.monitor-iot-chart h3 { margin: 2px 0 0; font-size: 16px; letter-spacing: -.015em; }

.monitor-iot-chart__plot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.monitor-iot-tech {
  padding: 13px 16px 11px;
  background: var(--surface);
}

.monitor-iot-tech + .monitor-iot-tech { background: #f7fbfb; }

.monitor-iot-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: clamp(16px, 5vw, 38px);
  min-height: 132px;
  padding-top: 2px;
}

.monitor-iot-bar {
  display: grid;
  grid-template-rows: 18px 96px 18px;
  width: clamp(54px, 7vw, 78px);
  text-align: center;
}

.monitor-iot-bar strong { color: var(--ink); font-size: 12px; line-height: 1; }
.monitor-iot-bar > span { display: flex; align-items: end; width: clamp(28px, 4vw, 42px); height: 96px; margin: 0 auto; border-radius: 5px 5px 2px 2px; background: #edf2f2; }
.monitor-iot-bar i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 1px 1px; }
.monitor-iot-bar i.is-sigfox { background: #009da5; }
.monitor-iot-bar i.is-2g { background: #6354c7; }
.monitor-iot-bar.is-yesterday i { opacity: .45; }
.monitor-iot-bar.is-today strong { font-weight: 900; }
.monitor-iot-bar small { align-self: end; color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.monitor-iot-bar.is-zero strong { color: var(--fail); }
.monitor-iot-bar.is-zero i { background: var(--fail); }

.monitor-iot-tech__label { margin-top: 7px; color: var(--ink); font-size: 12px; text-align: center; }

.monitor-iot-chart > footer { display: flex; gap: 16px; padding: 10px 16px 12px; color: var(--muted); font-size: 11px; font-weight: 800; }
.monitor-iot-chart > footer span { display: inline-flex; align-items: center; gap: 5px; }
.monitor-iot-chart > footer span::before { width: 11px; height: 11px; border: 2px solid var(--brand); border-radius: 2px; content: ""; }
.monitor-iot-chart > footer .is-yesterday::before { opacity: .45; background: var(--brand); }
.monitor-iot-chart > footer .is-today::before { background: var(--brand); }

.main-iot-message {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.main-iot-message > div {
  min-width: 0;
}

.main-iot-message span,
.main-iot-message b {
  display: block;
  overflow-wrap: anywhere;
}

.component-row__content .main-iot-message span {
  margin: 0 0 1px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.main-iot-message b {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

@media (min-width: 700px) {
  .main-iot-message { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 700px) {
  .monitor-iot-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 559px) {
  .monitor-iot-activity__heading { align-items: flex-start; }
  .monitor-iot-activity__actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .monitor-iot-signal { display: grid; gap: 3px; }
  .monitor-iot-tech { padding-right: 8px; padding-left: 8px; }
  .monitor-iot-bars { gap: 12px; }
  .monitor-iot-bar { width: 58px; }
}


.history-picker { display: inline-flex; align-items: center; gap: 4px; }
.history-strip__heading { align-items: center; gap: 10px; }
.history-strip__controls { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.history-picker button, .history-picker select { min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.history-picker button { padding: 7px 10px; }
.history-picker button:first-of-type { border-radius: 9px 0 0 9px; }
.history-picker button:last-of-type { border-radius: 0 9px 9px 0; }
.history-picker button + button { margin-left: -5px; }
.history-picker button.is-selected { position: relative; z-index: 1; border-color: var(--brand); background: var(--brand); color: #fff; }
.history-picker--mobile { display: none; gap: 8px; }
.history-picker--mobile label { color: var(--muted); font-size: 12px; font-weight: 700; }
.history-picker select { border-radius: 9px; padding: 7px 28px 7px 10px; }
.history-timeline { display: flex; min-height: 52px; margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.history-timeline__segment { display: grid; min-width: 0; align-content: center; gap: 2px; padding: 5px 4px; color: #18312b; font-size: 10px; text-align: center; overflow: hidden; }
.history-timeline__segment + .history-timeline__segment { border-left: 2px solid var(--surface); }
.history-timeline__segment b, .history-timeline__segment small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-timeline__segment b { font-size: 11px; }
.history-timeline__segment--ok { background: var(--ok-soft); }
.history-timeline__segment--fail, .history-timeline__segment--error { background: var(--fail-soft); color: #81251e; }
.history-timeline__segment--no_data { background: var(--stale-soft); color: #6f4500; }
.history-timeline__legend { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, white); outline-offset: 3px; }
@media (max-width: 620px) { .history-picker--desktop { display: none; } .history-picker--mobile { display: inline-flex; } .history-strip__heading { align-items: flex-start; flex-direction: column; } .history-strip__controls { justify-content: flex-start; } .history-timeline__segment { min-width: 0; padding: 4px 2px; } }

.vpn-intro { max-width: 620px; margin: 8px 0 0; color: var(--muted); }
.vpn-table-card { overflow-x: auto; }
.vpn-table-card table { min-width: 860px; }
.vpn-peer-identity { min-width: 175px; }
.vpn-peer-identity strong, .vpn-peer-identity small { display: block; }
.vpn-peer-identity small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.vpn-peer-state { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.vpn-peer-state--recent { color: var(--ok); }
.vpn-peer-state--recent .status-dot { background: var(--ok); }
.vpn-peer-state--stale { color: var(--fail); }
.vpn-peer-state--stale .status-dot { background: var(--fail); }
.vpn-peer-state--never { color: var(--muted); }
.vpn-peer-state--never .status-dot { background: var(--muted); }

@media (max-width: 620px) {
  .vpn-table-card { margin-right: -4px; margin-left: -4px; }
  .vpn-table-card table { min-width: 860px; }
}
