:root {
  --bg: #071018;
  --bg-2: #0d1f29;
  --panel: rgba(12, 27, 35, 0.82);
  --panel-border: rgba(165, 210, 205, 0.12);
  --text: #edf6f4;
  --muted: #93b2b0;
  --accent: #52ddb4;
  --accent-2: #f0b15e;
  --danger: #f86f67;
  --radius: 22px;
  --font: "Avenir Next", "Segoe UI", "IBM Plex Sans", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 20% 0%, rgba(82, 221, 180, 0.2), transparent 28%),
    radial-gradient(circle at 100% 20%, rgba(240, 177, 94, 0.16), transparent 20%),
    linear-gradient(150deg, #061019 0%, #0b1822 50%, #132733 100%);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  padding: 26px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 14, 20, 0.55);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: auto;
}

.brand { margin: 8px 0 0; font-size: 2rem; line-height: 0.95; }
.sidebar-copy { color: var(--muted); line-height: 1.5; margin-top: 14px; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; }

.nav { display: grid; gap: 8px; margin-top: 30px; }

.nav-item,
button,
.logout-link {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
}

.nav-item {
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(82, 221, 180, 0.24), rgba(82, 221, 180, 0.08));
  border: 1px solid rgba(82, 221, 180, 0.22);
}

.sidebar-footer { display: grid; gap: 12px; }
.user-badge { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.04); color: var(--muted); }
.logout-link { text-decoration: none; color: var(--text); background: rgba(255,255,255,0.06); text-align: center; }

.main {
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
h1,h2,h3,p,pre { margin: 0; }

.notice-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.05);
}

.notice-bar.info {
  border-color: rgba(82, 221, 180, 0.18);
  background: rgba(82, 221, 180, 0.08);
}

.notice-bar.success {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.12);
}

.notice-bar.error {
  border-color: rgba(248, 111, 103, 0.3);
  background: rgba(248, 111, 103, 0.12);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(240, 177, 94, 0.14);
}

.hero-status.ok .dot { background: var(--accent); box-shadow: 0 0 0 6px rgba(82, 221, 180, 0.14); }
.hero-status.bad .dot { background: var(--danger); box-shadow: 0 0 0 6px rgba(248, 111, 103, 0.16); }

button {
  color: #06222b;
  background: linear-gradient(135deg, var(--accent), #9cf0db);
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button.ghost { color: var(--text); background: rgba(255,255,255,0.06); }
button.danger { color: #fff5f4; background: rgba(248, 111, 103, 0.28); }

.view { display: none; margin-top: 18px; }
.view.active { display: block; }

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.panel,
.metric-card,
.listener-card,
.generic-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.metric-card { padding: 18px 20px; }
.metric-card .label { color: var(--muted); }
.metric-card .value { margin-top: 8px; font-size: 1.9rem; font-weight: 700; }

.panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.capacity-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.capacity-health-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.capacity-health-top strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.capacity-health-detail,
.capacity-cell-meta,
.capacity-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.config-import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.config-import-summary > div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.capacity-meter {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.capacity-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(82, 221, 180, 0.95), rgba(156, 240, 219, 0.95));
}

.capacity-meter.warn .capacity-meter-fill {
  background: linear-gradient(90deg, rgba(240, 177, 94, 0.95), rgba(255, 228, 161, 0.95));
}

.capacity-meter.bad .capacity-meter-fill {
  background: linear-gradient(90deg, rgba(248, 111, 103, 0.95), rgba(255, 177, 170, 0.95));
}

.capacity-table-wrap {
  overflow: auto;
  border-radius: 18px;
}

.capacity-table td {
  min-width: 100px;
}

.capacity-pressure {
  display: inline-flex;
  min-width: 82px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.capacity-pressure.ok {
  border-color: rgba(82, 221, 180, 0.18);
  background: rgba(82, 221, 180, 0.08);
}

.capacity-pressure.warn {
  border-color: rgba(240, 177, 94, 0.18);
  background: rgba(240, 177, 94, 0.08);
}

.capacity-pressure.bad {
  border-color: rgba(248, 111, 103, 0.2);
  background: rgba(248, 111, 103, 0.1);
}

.diagnostics-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.diagnostics-port-panel,
.diagnostics-detail-panel {
  min-height: calc(100vh - 140px);
}

.diagnostics-detail-panel {
  overflow: hidden;
}

.diagnostic-port-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.diagnostic-port-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.diagnostic-port-item.active {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.1);
}

.panel { padding: 22px; }
.panel-wide { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

.feed {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.feed-item,
.file-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.feed-item .top,
.file-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.feed-item .body { margin-top: 6px; line-height: 1.45; }

.alert-item.critical {
  border-left: 4px solid #f86f67;
  background: rgba(248, 111, 103, 0.08);
}

.alert-item.warning {
  border-left: 4px solid #f7c66b;
  background: rgba(247, 198, 107, 0.08);
}

.alert-item.info {
  border-left: 4px solid #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.compact-select {
  min-width: 180px;
}

.listeners-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.protocols-shell {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.protocols-list-panel,
.protocols-detail-panel {
  min-height: 420px;
}

.protocol-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.protocol-card:hover,
.protocol-card.active {
  transform: translateY(-2px);
  border-color: rgba(82, 221, 180, 0.28);
  box-shadow: 0 18px 50px rgba(16, 33, 44, 0.18);
}

.protocol-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.protocol-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 123, 255, 0.12);
  color: #0f4fa8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.protocol-chip.muted {
  background: rgba(120, 120, 120, 0.12);
  color: #666;
}

.protocol-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.protocol-detail-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.025);
}

.protocol-metric-strip {
  margin-top: 16px;
}

.panel-head.compact {
  margin-bottom: 14px;
  align-items: flex-start;
}

.protocol-listeners,
.protocol-doc-list {
  display: grid;
  gap: 12px;
}

.protocol-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.protocol-listener-item,
.protocol-doc-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.protocol-listener-item {
  text-align: left;
  cursor: pointer;
}

.protocol-listener-item:hover {
  border-color: rgba(82, 221, 180, 0.24);
}

.protocol-listener-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.protocol-doc-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.protocol-doc-item span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-doc-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
}

.protocol-doc-item:hover,
.protocol-doc-item.active {
  border-color: rgba(82, 221, 180, 0.24);
}

.protocol-readme {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(17, 24, 29, 0.96);
  color: #dff7f1;
  line-height: 1.5;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.listener-card,
.generic-card { padding: 18px; }

.listener-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.listener-protocol { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }

.listener-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  text-transform: capitalize;
}

.listener-status.running {
  color: #d6fff1;
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.12);
}

.listener-status.starting,
.listener-status.restarting {
  color: #ffefcf;
  border-color: rgba(240, 177, 94, 0.24);
  background: rgba(240, 177, 94, 0.12);
}

.listener-status.idle {
  color: #d8edff;
  border-color: rgba(106, 179, 255, 0.24);
  background: rgba(106, 179, 255, 0.12);
}

.listener-status.error,
.listener-status.stopped,
.listener-status.disabled {
  color: #ffd7d3;
  border-color: rgba(248, 111, 103, 0.24);
  background: rgba(248, 111, 103, 0.1);
}

.listener-meta,
.stats {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.summary-chip {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.summary-chip .label {
  font-size: 12px;
  color: var(--muted);
}

.summary-chip .value {
  margin-top: 4px;
  font-weight: 700;
}

.stacked-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.stacked-label > span {
  font-size: 12px;
  color: var(--muted);
}

.compact-textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.secondary-ip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}

.secondary-ip-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-ip-value {
  font-weight: 700;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.secondary-ip-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

.secondary-ip-status.ok {
  color: #9cf1b8;
  background: rgba(50, 135, 80, 0.2);
}

.secondary-ip-status.warn {
  color: #ffd987;
  background: rgba(163, 116, 17, 0.2);
}

.secondary-ip-status.muted {
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.secondary-ip-addbar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.secondary-ip-addbar .search-input {
  flex: 1;
}

.secondary-ip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.network-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.network-feedback.info {
  background: rgba(83, 154, 255, 0.12);
  color: #cde1ff;
}

.network-feedback.success {
  background: rgba(60, 173, 103, 0.14);
  color: #c9f4d7;
}

.network-feedback.error {
  background: rgba(201, 82, 82, 0.14);
  color: #ffd4d4;
}

.gprs-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.gprs-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.gprs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gprs-preview {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.gprs-preview .label {
  font-size: 12px;
  color: var(--muted);
}

.gprs-preview .value {
  margin-top: 6px;
  word-break: break-word;
  font-size: 13px;
}

.listener-activity-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.mini-connection-count {
  min-width: 42px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}

.mini-connection-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mini-connection,
.connection-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.mini-connection.live,
.connection-card.live {
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.06);
}

.mini-connection-top,
.connection-card-top,
.connection-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mini-connection-meta,
.connection-peer,
.connection-section-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mini-connection-preview,
.connection-preview-block .value {
  margin-top: 8px;
  word-break: break-word;
  font-size: 13px;
}

.mini-connection-empty {
  margin-top: 12px;
  color: var(--muted);
}

.connection-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.connection-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.connection-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.connection-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.connection-preview-block {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.connection-preview-block .label {
  font-size: 12px;
  color: var(--muted);
}

.diagnostic-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.diagnostic-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.diagnostic-list-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.diagnostic-list-items,
.timeline-list {
  display: grid;
  gap: 10px;
  max-height: 880px;
  overflow: auto;
}

.diagnostic-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px;
}

.diagnostic-item.active {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.1);
}

.diagnostic-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagnostic-item-meta,
.diagnostic-item-preview,
.timeline-top,
.timeline-preview {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-item-preview,
.timeline-summary,
.timeline-preview {
  word-break: break-word;
}

.diagnostic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

.diagnostic-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(82, 221, 180, 0.12);
}

.diagnostic-dot.recent {
  background: #58a6ff;
  box-shadow: 0 0 0 5px rgba(88, 166, 255, 0.12);
}

.diagnostic-dot.idle {
  background: rgba(255,255,255,0.35);
}

.timeline-panel {
  margin-top: 14px;
  padding: 18px;
}

.visor-history-panel {
  overflow: hidden;
}

.visor-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  max-height: 980px;
  overflow: auto;
}

.visor-entry-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.visor-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(24, 39, 47, 0.98), rgba(15, 28, 35, 0.98));
  border-bottom: 1px solid rgba(82, 221, 180, 0.18);
}

.visor-entry-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.visor-entry-message {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visor-entry-times {
  display: grid;
  gap: 8px;
  padding: 14px 16px 10px;
  background: rgba(82, 221, 180, 0.08);
}

.visor-time-block .label {
  font-size: 12px;
  color: rgba(237, 246, 244, 0.72);
}

.visor-time-block strong {
  display: block;
  margin-top: 4px;
  color: #a5ff7f;
  font-size: 1rem;
}

.visor-entry-summary {
  padding: 12px 16px 0;
  color: var(--muted);
  word-break: break-word;
  font-size: 13px;
}

.visor-entry-summary.raw {
  padding-top: 10px;
}

.visor-entry-summary.raw strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.visor-entry-summary.raw div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.visor-entry-table-wrap {
  padding: 12px 16px 16px;
}

.visor-entry-table {
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  overflow: hidden;
}

.visor-entry-table th,
.visor-entry-table td {
  padding: 9px 10px;
}

.visor-entry-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.025);
}

.visor-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.timeline-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
}

.timeline-summary {
  margin-top: 8px;
}

.gprs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.gprs-badge.enviado {
  color: #ffefcf;
  border-color: rgba(240, 177, 94, 0.24);
  background: rgba(240, 177, 94, 0.12);
}

.gprs-badge.ack_posterior {
  color: #d6fff1;
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.12);
}

.gprs-badge.sin_confirmacion {
  color: #ffd7d3;
  border-color: rgba(248, 111, 103, 0.24);
  background: rgba(248, 111, 103, 0.1);
}

.gprs-badge.idle {
  color: var(--muted);
}

.stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { margin-top: 4px; font-size: 1rem; font-weight: 700; }

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font: inherit;
}

.search-input {
  max-width: 420px;
}

textarea { min-height: 110px; resize: vertical; }
#configEditor { min-height: 420px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-row input { width: 18px; height: 18px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.card-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.card-feedback.busy {
  color: #ffefcf;
  border: 1px solid rgba(240, 177, 94, 0.18);
}

.card-feedback.success {
  color: #d6fff1;
  border: 1px solid rgba(82, 221, 180, 0.18);
}

.create-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.protocol-create-helper {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(82, 221, 180, 0.12);
  background: rgba(82, 221, 180, 0.05);
}

.protocol-create-helper h4 {
  margin: 0 0 6px;
}

.hidden { display: none; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: top;
}

.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.log-content {
  min-height: 520px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  overflow: auto;
  white-space: pre-wrap;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell { width: min(520px, calc(100vw - 32px)); }
.login-card {
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(145deg, rgba(16, 34, 44, 0.84), rgba(8, 20, 28, 0.82));
  box-shadow: var(--shadow);
}

.login-form { display: grid; gap: 14px; margin-top: 18px; }
.login-error { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: rgba(248,111,103,0.14); border: 1px solid rgba(248,111,103,0.25); color: #ffd5d1; }

@media (max-width: 1100px) {
  .app-shell { height: auto; grid-template-columns: 1fr; overflow: visible; }
  .sidebar { height: auto; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .main { overflow: visible; }
  .panel-grid { grid-template-columns: 1fr; }
  .protocols-shell,
  .protocol-detail-grid { grid-template-columns: 1fr; }
  .diagnostics-shell { grid-template-columns: 1fr; }
  .diagnostics-port-panel,
  .diagnostics-detail-panel,
  .diagnostic-port-list { min-height: 0; max-height: none; }
}

@media (max-width: 760px) {
  .main { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .form.compact { grid-template-columns: 1fr; }
  .gprs-grid { grid-template-columns: 1fr; }
  .connection-chip-grid { grid-template-columns: 1fr; }
  .connection-section-head { flex-direction: column; }
  .diagnostic-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .diagnostic-layout { grid-template-columns: 1fr; }
  .visor-compact-grid { grid-template-columns: 1fr; }
  .visor-history-grid { grid-template-columns: 1fr; }
}
