:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --bg4: #1a2030;
  --border: #30363d;
  --text: #e6edf3;
  --text2: #8b949e;
  --green: #00d084;
  --green-dim: rgba(0,208,132,0.1);
  --blue: #388bfd;
  --blue-dim: rgba(56,139,253,0.1);
  --red: #f85149;
  --yellow: #d29922;
  --sidebar: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

.hidden { display: none !important; }

/* ── VIEWS ── */
.view { width: 100%; height: 100vh; display: flex; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 200;
  transition: left 0.25s;
}
.sidebar-brand {
  padding: 18px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}
.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d1117;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}
.sidebar-nav { padding: 8px 0; }
.nav-section { padding: 12px 16px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
  border-radius: 6px;
  margin: 1px 8px;
  text-decoration: none;
  user-select: none;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--bg3); color: var(--green); }
.nav-item svg { flex-shrink: 0; }

/* ── MAIN CONTENT ── */
.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
}
.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  display: none;
  padding: 4px;
}
.topbar-search input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text2);
  font-size: 13px;
  outline: none;
  width: 200px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.time-display { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.user-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text2);
}

/* ── SECTIONS ── */
.section { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 20px; font-weight: 600; }

/* ── METRICS GRID ── */
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.metric-card {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric-value { font-size: 20px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
canvas.metric-chart { width: 100%; height: 60px; display: block; }
.disk-bar-container { background: var(--bg3); border-radius: 4px; height: 8px; overflow: hidden; margin-bottom: 6px; }
.disk-bar { height: 100%; background: var(--green); border-radius: 4px; transition: width 1.5s ease; }
.disk-detail { font-size: 11px; color: var(--text2); }
.net-value { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }

/* ── DASHBOARD GRID ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { background: var(--bg4); border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow: hidden; }
.panel-header { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }

/* ── SERVER TABLE ── */
.server-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.server-table th { text-align: left; padding: 6px 8px; color: var(--text2); border-bottom: 1px solid var(--border); font-weight: 500; font-size: 11px; }
.server-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
.server-table tr:last-child td { border-bottom: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.status-online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-warning { background: var(--yellow); }
.status-offline { background: var(--text2); }
.badge { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge-online { background: rgba(0,208,132,0.15); color: var(--green); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--yellow); }
.badge-offline { background: var(--bg3); color: var(--text2); }

/* ── LOGS ── */
.log-container {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 11px;
  height: 220px;
  overflow-y: auto;
  background: #080c10;
  border-radius: 6px;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.log-entry { display: flex; gap: 8px; padding: 2px 0; line-height: 1.5; }
.log-time { color: var(--text2); flex-shrink: 0; }
.log-level { flex-shrink: 0; font-weight: 700; }
.log-level-INFO { color: var(--blue); }
.log-level-WARN { color: var(--yellow); }
.log-level-ERROR { color: var(--red); }
.log-msg { color: var(--text); word-break: break-all; }

/* ── PLACEHOLDER SECTIONS ── */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text2);
  gap: 12px;
}
.placeholder-icon { font-size: 48px; opacity: 0.25; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
}

/* ── MODALS ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.75); }
.modal-box {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  width: 340px;
  max-width: 92vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: var(--text2); margin-bottom: 22px; }
.modal-desc { font-size: 13px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-group input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--green); }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 14px; }
.form-success { color: var(--green); font-size: 13px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { margin: 0; }
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg3); }

/* ── CHAT VIEW ── */
#chat-view { flex-direction: column; }
.chat-header {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-partner { display: flex; align-items: center; gap: 12px; }
.partner-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #0d1117;
  cursor: pointer;
  user-select: none;
}
.partner-name { font-weight: 600; font-size: 15px; }
.partner-status { font-size: 12px; color: var(--green); }
.quick-close-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 8px;
  font-size: 20px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s;
}
.quick-close-btn:hover { background: rgba(248,81,73,0.15); color: var(--red); }

/* ── MESSAGES ── */
.messages-container { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.messages-list { display: flex; flex-direction: column; gap: 3px; }
.message-item { max-width: 78%; display: flex; flex-direction: column; }
.message-item.own { align-self: flex-end; align-items: flex-end; }
.message-item.partner { align-self: flex-start; align-items: flex-start; }
.message-bubble {
  padding: 8px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  max-width: 100%;
}
.message-item.own .message-bubble {
  background: #0b4d2f;
  border-bottom-right-radius: 4px;
}
.message-item.partner .message-bubble {
  background: var(--bg3);
  border-bottom-left-radius: 4px;
}
.deleted-msg { color: var(--text2) !important; font-style: italic; }
.message-meta {
  font-size: 10px;
  color: var(--text2);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}
.msg-ticks { color: var(--text2); }
.msg-ticks.read-tick { color: var(--green); }

/* Reply bar inside bubble */
.reply-bar {
  font-size: 12px;
  color: var(--green);
  border-left: 2px solid var(--green);
  padding: 2px 8px;
  margin-bottom: 6px;
  opacity: 0.8;
}

/* Typing indicator */
.typing-indicator { align-self: flex-start; margin: 4px 0; }
.typing-bubble { background: var(--bg3); border-radius: 18px; border-bottom-left-radius: 4px; padding: 10px 14px; display: flex; gap: 4px; align-items: center; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text2); animation: bounce 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Media in messages */
.message-image { max-width: 220px; max-height: 220px; border-radius: 12px; cursor: pointer; object-fit: cover; display: block; }
.message-video-thumb { background: var(--bg3); border-radius: 12px; width: 180px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; }
.message-audio { width: 200px; max-width: 100%; }
.message-file { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.media-loading { color: var(--text2); font-size: 12px; padding: 8px 0; }

/* ── REPLY PREVIEW ── */
.reply-preview {
  padding: 8px 14px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--green);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text2);
  flex-shrink: 0;
}
.reply-preview button { background: transparent; border: none; color: var(--text2); cursor: pointer; font-size: 16px; padding: 2px 6px; }

/* ── INPUT BAR ── */
.input-bar {
  padding: 10px 12px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.attach-btn, .send-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  color: var(--text2);
}
.attach-btn:hover { background: var(--bg3); color: var(--green); }
.mic-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.mic-btn:hover { background: var(--bg3); color: var(--green); }
.mic-btn.recording { color: var(--red); background: rgba(248,81,73,0.12); }
.recording-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(248,81,73,0.08);
  border-top: 1px solid rgba(248,81,73,0.3);
  font-size: 13px;
  color: var(--text);
  flex-shrink: 0;
}
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: recblink 1s infinite;
  flex-shrink: 0;
}
@keyframes recblink { 0%,100%{opacity:1} 50%{opacity:.2} }
#rec-timer { font-family: monospace; font-size: 14px; color: var(--red); min-width: 32px; }
#rec-cancel { background: transparent; border: 1px solid var(--border); color: var(--text2); padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
#rec-cancel:hover { border-color: var(--red); color: var(--red); }
.send-btn { color: var(--green); }
.send-btn:hover { background: var(--bg3); }
.message-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}
.message-input:focus { border-color: var(--green); }

/* ── MEDIA SHEET ── */
.media-sheet { position: fixed; inset: 0; z-index: 500; }
.media-sheet-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.media-sheet-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px 28px;
}
.media-option {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg3);
  border: none;
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 10px;
  text-align: left;
  transition: background 0.15s;
}
.media-option:hover { background: var(--border); }
.media-option.cancel { background: transparent; color: var(--text2); text-align: center; margin-bottom: 0; }

/* ── MEDIA VIEWER ── */
#media-viewer .modal-overlay { background: rgba(0,0,0,0.92); }
.viewer-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 1001;
}
.viewer-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
}
#viewer-image { max-width: 92vw; max-height: 88vh; border-radius: 6px; object-fit: contain; }
#viewer-video { max-width: 92vw; max-height: 88vh; border-radius: 6px; }
#viewer-audio { width: 80vw; }

/* ── CONTEXT MENU ── */
.context-menu {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  min-width: 150px;
}
.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
}
.context-menu button:hover { background: var(--bg3); }
.context-menu button.danger { color: var(--red); }

/* ── CHAT HEADER CALL BUTTONS ── */
.chat-header-actions { display: flex; align-items: center; gap: 4px; }
.header-call-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.header-call-btn:hover { background: var(--bg3); color: var(--green); }

/* ── LLAMADA ENTRANTE ── */
.call-incoming {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  padding-top: 48px;
}
.call-incoming-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  min-width: 260px;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.call-incoming-type { font-size: 14px; color: var(--text2); margin-bottom: 8px; }
.call-incoming-name { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 28px; }
.call-incoming-actions { display: flex; justify-content: center; gap: 32px; }
.call-btn-hang {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(248,81,73,0.4);
  transition: transform 0.15s;
}
.call-btn-hang:hover { transform: scale(1.08); }
.call-btn-accept {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,208,132,0.4);
  transition: transform 0.15s;
}
.call-btn-accept:hover { transform: scale(1.08); }

/* ── UI LLAMADA ACTIVA ── */
.call-ui {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: #0a0e16;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.call-remote-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.call-local-video {
  position: absolute;
  bottom: 110px; right: 16px;
  width: 110px; height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  z-index: 2;
}
.call-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  z-index: 1;
}
.call-avatar-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: #000;
  box-shadow: 0 0 0 8px rgba(0,208,132,0.15);
}
.call-overlay {
  position: absolute;
  top: 48px; left: 0; right: 0;
  text-align: center;
  z-index: 3;
}
.call-partner-label {
  font-size: 20px; font-weight: 700;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 6px;
}
.call-status {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-family: monospace;
}
.call-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px 20px 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  z-index: 4;
}
.call-ctrl-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
  backdrop-filter: blur(8px);
}
.call-ctrl-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
.call-ctrl-off { background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.4) !important; }
.call-ctrl-end {
  background: var(--red) !important;
  box-shadow: 0 4px 16px rgba(248,81,73,0.4);
  width: 64px; height: 64px;
}
.call-ctrl-end:hover { background: #c94040 !important; }

/* ── SECTION LAYOUTS ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-big {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  line-height: 1.1;
}
.stat-big.green { color: var(--green); }
.stat-big.blue  { color: #388bfd; }
.stat-big.yellow{ color: var(--yellow); }
.stat-big.red   { color: var(--red); }
.stat-lbl {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* SERVER CARDS */
.server-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.server-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.server-card-off { opacity: .6; }
.server-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.server-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px 0;
}
.srv-stat {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  font-size: 12px;
}
.srv-label { color: var(--text2); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.server-card-metrics { padding: 10px 16px 12px; border-top: 1px solid var(--border); }

/* MINI METRICS (bars) */
.mini-metric { margin-bottom: 8px; }
.mini-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.mini-val { color: var(--green); font-family: monospace; }
.mini-bar-bg { background: var(--bg1); border-radius: 3px; height: 5px; overflow: hidden; }
.mini-bar { height: 100%; border-radius: 3px; transition: width .5s ease; }
.mini-bar.green { background: var(--green); }
.mini-bar.blue  { background: #388bfd; }
.mini-bar.yellow{ background: var(--yellow); }

/* TOPOLOGY MAP */
.topology-wrap {
  padding: 12px 8px;
  overflow-x: auto;
}

/* BADGES */
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-online  { background: rgba(0,208,132,0.15); color: var(--green); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--yellow); }
.badge-offline { background: rgba(248,81,73,0.15);  color: var(--red); }

/* BUTTONS inside section */
.btn-mono {
  background: var(--bg1);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: monospace;
  transition: border-color .15s, color .15s;
}
.btn-mono:hover { border-color: var(--green); color: var(--green); }

/* HTTP METHOD BADGES */
.method-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  letter-spacing: .03em;
}
.method-get    { background: rgba(0,208,132,0.15); color: var(--green); }
.method-post   { background: rgba(56,139,253,0.15); color: #388bfd; }
.method-delete { background: rgba(248,81,73,0.15);  color: var(--red); }
.method-put    { background: rgba(210,153,34,0.15); color: var(--yellow); }
.method-patch  { background: rgba(188,140,255,0.15);color: #bc8cff; }

/* CODE MONO */
.mono-sm { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text2); }

/* DIM ROW */
.row-dim { opacity: .5; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar));
    top: 0; height: 100%;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: block; }
  .topbar-search { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .message-item { max-width: 88%; }
  .two-col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .server-cards { grid-template-columns: 1fr; }
}
