/* Servora Observability Design System */
:root {
  color-scheme: dark;
  --bg: #080b10;
  --bg-subtle: #0c1017;
  --surface: #10151f;
  --surface-raised: #141b27;
  --surface-hover: #192231;
  --border: #1e2736;
  --border-light: #283448;
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #818cf8;
  --accent-subtle: rgba(99, 102, 241, 0.12);

  --emerald: #10b981;
  --emerald-subtle: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --sky: #38bdf8;
  --sky-subtle: rgba(56, 189, 248, 0.14);
  --sky-border: rgba(56, 189, 248, 0.35);

  --violet: #a855f7;
  --violet-subtle: rgba(168, 85, 247, 0.14);
  --violet-border: rgba(168, 85, 247, 0.35);

  --amber: #f59e0b;
  --amber-subtle: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.35);

  --rose: #f43f5e;
  --rose-subtle: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(244, 63, 94, 0.35);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 4px 8px -4px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Typography & Links */
a {
  color: var(--sky);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #7dd3fc;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

code, kbd, pre {
  font-family: var(--font-mono);
}

code {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

/* Sidebar Navigation */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #0b0f17;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  z-index: 40;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.brand-logo {
  display: block;
  max-width: 140px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

nav {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding-right: 2px;
}

nav::-webkit-scrollbar {
  width: 4px;
}
nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.nav-label {
  display: block;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 14px 8px 5px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin: 1px 0;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

nav a i.nav-icon {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  opacity: 0.8;
  color: var(--text-muted);
}

nav a:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

nav a.active {
  background: var(--accent-subtle);
  color: #c7d2fe;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.28);
}
nav a.active i.nav-icon {
  color: var(--accent-light);
  opacity: 1;
}

.account {
  border-top: 1px solid var(--border);
  padding: 12px 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 12px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3730a3, #4338ca);
  border: 1px solid #6366f1;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
}

.account span.username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.account form {
  margin: 0;
}

.account button, .link {
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.account button:hover, .link:hover {
  color: var(--rose);
  background: var(--rose-subtle);
}

/* Main Area */
main {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(11, 15, 23, 0.82);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

header h1 {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-clock {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.server-badge code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
  background: var(--emerald-subtle);
  border: 1px solid var(--emerald-border);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.live i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.mobile-nav {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 8px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Page Content */
.content {
  padding: 20px 24px 48px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* Alerts */
[hidden], .alert[hidden] {
  display: none !important;
}

.alert {
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--sky-border);
  color: #bae6fd;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert.warning {
  background: var(--amber-subtle);
  border-color: var(--amber-border);
  color: #fde68a;
}

.alert.error {
  background: var(--rose-subtle);
  border-color: var(--rose-border);
  color: #fecdd3;
}

/* Cards & Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 0;
  transition: border-color 0.15s ease;
}

.panel:hover {
  border-color: var(--border-light);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  font-size: 13px;
  font-weight: 650;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-title p {
  color: var(--text-muted);
  font-size: 11px;
  margin: 2px 0 0;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 12px;
}

.metrics {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.metric-card:hover {
  border-color: var(--border-light);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-badge.violet { background: var(--violet-subtle); color: #c084fc; border: 1px solid var(--violet-border); }
.metric-badge.blue { background: var(--sky-subtle); color: #7dd3fc; border: 1px solid var(--sky-border); }
.metric-badge.amber { background: var(--amber-subtle); color: #fcd34d; border: 1px solid var(--amber-border); }
.metric-badge.green { background: var(--emerald-subtle); color: #6ee7b7; border: 1px solid var(--emerald-border); }

.metric-head small {
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
}

.metric-value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-card strong {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-family: var(--font-mono);
}

.metric-subval {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  margin: 10px 0 8px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.35s ease;
}

.metric-card:nth-child(2) .progress i {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.metric-card:nth-child(3) .progress i {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.metric-card:nth-child(4) .progress i {
  background: linear-gradient(90deg, #059669, #10b981);
}

.metric-card p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card p span.subtext {
  color: var(--text-muted);
  font-size: 10px;
}

/* Net Pair */
.net-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: baseline;
}

.net-pair span {
  display: flex;
  flex-direction: column;
}

.net-pair small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.net-pair strong {
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
  font-family: var(--font-mono);
}

/* Split Layout */
.split {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.split.lower {
  grid-template-columns: 1fr 1fr;
}

/* Canvas Charts */
.chart-panel canvas, .history-chart {
  width: 100%;
  height: 270px;
  display: block;
  border-radius: var(--radius-sm);
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cpu-dot { background: var(--violet); }
.ram-dot { background: var(--sky); }

/* Service Probes */
.service-list {
  display: flex;
  flex-direction: column;
}

.service-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 4px;
  font-size: 12px;
}

.service-list > div:first-child {
  border-top: 0;
  padding-top: 2px;
}

.service-list span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}

.status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.status.up, .status.success {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}

.status.down, .status.failed {
  background: var(--rose);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.55);
}

.status.warning {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}

.service-list b {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.service-list > div:has(.status.up) b {
  color: #34d399;
  background: var(--emerald-subtle);
  border: 1px solid var(--emerald-border);
}

.service-list > div:has(.status.down) b {
  color: #fb7185;
  background: var(--rose-subtle);
  border: 1px solid var(--rose-border);
}

/* Info List (Key-Value) */
.info {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.info > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.info > div:first-child {
  border-top: 0;
}

.info dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.info dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 11px;
}

/* Summary Box */
.summary {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 12px 14px;
  align-items: center;
  padding: 12px 0;
}

.summary strong {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.summary span {
  color: var(--text-secondary);
  font-size: 11px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

th {
  background: rgba(16, 21, 31, 0.95);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

td strong {
  color: var(--text-primary);
  font-weight: 600;
}

td code {
  max-width: 320px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-light);
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.badge.up, .badge.running, .badge.healthy {
  background: var(--emerald-subtle);
  border-color: var(--emerald-border);
  color: #34d399;
}

.badge.down, .badge.exited, .badge.unhealthy {
  background: var(--rose-subtle);
  border-color: var(--rose-border);
  color: #fb7185;
}

.badge.localhost {
  background: var(--sky-subtle);
  border-color: var(--sky-border);
  color: #38bdf8;
}

.badge.private {
  background: var(--violet-subtle);
  border-color: var(--violet-border);
  color: #c084fc;
}

.badge.potentially-exposed {
  background: var(--amber-subtle);
  border-color: var(--amber-border);
  color: #fbbf24;
}

/* Buttons & Inputs */
.button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.button:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button.danger, .link.danger {
  color: #f87171;
}
.button.danger:hover, .link.danger:hover {
  color: #fca5a5;
  background: var(--rose-subtle);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

input, select, textarea {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Range Buttons Group */
.range-buttons {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-width: 100%;
}

.range-buttons button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.range-buttons button:hover {
  color: var(--text-primary);
}

.range-buttons button.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* History Toolbar */
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.history-toolbar strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.history-toolbar small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 2px;
  font-family: var(--font-mono);
}

.chart-inline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 10px;
  padding: 6px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.chart-history-resolution {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.chart-inline-toolbar .range-buttons {
  flex-shrink: 0;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.traffic-history {
  grid-column: 1 / -1;
}

.traffic-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.traffic-summary > div {
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.traffic-summary small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.traffic-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.traffic-report-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Apps Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.app-card {
  display: flex;
  flex-direction: column;
}

.app-card .panel-title h2 {
  font-size: 14px;
  font-weight: 700;
}

.app-card .panel-title p {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Timeline (Events & Health) */
.timeline, .health-list {
  display: flex;
  flex-direction: column;
}

.timeline > div, .health-list > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline > div:first-child, .health-list > div:first-child {
  border-top: 0;
  padding-top: 2px;
}

.timeline p, .health-list p {
  margin: 0;
  flex: 1;
  font-size: 12px;
}

.timeline p strong, .health-list p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.timeline small, .health-list small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 3px;
  font-family: var(--font-mono);
}

.health-layout {
  grid-template-columns: 3fr 2fr;
}

/* Forms */
.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.form label small {
  color: var(--text-muted);
  font-size: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Logs */
.logs {
  background: #06090e;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Process UI Specific */
.process-history-panel {
  margin-bottom: 14px;
}

.process-history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.process-history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-toggle-group {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.metric-toggle-group .metric-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.metric-toggle-group .metric-btn:hover {
  color: var(--text-primary);
}

.metric-toggle-group .metric-btn.active {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  box-shadow: var(--shadow-sm);
}

.metric-toggle-group .metric-btn[data-metric="memory"].active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.process-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}

.process-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.legend-chip:hover, .legend-chip.is-highlighted {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.legend-chip.is-dimmed {
  opacity: 0.35;
}

.legend-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-chip .chip-name {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-chip .chip-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.process-history-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.process-chart-wrap {
  position: relative;
  width: 100%;
  height: 275px;
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 16, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

#process-history-chart,
#overview-process-chart,
.process-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.process-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  text-align: center;
  padding: 16px;
}

.process-chart-empty .empty-icon {
  font-size: 28px;
  opacity: 0.6;
}

.process-chart-empty strong {
  font-size: 13px;
  color: var(--text-secondary);
}

.process-chart-empty small {
  font-size: 11px;
  color: var(--text-dim);
}

.process-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.6fr) minmax(280px, 1fr);
  gap: 14px;
}

.process-watch-panel {
  align-self: start;
}

.watch-form {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.watch-form input {
  min-width: 0;
  flex: 1;
}

.watch-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
}

.watch-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.watch-list > div:first-child {
  border-top: 0;
}

/* Login Page */
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #17152b 0%, #07090e 65%);
}

.login-card {
  width: min(380px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
  padding: 32px 28px;
  background: rgba(16, 21, 31, 0.88);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 0 4px;
}

.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  text-align: center;
}

.login-card > p {
  color: var(--text-muted);
  font-size: 12px;
  margin: -6px 0 6px;
  text-align: center;
}

.login-card label {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 11px;
}

.secure-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  margin-top: 2px;
}

/* Mobile Accordion details in table */
.mobile-row-details {
  display: none;
}

.process-row {
  cursor: pointer;
}

/* Server Status Strip */
.server-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 11px;
}

.status-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-uptime {
  color: var(--text-secondary);
  font-size: 11px;
}

.status-uptime strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill.healthy {
  background: var(--emerald-subtle);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}

.status-pill.warning {
  background: var(--amber-subtle);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}

.status-pill.critical {
  background: var(--rose-subtle);
  color: #fb7185;
  border: 1px solid var(--rose-border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.status-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.status-summary-right b {
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1150px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .split.lower {
    grid-template-columns: 1fr;
  }
  .process-layout {
    grid-template-columns: 1fr;
  }
  .health-layout {
    grid-template-columns: 1fr;
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Navigation & Layout */
  aside {
    transform: translateX(-100%);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.7);
  }

  body.nav-open aside {
    transform: translateX(0);
  }

  body.nav-open .nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  main {
    margin-left: 0;
    width: 100%;
  }

  .mobile-nav {
    display: block;
  }

  header {
    padding: 0 12px;
    height: 52px;
  }

  header h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .server-badge {
    display: none !important;
  }

  .header-clock {
    display: none;
  }

  .content {
    padding: 14px 12px 40px;
  }

  .server-status-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
  }

  .status-summary-right {
    font-size: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-title {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* CRITICAL MOBILE REQUIREMENT:
     2-column compact grid for metrics, reducing card height to ~90px
     so overall status + CPU + RAM + DISK + NET all fit on first screen! */
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .metric-card {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .metric-head {
    margin-bottom: 4px;
  }

  .metric-head small {
    font-size: 9px;
  }

  .metric-badge {
    padding: 1px 5px;
    font-size: 9px;
  }

  .metric-card strong {
    font-size: 20px;
  }

  .progress {
    margin: 6px 0 5px;
    height: 3px;
  }

  .metric-card p {
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
  }

  .net-pair {
    gap: 6px;
  }

  .net-pair strong {
    font-size: 13px;
  }

  .net-pair small {
    font-size: 8px;
  }

  /* History & Charts on Mobile */
  .history-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chart-panel canvas, .history-chart {
    height: 220px;
  }

  .history-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 9px 12px;
    gap: 8px;
  }

  .history-toolbar .range-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .traffic-summary {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .traffic-report-controls {
    flex-wrap: wrap;
  }

  /* Tables on Mobile */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    padding: 8px 10px;
    font-size: 11px;
  }

  /* Expandable row accordion for Processes on mobile */
  tr.is-expanded + tr.mobile-row-details {
    display: table-row;
  }

  /* Forms, Filters & Modals */
  .filters {
    width: 100%;
  }

  .filters input, .filters select {
    flex: 1;
    min-width: 120px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .process-history-title {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .process-history-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .metric-toggle-group {
    width: 100%;
    display: flex;
  }

  .metric-toggle-group .metric-btn {
    flex: 1;
    text-align: center;
    padding: 6px;
  }

  .process-history-actions .range-buttons {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
  }

  .process-history-actions .range-buttons::-webkit-scrollbar {
    display: none;
  }

  .process-history-actions .range-buttons button {
    flex: 1 0 auto;
    min-width: 36px;
    text-align: center;
    padding: 6px 6px;
    font-size: 10px;
  }

  .process-chart-wrap {
    height: 200px;
  }

  .legend-chip {
    padding: 2px 6px;
    font-size: 10px;
  }

  .legend-chip .chip-name {
    max-width: 85px;
  }
}

/* Specific viewports fine-tuning */
@media (max-width: 430px) {
  .metric-card strong {
    font-size: 18px;
  }
  .net-pair strong {
    font-size: 12px;
  }
  .summary {
    grid-template-columns: auto 1fr;
  }
}

/* ==========================================================================
   Health Checks Workspace
   ========================================================================== */

.page-health .content {
  max-width: 1600px;
}

.health-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 126px;
  margin-bottom: 14px;
  padding: 24px 28px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 22%, rgba(56, 189, 248, 0.15), transparent 28%),
    radial-gradient(circle at 64% 130%, rgba(99, 102, 241, 0.2), transparent 42%),
    linear-gradient(135deg, #111827 0%, #0d1320 55%, #0b111a 100%);
  box-shadow: var(--shadow-sm);
}

.health-hero::after {
  content: "";
  position: absolute;
  right: 4%;
  bottom: -76px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(129, 140, 248, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(129, 140, 248, 0.025), 0 0 0 52px rgba(56, 189, 248, 0.018);
  pointer-events: none;
}

.health-hero-copy,
.health-hero-status {
  position: relative;
  z-index: 1;
}

.health-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.health-hero h2 {
  margin: 0;
  font-size: clamp(21px, 2vw, 29px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.health-hero p,
.health-section-heading p,
.health-create-heading p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.health-hero-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.health-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.health-refresh > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 7px var(--sky);
}

.health-refresh b {
  color: var(--text-primary);
}

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

.health-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(20, 27, 39, 0.96), rgba(14, 19, 29, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.health-summary-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid currentColor;
  border-radius: 11px;
  background: color-mix(in srgb, currentColor 11%, transparent);
  font-size: 17px;
  font-weight: 800;
}

.health-summary-card.primary-stat .health-summary-icon { color: #34d399; }
.health-summary-card.danger-stat .health-summary-icon { color: #fb7185; }
.health-summary-card.neutral-stat .health-summary-icon { color: #94a3b8; }
.health-summary-card.schedule-stat .health-summary-icon { color: #818cf8; }

.health-summary-card > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 8px;
}

.health-summary-card small {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.health-summary-card strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 23px;
  line-height: 1;
}

.health-summary-card p {
  grid-column: 1 / -1;
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 10px;
}

.health-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 14px;
}

.health-services-panel,
.health-create-panel {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.health-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 2px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.health-section-heading h2,
.health-create-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  letter-spacing: -0.015em;
}

.health-section-heading .health-eyebrow {
  margin-bottom: 3px;
  color: var(--text-muted);
}

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

.health-service-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(20, 27, 39, 0.92), rgba(13, 18, 27, 0.95));
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.health-service-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--amber);
}

.health-service-card.is-up::before { background: var(--emerald); }
.health-service-card.is-down::before { background: var(--rose); }
.health-service-card.is-paused::before { background: var(--text-dim); }

.health-service-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-light);
  background: linear-gradient(145deg, rgba(24, 33, 47, 0.95), rgba(15, 21, 31, 0.98));
}

.health-service-card.is-paused {
  opacity: 0.72;
}

.health-service-head,
.health-service-identity,
.health-service-footer,
.health-card-actions {
  display: flex;
  align-items: center;
}

.health-service-head,
.health-service-footer {
  justify-content: space-between;
  gap: 10px;
}

.health-service-identity {
  min-width: 0;
  gap: 9px;
}

.health-service-mark {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 9px;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
  font-size: 14px;
}

.health-service-identity h3 {
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-protocol {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.health-state {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.health-target {
  display: block;
  overflow: hidden;
  margin: 12px 0;
  padding: 7px 9px;
  color: #aebdd0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-service-metrics {
  display: grid;
  grid-template-columns: 0.8fr 1.45fr 0.6fr;
  gap: 8px;
  margin-bottom: 12px;
}

.health-service-metrics > div {
  min-width: 0;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.health-service-metrics > div:last-child {
  padding-right: 0;
  border-right: 0;
}

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

.health-service-metrics small {
  margin-bottom: 3px;
  color: var(--text-dim);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.health-service-metrics strong {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.health-service-metrics strong.health-failure {
  color: #fb7185;
}

.health-service-footer {
  min-height: 28px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 8px;
}

.health-card-actions {
  gap: 5px;
}

.health-card-actions form {
  margin: 0;
}

.health-icon-button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.health-icon-button:hover {
  color: var(--text-primary);
  border-color: #64748b;
  background: rgba(255, 255, 255, 0.07);
}

.health-icon-button.danger:hover {
  color: #fb7185;
  border-color: var(--rose-border);
  background: var(--rose-subtle);
}

.health-create-panel {
  position: sticky;
  top: 78px;
}

.health-create-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.health-add-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  color: #a5b4fc;
  background: var(--accent-subtle);
  font-size: 18px;
}

.health-form {
  gap: 13px;
}

.health-form-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: var(--text-muted);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.055);
  font-size: 9px;
}

.health-form-note i {
  color: var(--sky);
  font-style: normal;
  font-size: 13px;
}

.health-form-note strong {
  color: var(--text-secondary);
}

.health-submit {
  width: 100%;
  justify-content: center;
}

.health-empty-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
}

.health-empty-state > span {
  color: var(--accent-light);
  font-size: 30px;
}

.health-empty-state h3 {
  margin: 8px 0 2px;
  color: var(--text-primary);
}

.health-empty-state p {
  margin: 0;
  font-size: 10px;
}

@media (max-width: 1180px) {
  .health-workspace {
    grid-template-columns: 1fr;
  }

  .health-create-panel {
    position: static;
  }

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

  .health-form > input[type="hidden"],
  .health-form-note,
  .health-submit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .health-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-service-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .health-hero {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 18px;
  }

  .health-hero-status {
    align-items: flex-start;
  }

  .health-summary-grid {
    gap: 8px;
  }

  .health-summary-card {
    min-height: 70px;
    padding: 10px;
  }

  .health-summary-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

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

  .health-summary-card p {
    display: none;
  }

  .health-services-panel,
  .health-create-panel {
    padding: 12px;
  }

  .health-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .health-form {
    grid-template-columns: 1fr;
  }

  .health-form > input[type="hidden"],
  .health-form-note,
  .health-submit {
    grid-column: auto;
  }

  .health-service-footer > span {
    max-width: 70%;
  }
}

/* ==========================================================================
   Servora Overview Redesign Design System
   ========================================================================== */

/* Overview Health Summary Grid (7 Boxes) */
.overview-health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.overview-health-grid .metric-card {
  margin-bottom: 0;
}

.health-span-card {
  grid-column: span 2;
}

.infra-health-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 8px;
}

.infra-stat-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 15px;
  font-weight: 750;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.infra-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
}

.emerald-text { color: #34d399; }
.sky-text { color: #38bdf8; }
.violet-text { color: #c084fc; }
.amber-text { color: #fbbf24; }
.unit-down { color: #34d399; font-weight: 700; margin-left: 2px; }

/* System Performance Grid & Toolbar on Overview */
.overview-perf-toolbar {
  margin-bottom: 12px;
}

.overview-perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.overview-perf-grid .chart-panel {
  margin-bottom: 0;
}

/* Overview Split Sections */
.overview-workload-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.overview-workload-split .panel {
  margin-bottom: 0;
}

.section-micro-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.micro-link {
  font-size: 10px;
  font-weight: 500;
  color: var(--sky);
  text-transform: none;
  letter-spacing: normal;
}

/* Service Pill Grid */
.service-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.service-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-size: 11px;
  transition: border-color 0.15s ease;
}

.service-pill-item:hover {
  border-color: var(--border-light);
}

.service-pill-item .service-name {
  color: var(--text-primary);
  font-weight: 500;
}

.service-pill-item .service-state {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.service-pill-item.up .service-state {
  color: #34d399;
}

.service-pill-item.down .service-state {
  color: #fb7185;
}

/* Docker Quick List */
.docker-quick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docker-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.docker-quick-main {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.docker-name {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.docker-image {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

/* Mini Table for Top Processes */
.mini-table table {
  width: 100%;
  border-collapse: collapse;
}

.mini-table th, .mini-table td {
  padding: 6px 8px;
  font-size: 11px;
}

.mini-table strong.process-name {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* HTTP Status Code Strip */
.http-status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.http-chip {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.http-chip .http-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.http-chip strong {
  font-size: 16px;
  font-weight: 750;
  font-family: var(--font-mono);
}

.http-chip.ok strong { color: #34d399; }
.http-chip.redir strong { color: #38bdf8; }
.http-chip.client-err strong { color: #fbbf24; }
.http-chip.server-err strong { color: #64748b; }
.http-chip.server-err.has-errors strong { color: #fb7185; }

/* Application Summary List */
.app-summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.app-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.app-domain {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.app-upstream {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.app-metrics {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-req-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.panel-footer-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  color: var(--text-dim);
}

/* Health Checks & System Events */
.health-probe-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-probe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.probe-target-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.probe-target-wrap strong {
  font-size: 11px;
  color: var(--text-primary);
}

.probe-target-wrap code {
  font-size: 10px;
  color: var(--text-dim);
}

.probe-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-badge-text {
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.status-badge-text.healthy,
.status-badge-text.up { color: #34d399; }
.status-badge-text.unhealthy,
.status-badge-text.down { color: #fb7185; }
.status-badge-text.pending,
.status-badge-text.unknown { color: #fbbf24; }

.events-mini-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-mini-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.event-msg {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-time {
  font-size: 10px;
  font-family: var(--font-mono);
}

.empty-state-text {
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  margin: 6px 0;
}

/* Host Telemetry Footer Strip */
.host-footer-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 11px;
  margin-top: 4px;
}

.host-info-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.host-cell-label {
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.host-info-cell span, .host-info-cell strong {
  font-size: 11px;
  color: var(--text-primary);
}

/* Responsive Overrides */
@media (max-width: 1150px) {
  .overview-health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .health-span-card {
    grid-column: span 2;
  }
  .overview-perf-grid {
    grid-template-columns: 1fr;
  }
  .overview-workload-split {
    grid-template-columns: 1fr;
  }
  .host-footer-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile Health Summary Cards: ultra-compact ~75px height */
  .overview-health-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .overview-health-grid .metric-card {
    padding: 8px 10px;
  }

  .overview-health-grid .metric-head {
    margin-bottom: 3px;
  }

  .overview-health-grid .metric-head small {
    font-size: 8.5px;
  }

  .overview-health-grid .metric-badge {
    padding: 1px 4px;
    font-size: 8.5px;
  }

  .overview-health-grid .metric-card strong {
    font-size: 18px;
  }

  .overview-health-grid .metric-subval {
    font-size: 10px;
  }

  .overview-health-grid .progress {
    margin: 4px 0;
    height: 3px;
  }

  .overview-health-grid .metric-card p {
    font-size: 9.5px;
    margin: 0;
  }

  .health-span-card {
    grid-column: span 2;
    padding: 8px 10px !important;
  }

  .infra-health-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 4px 0;
  }

  .infra-stat-divider {
    display: none;
  }

  .stat-label {
    font-size: 8px;
  }

  .stat-value {
    font-size: 12px;
  }

  .overview-perf-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .overview-workload-split {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .http-status-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .docker-image {
    max-width: 120px;
  }

  .host-footer-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 10px;
  }
}

@media (max-width: 430px) {
  .overview-health-grid .metric-card strong {
    font-size: 16px;
  }
  .docker-image {
    max-width: 90px;
  }
}

/* Overview Process & Infrastructure Layout */
.overview-process-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  margin-bottom: 16px;
}

.overview-process-row .panel {
  margin-bottom: 0;
}

.overview-perf-grid > .chart-panel,
.overview-process-row > .chart-panel {
  display: flex;
  flex-direction: column;
}

.overview-perf-grid > .chart-panel .history-chart,
.overview-process-row > .chart-panel .history-chart {
  flex: 0 0 275px;
  min-height: 275px;
  height: 275px;
  background: rgba(8, 11, 16, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.overview-process-panel {
  width: auto;
  margin-bottom: 0;
}

.overview-process-panel .process-history-actions {
  width: 100%;
  justify-content: space-between;
}

.overview-infrastructure-panel {
  margin-bottom: 16px;
}

.overview-infrastructure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.overview-infrastructure-grid > section {
  min-width: 0;
}

@media (max-width: 1150px) {
  .overview-process-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .overview-infrastructure-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .overview-perf-grid > .chart-panel .history-chart,
  .overview-process-row > .chart-panel .history-chart,
  .overview-process-panel .process-chart-wrap {
    flex-basis: 220px;
    min-height: 220px;
    height: 220px;
  }
}

/* Floating Toast Notification Container & Items */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: rgba(15, 20, 31, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.55), 0 0 16px -3px rgba(0, 0, 0, 0.35);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-item.toast-warning {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.55), 0 0 20px -3px rgba(245, 158, 11, 0.22);
}

.toast-item.toast-critical,
.toast-item.toast-error {
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.55), 0 0 20px -3px rgba(244, 63, 94, 0.28);
}

.toast-item.toast-dismissing {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 700;
}

.toast-warning .toast-icon-wrap {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.toast-critical .toast-icon-wrap,
.toast-error .toast-icon-wrap {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.toast-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: toastPulse 1.8s infinite;
}

.toast-warning .toast-pulse {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}

.toast-critical .toast-pulse,
.toast-error .toast-pulse {
  background: #fb7185;
  box-shadow: 0 0 6px #fb7185;
}

.toast-message {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  word-break: break-word;
}

.toast-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.toast-dismiss:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@media (max-width: 768px) {
  .toast-container {
    top: 16px;
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
  }
}

/* GOST Proxy control plane */
.proxy-tabs { display:flex; gap:6px; margin-bottom:16px; overflow-x:auto; padding:4px; width:max-content; max-width:100%; border:1px solid var(--border); border-radius:10px; background:rgba(15,23,42,.55); }
.proxy-tabs a { padding:8px 16px; color:var(--muted); border-radius:7px; font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; }
.proxy-tabs a.active,.proxy-tabs a:hover { color:#e2e8f0; background:rgba(56,189,248,.12); box-shadow:inset 0 0 0 1px rgba(56,189,248,.18); }
.proxy-service-strip { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:16px; padding:16px 20px; border:1px solid var(--border); border-radius:var(--radius-md); background:linear-gradient(120deg,rgba(15,23,42,.9),rgba(8,47,73,.28)); }
.proxy-service-strip>div { display:grid; grid-template-columns:auto auto; align-items:center; gap:5px 12px; }
.proxy-service-strip>div small { grid-column:2; color:var(--muted); }
.proxy-service-strip dl { display:flex; gap:28px; margin:0; }
.proxy-service-strip dl div { min-width:70px; }
.proxy-service-strip dt,.proxy-service-strip dd { margin:0; }
.proxy-service-strip dt { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.proxy-service-strip dd { margin-top:4px; color:#e2e8f0; font-size:13px; font-weight:700; }
.proxy-service-strip dd.ok { color:#34d399; }.proxy-service-strip dd.bad { color:#fb7185; }
.proxy-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.proxy-metrics article,.proxy-blocked-summary article { display:flex; min-width:0; flex-direction:column; gap:4px; padding:14px 16px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--panel); }
.proxy-metrics small,.proxy-blocked-summary small { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.07em; }
.proxy-metrics strong,.proxy-blocked-summary strong { color:#f8fafc; font-size:22px; line-height:1.1; font-family:ui-monospace, monospace, system-ui; }
.proxy-metrics span { color:#64748b; font-size:10px; }
.proxy-chart-panel { margin-bottom:0; }.proxy-chart-wrap { position:relative; height:260px; }.proxy-chart-wrap canvas { display:block; width:100%; height:100%; cursor:crosshair; }.proxy-chart-wrap #proxy-chart-empty { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:12px; pointer-events:none; }
.proxy-chart-legend { display:flex; gap:18px; margin:-4px 0 8px; color:var(--muted); font-size:11px; }.proxy-chart-legend span { display:flex; align-items:center; gap:6px; }.proxy-chart-legend i { width:18px; height:2px; }.proxy-chart-legend .download{background:#38bdf8}.proxy-chart-legend .upload{background:#a78bfa}
.proxy-chart-live { color:#34d399; font-size:10px; font-weight:800; }.proxy-chart-live i { display:inline-block; width:6px; height:6px; margin-right:5px; border-radius:50%; background:#34d399; }
.proxy-filter-panel { margin-bottom:14px; padding:0 13px 11px; border:1px solid var(--border); border-radius:10px; background:rgba(15,23,42,.42); }
.proxy-filter-panel summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 1px; color:#cbd5e1; cursor:pointer; font-size:11px; font-weight:800; list-style-position:inside; }
.proxy-filter-panel summary span { display:inline-flex; align-items:center; gap:8px; }.proxy-filter-panel summary em { padding:2px 7px; color:#7dd3fc; border-radius:999px; background:rgba(56,189,248,.1); font-size:9px; font-style:normal; letter-spacing:.04em; }.proxy-filter-panel summary small { color:var(--muted); font-size:10px; font-weight:600; }
.proxy-filter-builder { display:grid; grid-template-columns:1fr 1fr minmax(220px,2fr) auto; gap:9px; align-items:end; }.proxy-filter-builder label { display:grid; gap:5px; color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }.proxy-filter-builder input,.proxy-filter-builder select { width:100%; }.proxy-filter-builder button { min-height:37px; }
.proxy-filter-chips { display:flex; flex-wrap:wrap; gap:7px; min-height:0; margin-top:10px; }.proxy-filter-chips:empty { display:none; }.proxy-filter-chip { display:inline-flex; align-items:center; gap:7px; max-width:100%; padding:5px 6px 5px 9px; color:#cbd5e1; border:1px solid rgba(56,189,248,.2); border-radius:999px; background:rgba(56,189,248,.08); font-size:10px; }.proxy-filter-chip b { color:#7dd3fc; font-size:9px; letter-spacing:.03em; text-transform:uppercase; }.proxy-filter-chip span { overflow:hidden; max-width:260px; text-overflow:ellipsis; white-space:nowrap; }.proxy-filter-chip button { display:grid; width:18px; height:18px; padding:0; place-items:center; color:#94a3b8; border:0; border-radius:50%; background:rgba(15,23,42,.65); cursor:pointer; }.proxy-filter-chip button:hover { color:#fff; background:rgba(244,63,94,.35); }
.proxy-filter-footer { display:flex; align-items:center; gap:10px; margin-top:10px; }.proxy-filter-footer select { width:min(240px,100%); }.proxy-filter-footer .link { padding:4px 2px; font-size:10px; }.proxy-filter-footer .link:disabled { opacity:.4; cursor:not-allowed; }.proxy-filter-panel .form-message { margin:5px 0 0; min-height:0; }
.proxy-toolbar-title .secondary.paused { color:#fbbf24; border-color:rgba(251,191,36,.35); }
.proxy-event-status { display:inline-flex; align-items:center; border:1px solid transparent; border-radius:999px; padding:3px 7px; font-size:9px; font-weight:800; letter-spacing:.04em; }
.proxy-event-status.allow { color:#6ee7b7; background:rgba(16,185,129,.11); border-color:rgba(16,185,129,.22); }
.proxy-event-status.block { color:#fda4af; background:rgba(244,63,94,.11); border-color:rgba(244,63,94,.22); }
.proxy-event-status.error { color:#fcd34d; background:rgba(245,158,11,.1); border-color:rgba(245,158,11,.2); }
.proxy-event-status.disabled { color:#fbbf24; background:rgba(245,158,11,.1); border-color:rgba(245,158,11,.2); }
.proxy-event-status.expired { color:#94a3b8; background:rgba(148,163,184,.12); border-color:rgba(148,163,184,.22); }
.proxy-type-badge { display:inline-block; font-size:9px; font-weight:700; color:#38bdf8; background:rgba(56,189,248,0.1); border:1px solid rgba(56,189,248,0.22); padding:2px 6px; border-radius:4px; text-transform:uppercase; letter-spacing:0.04em; }
.proxy-action-btn { padding:4px 9px; font-size:10px; font-weight:700; color:#38bdf8; background:rgba(56,189,248,0.08); border:1px solid rgba(56,189,248,0.22); border-radius:6px; cursor:pointer; min-height:28px; white-space:nowrap; transition:all .15s ease; }
.proxy-action-btn:hover { background:rgba(56,189,248,0.2); color:#fff; border-color:rgba(56,189,248,0.4); }
.proxy-col-action { width:70px; text-align:right; }
.proxy-dest-cell { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.proxy-live-table tbody tr { cursor:pointer; }
.proxy-live-table tbody tr:hover { background:rgba(56,189,248,.05); }
.proxy-live-cards, .proxy-rules-cards, .proxy-blocked-cards { display:none; }
.proxy-empty { padding:28px; margin:0; color:var(--muted); text-align:center; }
.proxy-empty[hidden] { display:none; }
.proxy-dialog { width:min(680px,calc(100vw - 24px)); color:var(--text); border:1px solid rgba(148,163,184,.25); border-radius:14px; background:#0f172a; box-shadow:0 25px 80px rgba(0,0,0,.65); }
.proxy-dialog::backdrop { background:rgba(2,6,23,.78); backdrop-filter:blur(4px); }
.proxy-dialog h2 { margin:0 0 14px; }
.proxy-dialog-close { position:absolute; top:12px; right:12px; color:#94a3b8; border:0; background:transparent; font-size:24px; cursor:pointer; }
.proxy-dialog dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; overflow:hidden; border:1px solid var(--border); border-radius:9px; background:var(--border); }
.proxy-dialog dl div { min-width:0; padding:10px 12px; background:#0b1220; }
.proxy-dialog dt { color:var(--muted); font-size:10px; text-transform:uppercase; }
.proxy-dialog dd { overflow-wrap:anywhere; margin:4px 0 0; font-size:12px; font-family:ui-monospace, monospace; }
.proxy-block-actions { margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.proxy-block-actions h3 { margin:0 0 4px; }
.proxy-block-actions p { margin:0 0 12px; color:var(--muted); font-size:11px; }
.proxy-block-grid { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; }
.danger-button { padding:9px 12px; color:#fecdd3; border:1px solid rgba(244,63,94,.35); border-radius:7px; background:rgba(244,63,94,.12); cursor:pointer; }
.danger-button:hover { background:rgba(244,63,94,.22); color:#fff; }
.danger-button:disabled { opacity:.4; cursor:not-allowed; }
.proxy-hide-actions { margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.proxy-hide-actions h3 { margin:0 0 4px; }
.proxy-hide-actions p { margin:0 0 12px; color:var(--muted); font-size:11px; }
.proxy-hide-actions>div { display:flex; flex-wrap:wrap; gap:7px; }
.proxy-hide-actions .secondary { padding:7px 9px; font-size:10px; }
.proxy-hide-actions .secondary:disabled { opacity:.4; cursor:not-allowed; }
.form-message { min-height:18px; margin-top:8px; color:#fbbf24; font-size:11px; }
.proxy-rules-layout { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:16px; align-items:start; }
.proxy-rule-create { position:sticky; top:16px; }
.proxy-rule-actions { white-space:nowrap; }
.proxy-rule-actions button+button { margin-left:8px; }
.proxy-blocked-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.proxy-blocked-summary strong { margin-top:4px; }

@media (max-width: 1050px) {
  .proxy-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .proxy-service-strip { align-items:flex-start; flex-direction:column; }
  .proxy-service-strip dl { width:100%; justify-content:space-between; }
  .proxy-rules-layout { grid-template-columns:1fr; }
  .proxy-rule-create { position:static; }
}

@media (max-width: 768px) {
  .proxy-tabs { width:100%; }
  .proxy-tabs a { flex:1; padding:7px 8px; text-align:center; font-size:11px; }
  .proxy-service-strip { padding:10px 12px; gap:10px; margin-bottom:10px; }
  .proxy-service-strip dl { display:grid; grid-template-columns:repeat(2,1fr); gap:6px 12px; }
  .proxy-service-strip dd { font-size:12px; margin-top:2px; }
  .proxy-service-strip dt { font-size:9px; }
  .proxy-metrics { grid-template-columns:repeat(2,1fr); gap:6px; margin-bottom:10px; }
  .proxy-metrics article { padding:8px 10px; min-height:54px; gap:2px; }
  .proxy-metrics strong { font-size:16px; margin-top:1px; }
  .proxy-metrics small { font-size:9px; letter-spacing:.04em; }
  .proxy-metrics span { display:none; }
  .proxy-chart-wrap { height:190px; }
  .proxy-chart-panel .panel-title p { display:none; }
  .proxy-filter-panel { padding:0 10px 10px; }
  .proxy-filter-panel summary small { display:none; }
  .proxy-filter-builder { grid-template-columns:1fr 1fr; }
  .proxy-filter-builder label:nth-child(3) { grid-column:1/-1; }
  .proxy-filter-builder button { grid-column:1/-1; }
  .proxy-filter-footer { align-items:stretch; flex-wrap:wrap; }
  .proxy-filter-footer select { width:100%; }
  .proxy-filter-chip span { max-width:190px; }
  .proxy-live-table, .proxy-rules-table, .proxy-blocked-table { display:none; }
  .proxy-live-cards, .proxy-rules-cards, .proxy-blocked-cards { display:grid; gap:8px; }
  .proxy-live-card, .proxy-rule-card { width:100%; padding:10px 12px; color:var(--text); border:1px solid var(--border); border-radius:8px; background:rgba(15,23,42,.65); text-align:left; display:flex; flex-direction:column; gap:6px; box-sizing:border-box; }
  .proxy-card-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
  .proxy-card-time { font-size:10px; color:var(--muted); font-family:ui-monospace, monospace; }
  .proxy-card-dest { font-size:13px; color:#f8fafc; overflow-wrap:anywhere; word-break:break-all; }
  .proxy-card-meta { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
  .proxy-card-actions { display:flex; gap:6px; }
  .btn-sm { min-height:36px; padding:6px 12px; font-size:11px; }
  .proxy-dialog dl,.proxy-block-grid { grid-template-columns:1fr; }
  .proxy-blocked-summary { grid-template-columns:repeat(2,1fr); gap:6px; margin-bottom:10px; }
  .proxy-blocked-summary article { padding:8px 10px; min-height:54px; gap:2px; }
  .proxy-blocked-summary strong { font-size:16px; margin-top:1px; }
  .proxy-blocked-summary small { font-size:9px; }
}
