/* =====================================================================
   Zenve BI — Customers 360° Intelligence Executive Suite CSS
   Strict Viewport & Scroll Containment, High-Contrast Typography
   ===================================================================== */

/* Body locking when Customers 360 overlay is active */
html.zc360-locked,
body.zc360-locked {
  overflow: hidden !important;
  height: 100% !important;
}

/* Master Root Container */
#zc360-root {
  display: none;
  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;
  max-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  z-index: 60 !important;
  background: var(--background, #f8fafc) !important;
  color: var(--foreground, #0f172a) !important;
  font-family: var(--font-sans, "Manrope", sans-serif);
  box-sizing: border-box !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 #f8fafc !important;
}

@media (max-width: 1023px) {
  #zc360-root {
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

#zc360-root * {
  box-sizing: border-box;
}

/* Custom Scrollbars */
#zc360-root::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#zc360-root::-webkit-scrollbar-track {
  background: #f1f5f9;
}

#zc360-root::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

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

/* Header Area */
.zc360-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.zc360-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zc360-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zc360-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.zc360-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.zc360-pulse-dot {
  width: 7px;
  height: 7px;
  background: #2563eb;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  animation: zc360-pulse 2s infinite;
}

@keyframes zc360-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

.zc360-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.zc360-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.zc360-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zc360-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.zc360-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.zc360-btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Tabs Bar */
.zc360-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;
}

.zc360-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zc360-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.zc360-tab.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 700;
}

.zc360-tab-badge {
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}

.zc360-tab.active .zc360-tab-badge {
  background: #bfdbfe;
  color: #1e40af;
}

/* Body Content Area */
.zc360-body,
#zc360-root .zc360-body,
#zc360-root div.zc360-body,
#zc360-root main.zc360-body {
  padding: 24px 28px 64px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

/* KPI Grid */
.zc360-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.zc360-kpi {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.zc360-kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zc360-kpi-icon {
  font-size: 18px;
}

.zc360-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.zc360-kpi-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.zc360-delta {
  font-weight: 700;
}

.zc360-delta.up {
  color: #059669;
}

.zc360-delta.down {
  color: #dc2626;
}

.zc360-delta.warn {
  color: #d97706;
}

.zc360-subtext {
  color: #64748b;
  font-weight: 500;
}

/* Cards & Tables */
.zc360-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.zc360-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.zc360-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.zc360-card-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748b;
}

.zc360-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

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

.zc360-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.zc360-table th {
  padding: 12px 14px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.zc360-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  white-space: nowrap;
}

.zc360-table tbody tr:hover {
  background: #f8fafc;
}

/* Status Badges & Pills */
.zc360-pill {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.zc360-pill.active {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.zc360-pill.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.zc360-pill.critical {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.zc360-pill.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.zc360-pill.purple {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.zc360-pill.neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.zc360-btn-sm {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.15s ease;
}

.zc360-btn-sm:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.zc360-btn-sm.resolve {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.zc360-btn-sm.resolve:hover {
  background: #047857;
  border-color: #047857;
}

.zc360-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.zc360-progress-bar {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.zc360-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.zc360-progress-fill.success {
  background: #10b981;
}

.zc360-progress-fill.info {
  background: #3b82f6;
}

.zc360-progress-fill.warning {
  background: #f59e0b;
}

.zc360-progress-fill.danger {
  background: #ef4444;
}

.zc360-progress-fill.purple {
  background: #8b5cf6;
}

.zc360-sop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.zc360-sop-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zc360-sop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.zc360-sop-rule {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
}

.zc360-sop-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}


/* Modal Dialog */
.zc360-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.zc360-modal-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  padding: 24px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.zc360-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.zc360-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.zc360-form-group {
  margin-bottom: 14px;
}

.zc360-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.zc360-input,
.zc360-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #ffffff;
  color: #0f172a;
}

.zc360-input:focus,
.zc360-select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.zc360-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}