/* 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 */
.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);
}

.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-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.process-history-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 10px;
  margin: -6px 0 10px;
  font-family: var(--font-mono);
}

.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;
}

.process-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 8px;
  color: var(--text-secondary);
  font-size: 10px;
}

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

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

/* 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-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .process-history-actions select {
    width: 100%;
  }

  .process-history-actions .range-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .process-history-actions .range-buttons button {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    font-size: 10px;
  }
}

/* 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;
  }
}
