/* CRM Infrastructure Observability Panel - aaPanel Enterprise Design System */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* aaPanel Theme (Dark Obsidian & aaPanel Emerald Green) */
  --bg-primary: #12141a;
  --bg-secondary: #1a1d24;
  --bg-header: #1f232d;
  --bg-card: #20242f;
  --bg-card-hover: #262b38;
  --bg-input: #171a22;
  
  --border-color: #2b3242;
  --border-highlight: #3b4459;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* aaPanel Signature Brand Green */
  --accent-primary: #20a53a;
  --accent-hover: #199432;
  --accent-glow: rgba(32, 165, 58, 0.25);
  --accent-subtle: rgba(32, 165, 58, 0.12);
  
  /* Status Semantics */
  --status-healthy: #20a53a;
  --status-healthy-bg: rgba(32, 165, 58, 0.15);
  --status-warning: #eab308;
  --status-warning-bg: rgba(234, 179, 8, 0.15);
  --status-critical: #ef4444;
  --status-critical-bg: rgba(239, 68, 68, 0.18);
  --status-unknown: #8b5cf6;
  --status-unknown-bg: rgba(139, 92, 246, 0.15);

  --sidebar-width: 250px;
  --header-height: 56px;
  --mobile-nav-height: 60px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-highlight: #cbd5e1;
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-primary: #20a53a;
  --accent-hover: #199432;
  --accent-glow: rgba(32, 165, 58, 0.18);
  --accent-subtle: rgba(32, 165, 58, 0.1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* aaPanel Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.65rem;
  background-color: var(--bg-header);
}

.logo-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #20a53a, #16802c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 0 10px var(--accent-glow);
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.logo-sub {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem;
  scrollbar-width: thin;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 700;
  padding: 0.75rem 0.65rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
  position: relative;
}

.nav-item:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background-color: var(--accent-primary);
}

.nav-item .icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-header);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* aaPanel Top Header */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.server-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--status-healthy);
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--status-healthy-bg);
  border: 1px solid rgba(32, 165, 58, 0.25);
}

.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-healthy);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(32, 165, 58, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(32, 165, 58, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(32, 165, 58, 0); }
}

.btn-icon {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Content Body */
.content-body {
  padding: 1.25rem;
  flex: 1;
}

/* ========================================================
   aaPanel Top Row: 4 Radial Circular Gauges
   ======================================================== */
.gauge-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gauge-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.gauge-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.gauge-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* aaPanel Radial SVG Ring Gauge */
.radial-meter {
  width: 100px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radial-meter svg {
  transform: rotate(-90deg);
  width: 100px;
  height: 100px;
}

.radial-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 8;
}

.radial-bar {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: calc(251.2 - (251.2 * var(--percent)) / 100);
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.radial-meter.warning .radial-bar {
  stroke: var(--status-warning);
}

.radial-meter.critical .radial-bar {
  stroke: var(--status-critical);
}

.radial-center-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radial-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.radial-status-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.gauge-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.65rem;
}

/* ========================================================
   aaPanel Network & Disk I/O Real-Time Speedometer Strip
   ======================================================== */
.speedometer-strip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.speed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.speed-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.speed-info {
  display: flex;
  flex-direction: column;
}

.speed-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.speed-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ========================================================
   aaPanel Services Overview Grid
   ======================================================== */
.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.service-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

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

.service-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.service-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-color);
}

.service-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.service-ver {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.service-status-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

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

.service-status-pill.healthy {
  background: var(--status-healthy-bg);
  color: var(--status-healthy);
}
.service-status-pill.healthy .status-dot {
  background: var(--status-healthy);
  box-shadow: 0 0 6px rgba(32, 165, 58, 0.6);
}

.service-status-pill.unknown {
  background: var(--status-unknown-bg);
  color: var(--status-unknown);
}
.service-status-pill.unknown .status-dot {
  background: var(--status-unknown);
}

.service-status-pill.critical {
  background: var(--status-critical-bg);
  color: var(--status-critical);
}
.service-status-pill.critical .status-dot {
  background: var(--status-critical);
}

/* ========================================================
   aaPanel Multi-Tab Telemetry Box
   ======================================================== */
.section-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* Charts */
.chart-container {
  width: 100% !important;
  height: 380px;
  position: relative;
  min-height: 320px;
  display: block;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  box-sizing: border-box;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th {
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-header);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-healthy {
  background: var(--status-healthy-bg);
  color: var(--status-healthy);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.badge-critical {
  background: var(--status-critical-bg);
  color: var(--status-critical);
}

.badge-unknown {
  background: var(--status-unknown-bg);
  color: var(--status-unknown);
}

/* ==========================================================================
   aaPanel Dedicated Full-Screen Login Portal (Security Hardened)
   ========================================================================== */
.login-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 18%, #1f2736 0%, #0e1015 100%);
  padding: 1.25rem;
  overflow-y: auto;
}

[data-theme="light"] .login-screen {
  background: radial-gradient(circle at 50% 18%, #e2e8f0 0%, #cbd5e1 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  animation: loginCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-badge-ring {
  display: inline-flex;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(32, 165, 58, 0.4), rgba(59, 130, 246, 0.2));
  margin-bottom: 0.85rem;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.login-domain {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.6rem;
}

.login-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-healthy);
  box-shadow: 0 0 6px var(--status-healthy);
}

.login-error-msg {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.7;
}

.input-icon-wrap .form-control {
  padding-left: 2.5rem;
}

.login-btn {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.login-btn:hover {
  box-shadow: 0 6px 20px rgba(32, 165, 58, 0.4);
}

.login-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.login-policy-notice {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.login-meta-info {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: monospace;
  opacity: 0.75;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 420px;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  max-width: 920px;
  width: 92%;
  position: relative;
  z-index: 1000;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  min-height: 42px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.btn-primary {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: background var(--transition-fast);
}

/* ========================================================
   Topology Node Graph Styles
   ======================================================== */
.topology-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  position: relative;
}

.topology-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 850px;
  gap: 1rem;
  padding: 1rem 0;
}

.topo-node {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.topo-node:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px var(--accent-glow);
}

.topo-node.healthy {
  border-top: 3px solid var(--status-healthy);
}
.topo-node.warning {
  border-top: 3px solid var(--status-warning);
}
.topo-node.critical {
  border-top: 3px solid var(--status-critical);
}
.topo-node.unknown {
  border-top: 3px solid var(--status-unknown);
}

.topo-node-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.topo-node-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topo-node-metric {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: monospace;
}

.topo-edge {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.topo-edge-line {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #2b3242, var(--accent-primary), #2b3242);
  background-size: 200% 100%;
  animation: dataFlow 2s linear infinite;
  border-radius: 2px;
}

@keyframes dataFlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.topo-edge-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================================
   Security Threat Heatmap Styles
   ======================================================== */
.threat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}

.threat-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.threat-country {
  width: 120px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.threat-progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.threat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #ef4444);
  border-radius: 4px;
}

/* ========================================================
   Diagnostic Benchmark Tool Styles
   ======================================================== */
.benchmark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.benchmark-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.benchmark-score-big {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.benchmark-grade-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--status-healthy-bg);
  color: var(--status-healthy);
  border: 1px solid rgba(32, 165, 58, 0.3);
  margin-top: 0.4rem;
}

.benchmark-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.benchmark-metric-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.bench-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.bench-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bench-sub {
  font-size: 0.72rem;
  color: var(--accent-primary);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* ========================================================
   Senior IT Feature 1: MySQL Slow Query & Lock Inspector
   ======================================================== */
.slow-query-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.85rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.slow-query-card:hover {
  border-color: rgba(234, 179, 8, 0.4);
}
.slow-query-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.slow-query-time-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.slow-query-code {
  background: var(--bg-input);
  padding: 0.75rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #fca5a5;
  overflow-x: auto;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  border-left: 3px solid #ef4444;
}
.slow-query-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.slow-query-recommendation {
  background: rgba(32, 165, 58, 0.08);
  border: 1px solid rgba(32, 165, 58, 0.25);
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  color: var(--status-healthy);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buffer Pool & Lock Inspector Bar */
.db-inspector-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.db-stat-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}

/* ========================================================
   Senior IT Feature 2: Nginx Traffic & Top Request Analyzer
   ======================================================== */
.status-code-strip {
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  margin: 0.85rem 0 0.5rem 0;
  background: var(--bg-input);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.status-seg-2xx { background: #20a53a; }
.status-seg-3xx { background: #3b82f6; }
.status-seg-4xx { background: #eab308; }
.status-seg-5xx { background: #ef4444; }

.status-legend-grid {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.status-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.status-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.gateway-tracker-box {
  background: linear-gradient(135deg, rgba(32, 165, 58, 0.08), rgba(20, 20, 20, 0.4));
  border: 1px solid rgba(32, 165, 58, 0.3);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ========================================================
   Senior IT Feature 3: Inodes & Storage Space Tree
   ======================================================== */
.inode-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.inode-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}
.tree-node-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tree-node-item:last-child {
  border-bottom: none;
}
.tree-node-item:hover {
  background: var(--bg-card-hover);
}
.tree-growth-delta {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(32, 165, 58, 0.15);
  color: var(--status-healthy);
}

/* ========================================================
   Senior IT Feature 4: PHP OPcache Visual Memory & Hit Rate
   ======================================================== */
.opcache-dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
  .opcache-dashboard {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
.opcache-ring-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.opcache-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* ========================================================
   Senior IT Feature 5: Open File Descriptors & TCP Monitor
   ======================================================== */
.tcp-state-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.tcp-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}
.tcp-pill-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}
.tcp-pill-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

/* ========================================================
   Senior IT Feature 6: Rogue & Runaway Process (Zombie Hunter)
   ======================================================== */
.zombie-hunter-box {
  background: linear-gradient(135deg, rgba(32, 165, 58, 0.08), rgba(20, 20, 20, 0.5));
  border: 1px solid rgba(32, 165, 58, 0.3);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ========================================================
   Senior IT Feature 7: SSL Cipher Strength & Security Grade
   ======================================================== */
.ssl-grade-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.ssl-grade-badge-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #20a53a 0%, #15803d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(32, 165, 58, 0.4);
  flex-shrink: 0;
}
.ssl-bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  flex: 1;
}

/* ========================================================
   Senior IT Feature 8: 1-Click IT Audit & Compliance Export
   ======================================================== */
.audit-export-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(20, 20, 20, 0.5));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.audit-preview-modal {
  max-width: 860px;
  max-height: 85vh;
  overflow-y: auto;
}

/* ========================================================
   Senior IT Feature 7: Active SSH Sessions & Sudo Privilege Audit Tracker
   ======================================================== */
.compliance-hero {
  background: linear-gradient(135deg, rgba(32, 165, 58, 0.12), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(32, 165, 58, 0.35);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.compliance-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.compliance-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(32, 165, 58, 0.18);
  color: #4ade80;
  border: 1px solid rgba(32, 165, 58, 0.3);
}
.ssh-session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.ssh-session-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 3px solid #20a53a;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ssh-session-card:hover {
  border-color: #20a53a;
  transform: translateY(-2px);
}
.ssh-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ssh-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.terminal-tag {
  font-family: var(--font-mono);
  background: rgba(32, 165, 58, 0.12);
  color: #20a53a;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.sudo-code {
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: 4px;
  color: #86efac;
  font-size: 0.82rem;
  word-break: break-all;
  display: inline-block;
}
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.policy-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.policy-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.policy-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* User Filter Bar */
.user-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.user-filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.user-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.user-filter-btn.active {
  background: rgba(32, 165, 58, 0.15);
  color: #20a53a;
  border-color: #20a53a;
}/* ========================================================
   aaPanel Operational Controls & File Manager Styles
   ======================================================== */

/* 1-Click Ops Quickbar */
.ops-quickbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}
.ops-quickbar-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.5rem;
}
.ops-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.ops-btn:hover {
  transform: translateY(-1px);
  border-color: #20a53a;
  color: #20a53a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.ops-btn.primary {
  background: linear-gradient(135deg, #20a53a, #16802c);
  color: #ffffff;
  border-color: #20a53a;
}
.ops-btn.primary:hover {
  background: linear-gradient(135deg, #16802c, #136924);
  color: #ffffff;
}
.ops-btn.warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #d97706;
}
.ops-btn.warning:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
}
.ops-btn.purple {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
  border-color: #7c3aed;
}

/* Service Card Action Buttons */
.service-actions-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.service-action-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}
.service-action-btn:hover {
  color: var(--text-primary);
  border-color: #20a53a;
  background: rgba(32, 165, 58, 0.1);
}
.service-action-btn.reload:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}
.service-action-btn.flush:hover {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

/* File Manager Explorer */
.filemanager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.filemanager-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.crumb-item {
  color: #38bdf8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.crumb-item:hover {
  background: rgba(56, 189, 248, 0.15);
  text-decoration: underline;
}
.crumb-sep {
  color: var(--text-muted);
}
.crumb-current {
  color: var(--text-primary);
  font-weight: 700;
}
.filemanager-table tr.folder-row {
  cursor: pointer;
}
.filemanager-table tr.folder-row:hover td {
  background: rgba(56, 189, 248, 0.05);
}
.file-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.file-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.syntax-guard-pill {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(32, 165, 58, 0.12);
  color: #4ade80;
  border: 1px solid rgba(32, 165, 58, 0.3);
}

/* PHP Resource Slider Cockpit */
.php-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.slider-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.slider-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #20a53a;
  background: rgba(32, 165, 58, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(32, 165, 58, 0.25);
}
.php-slider-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
  accent-color: #20a53a;
  cursor: pointer;
  margin: 0.75rem 0 0.5rem 0;
}
.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}



/* Premium Login Actions & Buttons */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.login-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.1rem;
  width: 100%;
}

.login-btn-primary {
  flex: 1;
  min-height: 46px;
  height: 46px;
  padding: 0 1.25rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  box-sizing: border-box;
  outline: none;
  white-space: nowrap;
  user-select: none;
}

.login-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.login-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.login-btn-secondary {
  height: 46px;
  min-height: 46px;
  padding: 0 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  outline: none;
  white-space: nowrap;
  user-select: none;
  flex: 0 0 auto;
}

.login-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.login-btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}
