/* DIMACEA | Extraído de index.html | bloque CSS 11 */

/* =========================================================
   DIMACEA NEO BORDER + DARK v2
   Objetivo:
   1) Reemplazar líneas incompletas por borde completo 360°.
   2) Relacionar cada borde con el color/tema del módulo.
   3) Corregir cuadros blancos residuales en modo nocturno.
   4) Mantener 100% funcionalidad: no toca cálculos, login ni eventos.
   ========================================================= */
:root{
  --neo-blue:#2563eb;
  --neo-sky:#0ea5e9;
  --neo-cyan:#06b6d4;
  --neo-violet:#7c3aed;
  --neo-indigo:#4f46e5;
  --neo-green:#10b981;
  --neo-emerald:#059669;
  --neo-red:#ef4444;
  --neo-orange:#f97316;
  --neo-pink:#ec4899;
  --neo-amber:#f59e0b;
  --neo-slate:#64748b;
}
/* ---------- Sistema de acentos por módulo ---------- */
#kpiMainSection > .card:first-child{--accent:#2563eb;--accent2:#7c3aed;--accent-soft:rgba(37,99,235,.13);}
#kpiMainSection > .card:nth-child(2){--accent:#64748b;--accent2:#2563eb;--accent-soft:rgba(100,116,139,.12);}
#kpiMainSection > .card:nth-child(3){--accent:#10b981;--accent2:#06b6d4;--accent-soft:rgba(16,185,129,.12);}
#kpiMainSection > .card:nth-child(4){--accent:#ef4444;--accent2:#f97316;--accent-soft:rgba(239,68,68,.12);}
#coreKpiSection > .card:nth-child(1){--accent:#f97316;--accent2:#fb923c;--accent-soft:rgba(249,115,22,.13);}
#coreKpiSection > .card:nth-child(2){--accent:#10b981;--accent2:#22c55e;--accent-soft:rgba(16,185,129,.13);}
#coreKpiSection > .card:nth-child(3){--accent:#4f46e5;--accent2:#818cf8;--accent-soft:rgba(79,70,229,.13);}
#coreKpiSection > .card:nth-child(4){--accent:#ec4899;--accent2:#f472b6;--accent-soft:rgba(236,72,153,.13);}
#coreKpiSection > .card:nth-child(5){--accent:#2563eb;--accent2:#06b6d4;--accent-soft:rgba(37,99,235,.13);}
#kpiMundialSection > .mundial-card:nth-child(1){--accent:#f97316;--accent2:#16a34a;--accent-soft:rgba(249,115,22,.13);}
#kpiMundialSection > .mundial-card:nth-child(2){--accent:#10b981;--accent2:#34d399;--accent-soft:rgba(16,185,129,.13);}
#kpiMundialSection > .mundial-card:nth-child(3){--accent:#4f46e5;--accent2:#818cf8;--accent-soft:rgba(79,70,229,.13);}
#kpiMundialSection > .mundial-card:nth-child(4){--accent:#0ea5e9;--accent2:#38bdf8;--accent-soft:rgba(14,165,233,.13);}
#kpiMundialSection > .mundial-card:nth-child(5){--accent:#ec4899;--accent2:#a855f7;--accent-soft:rgba(236,72,153,.13);}
#chartsSection > .card:nth-child(1){--accent:#2563eb;--accent2:#06b6d4;--accent-soft:rgba(37,99,235,.11);}
#chartsSection > .card:nth-child(2){--accent:#7c3aed;--accent2:#06b6d4;--accent-soft:rgba(124,58,237,.11);}
#noBuyCard{--accent:#ef4444;--accent2:#f97316;--accent-soft:rgba(239,68,68,.12);}
#buyCard{--accent:#10b981;--accent2:#22c55e;--accent-soft:rgba(16,185,129,.12);}
#weeklyCard{--accent:#7c3aed;--accent2:#a855f7;--accent-soft:rgba(124,58,237,.12);}
#deliveryControlCard{--accent:#0ea5e9;--accent2:#06b6d4;--accent-soft:rgba(14,165,233,.12);}
#topProductsCard{--accent:#2563eb;--accent2:#f59e0b;--accent-soft:rgba(37,99,235,.12);}
#deliveryCard{--accent:#0ea5e9;--accent2:#06b6d4;--accent-soft:rgba(14,165,233,.12);}
#dimiBubble{--accent:#7c3aed;--accent2:#2563eb;--accent-soft:rgba(124,58,237,.14);}
.modal-content,.client-base-panel{--accent:#2563eb;--accent2:#7c3aed;--accent-soft:rgba(37,99,235,.12);}
/* ---------- Borde completo 360° para cards ---------- */
.card,.mundial-card,.modal-content,.client-base-panel,#dimiBubble,.upload-card,.filter-card{
  position:relative!important;
  border:0!important;
  overflow:hidden!important;
  isolation:isolate;
}
.card::before,.mundial-card::before,.modal-content::before,.client-base-panel::before,#dimiBubble::before,.upload-card::before,.filter-card::before{
  content:""!important;
  position:absolute!important;
  inset:0!important;
  width:auto!important;
  height:auto!important;
  border-radius:inherit!important;
  padding:1.5px!important;
  background:linear-gradient(135deg,var(--accent, #2563eb),var(--accent2, #7c3aed))!important;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0)!important;
  -webkit-mask-composite:xor!important;
  mask-composite:exclude!important;
  pointer-events:none!important;
  z-index:3!important;
  opacity:.95!important;
}
.card::after,.mundial-card::after,.modal-content::after,.client-base-panel::after,.upload-card::after,.filter-card::after{
  content:""!important;
  position:absolute!important;
  inset:1px!important;
  border-radius:calc(inherit - 1px)!important;
  pointer-events:none!important;
  z-index:0!important;
  background:
    radial-gradient(circle at 16% 0%,var(--accent-soft,rgba(37,99,235,.10)),transparent 38%),
    linear-gradient(145deg,rgba(255,255,255,.78),rgba(248,250,252,.50))!important;
}
.card > *,.mundial-card > *,.modal-content > *,.client-base-panel > *,.upload-card > *,.filter-card > *,#dimiBubble > *{
  position:relative;
  z-index:2;
}
/* Quitar líneas superiores anteriores que se veían incompletas */
html.dimacea-neo-command #kpiMainSection>.card:not(:first-child)::before,
html.dimacea-neo-command #coreKpiSection>.card::before,
html.dimacea-neo-command #kpiMundialSection>.mundial-card::before{
  inset:0!important;
  height:auto!important;
  opacity:.95!important;
}
/* Header con banda de color completa y suave */
.card-header,.modal-header,.client-base-head{
  position:relative;
  overflow:hidden;
}
.card-header::before,.modal-header::before,.client-base-head::before{
  content:"";
  position:absolute;
  left:14px;
  right:14px;
  top:0;
  height:3px;
  border-radius:0 0 999px 999px;
  background:linear-gradient(90deg,var(--accent,#2563eb),var(--accent2,#7c3aed));
  opacity:.85;
}
.card-header h3,.card-header h4,.modal-header h4,.client-base-head h3{
  color:var(--accent,#2563eb)!important;
}
.card-header i,.modal-header i,.client-base-head i{
  color:var(--accent,#2563eb)!important;
}
/* Tarjetas KPI con halo interior identificado */
#kpiMainSection > .card,
#coreKpiSection > .card,
#kpiMundialSection > .mundial-card,
#chartsSection > .card,
#noBuyCard,#buyCard,#weeklyCard,#deliveryControlCard,#topProductsCard{
  box-shadow:
    0 18px 48px rgba(15,23,42,.10),
    0 0 0 1px rgba(255,255,255,.36) inset,
    0 0 42px var(--accent-soft,rgba(37,99,235,.10))!important;
}
#kpiMainSection > .card:hover,
#coreKpiSection > .card:hover,
#kpiMundialSection > .mundial-card:hover,
#chartsSection > .card:hover,
#noBuyCard:hover,#buyCard:hover,#weeklyCard:hover,#deliveryControlCard:hover,#topProductsCard:hover{
  transform:translateY(-3px)!important;
  box-shadow:
    0 26px 70px rgba(15,23,42,.14),
    0 0 0 1px rgba(255,255,255,.42) inset,
    0 0 58px var(--accent-soft,rgba(37,99,235,.16))!important;
}
/* Iconos KPI con fondo del color relacionado */
#kpiMainSection > .card:not(:first-child) .w-12,
#coreKpiSection > .card > div:first-child,
#kpiMundialSection > .mundial-card > div:first-child{
  background:linear-gradient(135deg,var(--accent-soft,rgba(37,99,235,.13)),rgba(255,255,255,.60))!important;
  border:1px solid color-mix(in srgb,var(--accent,#2563eb) 28%,transparent)!important;
  box-shadow:0 12px 28px var(--accent-soft,rgba(37,99,235,.13))!important;
}
#coreKpiSection > .card p,#kpiMundialSection > .mundial-card p{
  color:var(--accent,#2563eb)!important;
}
/* ---------- Modo nocturno: eliminación fuerte de blancos ---------- */
body.dark{
  background:
    radial-gradient(circle at 4% 0%,rgba(37,99,235,.20),transparent 28rem),
    radial-gradient(circle at 94% 2%,rgba(124,58,237,.20),transparent 30rem),
    linear-gradient(180deg,#020617,#0f172a)!important;
  color:#e5e7eb!important;
}
body.dark #app-container,body.dark #mainContent,body.dark main,body.dark .flex-1,body.dark .scroller{
  background:transparent!important;
}
body.dark .card,body.dark .mundial-card,body.dark .modal-content,body.dark .client-base-panel,body.dark #dimiBubble,body.dark .upload-card,body.dark .filter-card{
  background:linear-gradient(145deg,#0f172a,#111827)!important;
  color:#e5e7eb!important;
  box-shadow:
    0 22px 60px rgba(0,0,0,.42),
    0 0 46px color-mix(in srgb,var(--accent,#2563eb) 18%,transparent)!important;
}
body.dark .card::after,body.dark .mundial-card::after,body.dark .modal-content::after,body.dark .client-base-panel::after,body.dark .upload-card::after,body.dark .filter-card::after{
  background:
    radial-gradient(circle at 16% 0%,color-mix(in srgb,var(--accent,#2563eb) 18%,transparent),transparent 42%),
    linear-gradient(145deg,rgba(15,23,42,.94),rgba(17,24,39,.86))!important;
}
body.dark .card::before,body.dark .mundial-card::before,body.dark .modal-content::before,body.dark .client-base-panel::before,body.dark #dimiBubble::before,body.dark .upload-card::before,body.dark .filter-card::before{
  opacity:1!important;
  padding:1.5px!important;
  filter:drop-shadow(0 0 14px color-mix(in srgb,var(--accent,#2563eb) 36%,transparent));
}
body.dark .card-header,body.dark .card-footer-fixed,body.dark .modal-header,body.dark .modal-footer,body.dark .client-base-head,body.dark .client-base-toolbar,body.dark .client-base-stats{
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
}
/* Clases Tailwind blancas / pastel que quedaban en blanco */
body.dark .bg-white,body.dark .bg-white\/80,body.dark .bg-white\/90,body.dark .bg-white\/60,body.dark .bg-white\/50,
body.dark .bg-slate-50,body.dark .bg-slate-50\/60,body.dark .bg-slate-50\/50,body.dark .bg-slate-100,body.dark .bg-slate-200,
body.dark .bg-blue-50,body.dark .bg-blue-50\/30,body.dark .bg-blue-50\/80,
body.dark .bg-red-50,body.dark .bg-red-50\/80,
body.dark .bg-emerald-50,body.dark .bg-emerald-50\/80,
body.dark .bg-violet-50,body.dark .bg-violet-50\/80,
body.dark .bg-sky-50,body.dark .bg-sky-50\/80,
body.dark .bg-indigo-50,body.dark .bg-amber-50,body.dark .bg-orange-50,body.dark .bg-green-50,body.dark .bg-pink-50{
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
/* Fondos internos generados por JS */
body.dark #weeklyHitInfo,body.dark #weeklyHitFilters,body.dark #deliveryControlInfo,body.dark #deliveryControlFilters,body.dark #noBuyInsightBox,
body.dark #listProd,body.dark #weeklyHitsList,body.dark #deliveryControlList,body.dark #deliveryList,
body.dark #tableBodyNoBuy,body.dark #tableBodyBuy,
body.dark .card-body,body.dark .modal-body,body.dark .client-base-table-wrap{
  background:#0f172a!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark #listProd > div,body.dark #weeklyHitsList > div,body.dark #deliveryControlList > div,body.dark #deliveryList > div,
body.dark .mobile-week-card,body.dark .mobile-week-item,body.dark .client-card,body.dark .client-stat,body.dark .client-card-field{
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
/* Tablas y filas */
body.dark table,body.dark tbody,body.dark tr,body.dark td{
  background:transparent!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
}
body.dark thead,body.dark th,.dark .client-base-table th{
  background:#020617!important;
  color:#cbd5e1!important;
  border-color:#334155!important;
}
body.dark tr:hover td,body.dark .row-main:hover{
  background:#1e293b!important;
}
/* Textos */
body.dark h1,body.dark h2,body.dark h3,body.dark h4,
body.dark .text-slate-900,body.dark .text-slate-800,body.dark .text-slate-700,body.dark .client-name,body.dark .client-card-title{
  color:#f8fafc!important;
}
body.dark .text-slate-600,body.dark .text-slate-500,body.dark .text-slate-400,body.dark label,body.dark p,body.dark small,body.dark .client-sub{
  color:#cbd5e1!important;
}
body.dark .text-blue-600,body.dark .text-blue-700,body.dark .text-blue-800,body.dark .text-blue-900{color:#93c5fd!important;}
body.dark .text-red-600,body.dark .text-red-700,body.dark .text-red-800,body.dark .text-red-900{color:#fca5a5!important;}
body.dark .text-emerald-600,body.dark .text-emerald-700,body.dark .text-emerald-800,body.dark .text-emerald-900{color:#6ee7b7!important;}
body.dark .text-violet-600,body.dark .text-violet-700,body.dark .text-violet-800,body.dark .text-violet-900{color:#c4b5fd!important;}
body.dark .text-sky-600,body.dark .text-sky-700,body.dark .text-sky-800,body.dark .text-sky-900{color:#7dd3fc!important;}
/* Inputs, filtros y dropdowns */
body.dark input,body.dark select,body.dark textarea,body.dark .core-box,body.dark .client-dd,body.dark .client-base-search-wrap,body.dark .dimi-input{
  background:#020617!important;
  color:#f8fafc!important;
  border-color:#475569!important;
}
body.dark option{background:#0f172a!important;color:#f8fafc!important;}
body.dark input::placeholder,body.dark textarea::placeholder{color:#94a3b8!important;}
body.dark .chk-item{background:transparent!important;color:#e5e7eb!important;border-color:#1f2937!important;}
body.dark .chk-item:hover{background:#1e293b!important;color:#bfdbfe!important;}
/* Chips y badges */
body.dark .badge-day,body.dark .badge-core,body.dark .mobile-meta-chip,body.dark .mobile-day-right,body.dark .delivery-chip,
body.dark .qty-box,body.dark .client-code,body.dark .client-chip,body.dark #lastLiquidationInfo,body.dark #preventaDaysBadge,body.dark #headerDate,
body.dark #weeklyHitSummary,body.dark #deliverySummaryBadge,body.dark #globalViewBadge,body.dark #mundialFilterBadge,
body.dark #chipFechaExacta,body.dark #chipDiaVisita,body.dark #chipPreventa,body.dark #noBuyChipPending,body.dark #noBuyChipRed,body.dark #noBuyChipYellow{
  background:#111827!important;
  color:#e5e7eb!important;
  border-color:#475569!important;
}
/* Material POP */
body.dark [id*="pop" i],body.dark [id*="pop" i] div,body.dark [id*="pop" i] section,body.dark [id*="pop" i] article{
  border-color:#334155!important;
}
body.dark [id*="pop" i] .modal-content,body.dark [id*="pop" i].modal-content,body.dark [id*="pop" i] .bg-white,body.dark [id*="pop" i] .bg-slate-50{
  background:#0f172a!important;color:#e5e7eb!important;border-color:#334155!important;
}
body.dark [id*="pop" i] input,body.dark [id*="pop" i] select,body.dark [id*="pop" i] textarea,body.dark .popSecTxt,body.dark .popSecInp,body.dark .popSecSel{
  background:#020617!important;color:#f8fafc!important;border-color:#475569!important;
}
/* Móvil */
@media(max-width:768px){
  .card::before,.mundial-card::before,.modal-content::before,.client-base-panel::before,#dimiBubble::before,.upload-card::before,.filter-card::before{padding:1.25px!important;}
  body.dark .buyers-mobile-fit tr,body.dark .nobuy-mobile-fit tr{background:#111827!important;border-color:#334155!important;}
}
