/* =====================================================================
   Zenve BI — Import & Export Executive Control Center & Dashboards
   Suite (9 Subdomains):
     1. Import Dashboard           (#import-dashboard / #import-export)
     2. Export Dashboard           (#export-dashboard)
     3. Import Orders              (#import-orders)
     4. Export Orders              (#export-orders)
     5. Suppliers                  (#suppliers / #global-suppliers)
     6. Buyers                     (#buyers / #international-buyers)
     7. Customs & Documentation    (#customs-documentation / #customs)
     8. Logistics                  (#trade-logistics / #import-export-logistics)
     9. Import/Export Profitability (#import-export-profitability / #trade-profitability)
   ===================================================================== */

html.zix-locked,
body.zix-locked {
  overflow: hidden !important;
  height: 100% !important;
}

#zix-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;
  max-height: 100vh !important;
  z-index: 60 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
  background: var(--background, #f8fafc) !important;
  color: var(--foreground, #0f172a) !important;
  font-family: var(--font-sans, "Manrope", sans-serif);
  display: none;
  animation: zixFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 #f8fafc !important;
}

#zix-root.zix-open,
#zix-root.zpanel-open {
  display: block !important;
}

#zix-root::-webkit-scrollbar {
  width: 8px !important;
}

#zix-root::-webkit-scrollbar-track {
  background: #f8fafc !important;
}

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

#zix-root::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

@keyframes zixFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

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

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

#zix-root button,
#zix-root input,
#zix-root select {
  font-family: inherit;
  color: inherit;
}

/* Header */
.zix-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: color-mix(in oklab, var(--background, #ffffff) 96%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  flex-wrap: wrap;
}

.zix-head-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

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

.zix-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--foreground, #0f172a);
  white-space: nowrap;
}

.zix-sub {
  font-size: 12px;
  margin: 0;
  color: var(--muted-foreground, #64748b);
  line-height: 1.4;
}

.zix-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.12);
  border: 1px solid rgba(8, 145, 178, 0.3);
  color: #0e7490;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.zix-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0891b2;
  box-shadow: 0 0 8px #0891b2;
  animation: zixPulse 1.8s infinite;
}

@keyframes zixPulse {

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

  50% {
    opacity: 0.45;
    transform: scale(1.4);
  }
}

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

.zix-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--card, #ffffff);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground, #0f172a);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  white-space: nowrap;
}

.zix-btn:hover {
  background: var(--accent, #f1f5f9);
  border-color: rgba(0, 0, 0, 0.2);
}

.zix-btn.primary {
  background: rgba(8, 145, 178, 0.14);
  border-color: rgba(8, 145, 178, 0.5);
  color: #0e7490;
}

.zix-btn.primary:hover {
  background: rgba(8, 145, 178, 0.22);
  color: #155e75;
}

.zix-btn.success {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #059669;
}

.zix-btn.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

/* Tabs Bar (9 Subdomains) */
.zix-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;
}

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

.zix-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--muted-foreground, #64748b);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.zix-tab:hover {
  color: var(--foreground, #0f172a);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px 6px 0 0;
}

.zix-tab.active {
  color: #0e7490;
  border-bottom-color: #0891b2;
  background: rgba(8, 145, 178, 0.08);
  border-radius: 6px 6px 0 0;
}

.zix-tab-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  color: #475569;
}

.zix-tab-badge.warn {
  background: rgba(245, 158, 11, 0.18);
  color: #d97706;
}

.zix-tab-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.zix-tab.active .zix-tab-badge {
  background: rgba(8, 145, 178, 0.18);
  color: #155e75;
}

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

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

.zix-kpi {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.zix-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.3);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.06);
}

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

.zix-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zix-kpi-icon {
  font-size: 16px;
}

.zix-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground, #0f172a);
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

.zix-kpi-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
}

.zix-delta {
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
}

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

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

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

.zix-delta.neutral {
  color: var(--muted-foreground, #64748b);
}

.zix-subtext {
  color: var(--muted-foreground, #64748b);
  font-size: 11px;
}

/* Cards & Grids */
.zix-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.zix-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {

  .zix-grid-2,
  .zix-grid-3 {
    grid-template-columns: 1fr;
  }
}

.zix-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

.zix-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--foreground, #0f172a);
  letter-spacing: -0.01em;
}

.zix-card-sub {
  font-size: 11px;
  margin: 2px 0 0;
  color: var(--muted-foreground, #64748b);
}

/* Tables */
.zix-table-wrap {
  overflow-x: auto;
  width: 100%;
}

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

.zix-table th {
  padding: 10px 12px;
  color: var(--muted-foreground, #64748b);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  background: var(--background, #f8fafc);
}

.zix-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.05));
  color: var(--foreground, #0f172a);
}

.zix-table tr:hover td {
  background: rgba(8, 145, 178, 0.03);
}

/* Pills & Badges */
.zix-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
}

.zix-pill.active,
.zix-pill.healthy,
.zix-pill.cleared,
.zix-pill.delivered {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.zix-pill.transit,
.zix-pill.customs,
.zix-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.zix-pill.critical,
.zix-pill.hold {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.zix-pill.trade {
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
}

/* Modals */
.zix-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.zix-modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
  color: #0f172a;
}

.zix-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.zix-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.zix-form-group label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

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

.zix-input,
.zix-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
}

.zix-input:focus,
.zix-select:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}