:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 53, 0.95);
  --bg-input: #151d30;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #3b82f6;
  --accent-primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --accent-success: #10b981;
  --accent-success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-warning: #f59e0b;
  --accent-warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --accent-danger: #ef4444;
  --accent-danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --accent-info: #06b6d4;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.25);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.25);
  --radius-card: 16px;
  --radius-btn: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.5) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow-blue);
}

/* Navbar */
.navbar-custom {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-icon-wrapper {
  width: 42px;
  height: 42px;
  background: var(--accent-primary-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.navbar-brand-title {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.navbar-brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* KPI Cards */
.kpi-card {
  padding: 1.35rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
  border-radius: 4px 0 0 4px;
}

.kpi-card.kpi-success::before { background: var(--accent-success); }
.kpi-card.kpi-warning::before { background: var(--accent-warning); }
.kpi-card.kpi-danger::before { background: var(--accent-danger); }
.kpi-card.kpi-info::before { background: var(--accent-info); }

.kpi-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Badges & Status */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.status-healthy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.status-critical, .status-pill.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.status-healthy .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-warning .status-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.status-critical .status-dot, .status-error .status-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* Pulsing Status Dot */
.pulse-dot {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Section Titles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.section-title i {
  color: var(--accent-primary);
}

/* Tables */
.custom-table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-primary);
  border-collapse: separate;
  border-spacing: 0;
}

.custom-table th {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.86rem;
}

.custom-table tbody tr {
  transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Server Card */
.server-header {
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn-primary-custom {
  background: var(--accent-primary-gradient);
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: var(--transition);
}

.btn-primary-custom:hover {
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-success-custom {
  background: var(--accent-success-gradient);
  border: none;
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.btn-success-custom:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost-custom {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-ghost-custom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-active);
}

/* Metric Highlight Box */
.metric-highlight-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

/* Spinner & Spin animation */
.spin-anim {
  animation: spin 1s linear infinite;
}

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

/* Toast container */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1090;
}

.custom-toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* Code Snippet / Monospace path */
.path-tag {
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.74rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.15);
  word-break: break-all;
}

/* Progress bar for Lag */
.lag-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.lag-meter-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Filter buttons */
.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}

.filter-btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

/* User Profile Dropdown & Modal Styles */
.user-menu-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 0.35rem 0.75rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.user-menu-btn:hover, .user-menu-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
  color: #fff;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.dropdown-menu-dark-custom {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
}

.dropdown-item-custom {
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.dropdown-item-custom:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}

.dropdown-item-custom.text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Modal Custom Styles */
.modal-content-custom {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: #fff;
}

.modal-header-custom {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-footer-custom {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

/* Role Badges */
.role-badge-admin {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.role-badge-operador {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.4);
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* User management avatar */
.user-table-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

/* Sub-nav tabs for Server Cards */
.server-tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.4);
}

.server-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.server-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.server-tab-btn.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar-brand-title {
    font-size: 1rem;
  }
  .kpi-value {
    font-size: 1.4rem;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

