/* =====================================================================
   Zenve BI — System Health & Infrastructure Command Center
   Pure Executive Light Theme Architecture (Aligned with Reports, Alerts & Settings)
   ===================================================================== */

/* ── 1. Root Full-Screen Overlay Canvas ────────────────────────────── */
#zsys-root {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 224px !important;
  width: calc(100vw - 224px) !important;
  max-width: calc(100vw - 224px) !important;
  height: 100vh !important;
  z-index: 50 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-family: var(--font-sans, "Manrope", sans-serif);
  display: none;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

#zsys-root.zsys-open {
  display: block !important;
}

#zsys-root::-webkit-scrollbar {
  width: 6px;
}

#zsys-root::-webkit-scrollbar-track {
  background: #f8fafc;
}

#zsys-root::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

#zsys-root::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

html.zsys-locked,
body.zsys-locked {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none;
}

#zsys-root,
#zsys-root * {
  box-sizing: border-box !important;
}

/* ── 2. Top Executive Header ───────────────────────────────────────── */
.zsys-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

.zsys-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.zsys-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe, #dbeafe) !important;
  border: 1px solid #bae6fd !important;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.18);
}

.zsys-brand-badge.pulse {
  animation: zsys-pulse 2s infinite ease-in-out;
}

@keyframes zsys-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(14, 165, 233, 0);
  }
}

.zsys-header-title {
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 19px;
  font-weight: 700;
  color: #0f172a !important;
  margin: 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.zsys-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #166534 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.zsys-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 8px #16a34a;
  animation: zsys-dot-pulse 1.6s infinite ease-in-out;
}

@keyframes zsys-dot-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.zsys-header-subtitle {
  font-size: 12px;
  color: #64748b !important;
  margin: 3px 0 0;
}

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

.zsys-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.zsys-btn-primary {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.zsys-btn-primary:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
}

.zsys-btn-secondary {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

.zsys-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.zsys-btn-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.zsys-btn-close:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #ef4444 !important;
}

/* ── 3. Tabs Navigation Ribbon ─────────────────────────────────────── */
.zsys-tabs-bar {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.zsys-tabs-bar::-webkit-scrollbar {
  display: none;
}

.zsys-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: #475569 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.zsys-tab-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.zsys-tab-btn.active {
  background: #eff6ff !important;
  color: #2563eb !important;
  border-color: #bfdbfe !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.zsys-tab-badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: #e2e8f0;
  color: #475569;
}

.zsys-tab-btn.active .zsys-tab-badge {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* ── 4. Main Body Canvas ───────────────────────────────────────────── */
.zsys-body {
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── 5. KPI Cards Grid (Aligned with Reports & Alerts) ─────────────── */
.zsys-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.zsys-kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.zsys-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
  border-color: #cbd5e1 !important;
}

.zsys-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zsys-kpi-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b !important;
}

.zsys-kpi-icon {
  font-size: 16px;
  padding: 4px;
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1;
}

.zsys-kpi-value {
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 24px;
  font-weight: 700;
  color: #0f172a !important;
  line-height: 1.2;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.zsys-kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
}

.zsys-kpi-delta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
}

.zsys-kpi-delta.up {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border: 1px solid #bbf7d0 !important;
}

.zsys-kpi-delta.blue {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}

.zsys-kpi-delta.warn {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

.zsys-kpi-subtext {
  font-size: 11px;
  color: #94a3b8 !important;
}

/* ── 6. Panels & Tables (Pure Light Theme) ─────────────────────────── */
.zsys-panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.zsys-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.zsys-panel-title {
  margin: 0;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: #0f172a !important;
}

.zsys-panel-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b !important;
}

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

.zsys-table th {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f8fafc;
}

.zsys-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b !important;
}

.zsys-table tr:hover td {
  background: #f8fafc !important;
}

.zsys-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
}

.zsys-badge-green {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border: 1px solid #bbf7d0 !important;
}

.zsys-badge-blue {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}

.zsys-badge-amber {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

.zsys-mono {
  font-family: "IBM Plex Mono", monospace !important;
}

/* ── 7. Interactive Log Terminal (High-Contrast Console) ──────────── */
.zsys-terminal {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  border-radius: 12px;
  padding: 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.zsys-log-line {
  display: grid;
  grid-template-columns: 80px 70px 160px 1fr;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.12s ease;
}

.zsys-log-line:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ── 8. Toast Feedback ────────────────────────────────────────────── */
#zsys-toast {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 100;
  padding: 12px 20px;
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  border-radius: 10px;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: zsys-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zsys-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 9. Responsive Mobile Adjustments ─────────────────────────────── */
@media (max-width: 1024px) {
  #zsys-root {
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
}