/* Export Intel — page layout */
.ei-page { --ei-accent: #0ea5e9; }
.ei-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.ei-header h1 { font-size: 1.5rem; margin: 0; }
.ei-subtitle { color: #94a3b8; font-size: 0.85rem; margin: 0.25rem 0 0; }
.ei-phase-badge { font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(14,165,233,0.15); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.3); }
.ei-kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
.ei-kpi { padding: 0.65rem 0.75rem; border-radius: 12px; background: rgba(10,14,20,0.85); border: 1px solid rgba(148,163,184,0.12); }
.ei-kpi span { display: block; font-size: 0.7rem; color: #94a3b8; }
.ei-kpi strong { font-size: 1.25rem; color: #e2e8f0; }
.ei-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.ei-filters select, .ei-filters input { font-size: 0.8rem; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid rgba(148,163,184,0.2); background: #0f1419; color: #e2e8f0; }

.ei-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(15,20,25,0.95));
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 12px;
}
.ei-filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; }
.ei-filter-group-search { flex: 1 1 200px; min-width: 180px; }
.ei-filter-label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; font-weight: 600; }
.ei-filter-label select,
.ei-filter-label input {
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.22);
  background: #0a0e12;
  color: #e2e8f0;
  min-width: 8rem;
}
.ei-filter-search-wrap input { width: 100%; min-width: 0; }
.ei-filter-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.ei-filter-meta { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.ei-filter-count { font-size: 0.75rem; color: #64748b; white-space: nowrap; }
.ei-filter-clear { font-size: 0.72rem; opacity: 0.85; }
.ei-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; min-height: 420px; }
@media (max-width: 900px) { .ei-split { grid-template-columns: 1fr; } }
.ei-map-wrap { border-radius: 14px; overflow: hidden; border: 1px solid rgba(14,165,233,0.2); min-height: 400px; background: #0a0e14; }
.ei-map-wrap #ei-map { height: 100%; min-height: 400px; }

/* Leaflet popups — rich card */
.ei-map-wrap .leaflet-popup-content-wrapper,
.ei-map-wrap .leaflet-popup-tip {
  background: #0f1724;
  color: #e2e8f0;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.ei-map-wrap .leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; }
.ei-map-wrap .leaflet-popup-content { margin: 0; min-width: 260px; line-height: 1.35; }
.ei-map-wrap .leaflet-popup-close-button {
  color: #94a3b8 !important; font-size: 1.2rem; padding: 6px 8px 0 0;
}
.ei-map-wrap .leaflet-popup-close-button:hover { color: #fff !important; background: transparent !important; }

.ei-popup-card { padding: 0.85rem 1rem 1rem; }
.ei-popup-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.ei-popup-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--badge-color, #38bdf8);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.5rem; border-radius: 6px;
}
.ei-popup-flag { font-size: 0.72rem; font-weight: 800; color: #64748b; }
.ei-map-wrap .leaflet-popup-content .ei-popup-name {
  display: block; margin: 0 0 0.6rem; font-size: 1rem; font-weight: 700;
  color: #f8fafc !important; line-height: 1.3;
}
.ei-popup-grid { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.ei-popup-row { display: grid; grid-template-columns: 72px 1fr; gap: 0.35rem; font-size: 0.78rem; }
.ei-popup-k { color: #64748b; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ei-popup-v { color: #cbd5e1; word-break: break-word; }
.ei-popup-v a { color: #38bdf8; text-decoration: none; }
.ei-popup-v a:hover { text-decoration: underline; }
.ei-popup-actions { border-top: 1px solid rgba(148,163,184,0.15); padding-top: 0.65rem; }
.ei-popup-btn {
  width: 100%; border: none; border-radius: 8px; padding: 0.5rem 0.75rem;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff;
}
.ei-popup-btn:hover { filter: brightness(1.08); }

/* Map pins */
.ei-pin-wrap { background: transparent !important; border: none !important; }
.ei-pin {
  width: 30px; height: 30px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ei-pin-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--pin-color);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
.ei-pin-icon { position: relative; z-index: 1; font-size: 14px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }

/* Clusters */
.ei-cluster-wrap { background: transparent !important; border: none !important; }
.ei-cluster {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 4px 16px rgba(14,165,233,0.45);
  color: #fff; font-weight: 800; font-size: 0.85rem;
}
.ei-cluster-md { width: 50px; height: 50px; font-size: 0.9rem; background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 16px rgba(139,92,246,0.45); }
.ei-cluster-lg { width: 56px; height: 56px; font-size: 0.95rem; background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 16px rgba(245,158,11,0.45); }
.ei-map-wrap .marker-cluster-small,
.ei-map-wrap .marker-cluster-medium,
.ei-map-wrap .marker-cluster-large { background: transparent !important; }
.ei-map-wrap .marker-cluster-small div,
.ei-map-wrap .marker-cluster-medium div,
.ei-map-wrap .marker-cluster-large div { background: transparent !important; color: transparent !important; }

.ei-map-legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  margin-bottom: 0.65rem; font-size: 0.72rem; color: #94a3b8;
}
.ei-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.ei-leg-pin { font-style: normal; }

.ei-map-empty { margin-bottom: 0.65rem; }
.ei-map-empty-inner {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.82rem;
  color: #cbd5e1;
}
.ei-map-empty-inner strong { display: block; color: #fbbf24; margin-bottom: 0.35rem; }
.ei-map-empty-inner p { margin: 0.25rem 0; }
.ei-map-empty-actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }

.ei-panel { border-radius: 14px; padding: 0.75rem; background: rgba(10,14,20,0.85); border: 1px solid rgba(148,163,184,0.12); }
.ei-table-wrap { overflow-x: auto; max-height: 480px; }
.ei-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ei-table th, .ei-table td { padding: 0.5rem 0.6rem; text-align: left; border-bottom: 1px solid rgba(148,163,184,0.08); }
.ei-table th { color: #94a3b8; font-weight: 600; position: sticky; top: 0; background: #0f1419; }
.ei-table tr:hover td { background: rgba(14,165,233,0.05); }
.ei-empty { text-align: center; padding: 2rem; color: #64748b; }
.ei-empty-cta { margin-top: 0.75rem; }
.ei-type-pill { font-size: 0.65rem; padding: 0.1rem 0.45rem; border-radius: 6px; background: rgba(148,163,184,0.15); }
.ei-type-distributor { color: #fbbf24; }
.ei-type-wholesaler { color: #eab308; }
.ei-type-contract_caterer { color: #a78bfa; }
.ei-confidence { font-size: 0.65rem; color: #64748b; }
.ei-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1100; }
.ei-drawer { position: fixed; top: 0; right: 0; width: min(420px, 100vw); height: 100vh; background: #0f1419; border-left: 1px solid rgba(14,165,233,0.2); z-index: 1101; overflow-y: auto; }
.ei-drawer-rich { width: min(480px, 100vw); padding: 0; display: flex; flex-direction: column; }
.ei-drawer-head { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(148,163,184,0.12); }
.ei-drawer-body { padding: 1rem; overflow-y: auto; flex: 1; }
.ei-drawer-hero { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; }
.ei-drawer-badge { font-size: 0.68rem; padding: 0.2rem 0.55rem; border-radius: 6px; background: rgba(148,163,184,0.15); text-transform: capitalize; }
.ei-drawer-flag { font-size: 0.75rem; font-weight: 800; color: #64748b; }
.ei-drawer-title { margin: 0 0 0.35rem; font-size: 1.25rem; line-height: 1.25; color: #f8fafc; }
.ei-drawer-meta { font-size: 0.78rem; color: #94a3b8; margin: 0 0 1rem; }
.ei-drawer-meta strong { color: #e2e8f0; }
.ei-drawer-section { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid rgba(148,163,184,0.1); }
.ei-drawer-section h4 { margin: 0 0 0.5rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.ei-drawer-kv { display: grid; grid-template-columns: 88px 1fr; gap: 0.35rem; font-size: 0.82rem; margin-bottom: 0.35rem; }
.ei-drawer-kv span:first-child { color: #64748b; }
.ei-drawer-kv a { color: #38bdf8; word-break: break-all; }
.ei-drawer-empty { font-size: 0.78rem; color: #64748b; margin: 0; }
.ei-contact-row { padding: 0.5rem 0; border-bottom: 1px solid rgba(148,163,184,0.08); font-size: 0.82rem; }
.ei-contact-row a { color: #38bdf8; }
.ei-contact-role { font-size: 0.72rem; color: #64748b; margin-left: 0.35rem; }
.ei-drawer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.ei-sync-msg { font-size: 0.75rem; color: #7dd3fc; margin-top: 0.5rem; }
