/* ============================================================
   module-hub.css - Hub genérico de módulos (cards descriptivas)
   Colores de marca: primary #084734, accent #93C11F, highlight #CEF431
   ============================================================ */

.mhub { padding: 0; }

/* ═══════════════════════ HERO ═══════════════════════ */
.mhub__hero {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 1.5rem 1.75rem;
  margin-bottom: 1.6rem; color: #fff;
}
/* Gradientes con paleta de marca: #084734 (primary), #93C11F (accent), #CEF431 (highlight)
   Cada módulo usa variaciones de tono del verde de marca */
.mhub__hero--default       { background: linear-gradient(135deg, #042e22 0%, #084734 40%, #0d6b4f 100%); }
.mhub__hero--ventas        { background: linear-gradient(135deg, #042e22 0%, #065f46 35%, #0d9668 100%); }
.mhub__hero--compras       { background: linear-gradient(135deg, #052e1e 0%, #084734 40%, #0a5c44 100%); }
.mhub__hero--facturacion   { background: linear-gradient(135deg, #0a3d2e 0%, #106b4c 35%, #14845e 100%); }
.mhub__hero--logistica     { background: linear-gradient(135deg, #042e22 0%, #047857 40%, #059669 100%); }
.mhub__hero--cartera       { background: linear-gradient(135deg, #032b1f 0%, #064e3b 35%, #0a7558 100%); }
.mhub__hero--devoluciones  { background: linear-gradient(135deg, #05301f 0%, #065f46 35%, #087a57 100%); }
.mhub__hero--config        { background: linear-gradient(135deg, #032316 0%, #053d2c 35%, #084734 100%); }
.mhub__hero--pedidos-bodega { background: linear-gradient(135deg, #042e22 0%, #0a5c44 35%, #10856a 100%); }
.mhub__hero--reportes      { background: linear-gradient(135deg, #042e22 0%, #084734 35%, #0d6b4f 100%); }

.mhub__hero-bg {
  position: absolute; inset: 0; opacity: .06;
  background-image:
    radial-gradient(circle at 15% 85%, #fff 1px, transparent 1px),
    radial-gradient(circle at 85% 15%, #fff 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #fff 1.5px, transparent 1.5px);
  background-size: 50px 50px, 70px 70px, 90px 90px;
}
.mhub__hero-content { position: relative; z-index: 1; }
.mhub__hero-text {
  display: flex; align-items: center; gap: .9rem;
  margin-bottom: 1.1rem;
}
.mhub__hero-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.14); border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.18);
  flex-shrink: 0;
}
.mhub__hero-title {
  font-size: 1.4rem; font-weight: 800; margin: 0;
  letter-spacing: -.02em;
}
.mhub__hero-sub {
  font-size: .82rem; opacity: .75; margin: .1rem 0 0;
  font-weight: 400; max-width: 500px;
}

/* KPIs inline */
.mhub__kpis { display: flex; gap: .55rem; flex-wrap: wrap; }
.mhub__kpi {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.11); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: .5rem .75rem;
  min-width: 130px; transition: background .15s;
}
.mhub__kpi:hover { background: rgba(255,255,255,.2); }
.mhub__kpi i { font-size: .85rem; opacity: .85; }
.mhub__kpi-data { display: flex; flex-direction: column; }
.mhub__kpi-val { font-size: 1rem; font-weight: 800; line-height: 1.15; }
.mhub__kpi-lbl { font-size: .62rem; opacity: .65; text-transform: uppercase; letter-spacing: .4px; }

.mhub__kpi--red .mhub__kpi-val { color: #fca5a5; }
.mhub__kpi--amber .mhub__kpi-val { color: #fde68a; }
.mhub__kpi--green .mhub__kpi-val { color: #86efac; }
.mhub__kpi--blue .mhub__kpi-val { color: #93c5fd; }
.mhub__kpi--lime .mhub__kpi-val { color: #CEF431; }
.mhub__kpi--white .mhub__kpi-val { color: #fff; }

/* ═══════════════════════ SECTIONS ═══════════════════════ */
.mhub__section { margin-bottom: 1.4rem; }
.mhub__section-head {
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: .6rem; padding-left: .1rem;
}
.mhub__section-head i { color: var(--brand-accent, #93C11F); font-size: .72rem; }
.mhub__section-count {
  background: var(--border); color: var(--text-muted);
  font-size: .6rem; font-weight: 700;
  padding: .08rem .4rem; border-radius: 7px;
  margin-left: .1rem;
}

/* ═══════════════════════ GRID ═══════════════════════ */
.mhub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: .6rem;
}

/* ═══════════════════════ CARDS ═══════════════════════ */
.mhub__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .95rem 1rem;
  display: flex; align-items: center; gap: .8rem;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.mhub__card::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow .25s;
}
.mhub__card:hover {
  border-color: var(--brand-accent, #93C11F);
  transform: translateY(-3px);
}
.mhub__card:hover::after {
  box-shadow: 0 8px 28px rgba(8,71,52,.10);
}
.mhub__card:active { transform: translateY(-1px); }

/* Icon */
.mhub__card-icon {
  width: 42px; height: 42px;
  background: var(--card-bg); color: var(--card-color);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.mhub__card:hover .mhub__card-icon {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

/* Body */
.mhub__card-body { flex: 1; min-width: 0; }
.mhub__card-top { display: flex; align-items: center; gap: .35rem; margin-bottom: .15rem; }
.mhub__card-title {
  font-size: .85rem; font-weight: 700; color: var(--text);
  margin: 0; line-height: 1.2;
}
.mhub__card-badge {
  font-size: .55rem; font-weight: 700;
  background: var(--brand-accent, #93C11F); color: #084734;
  padding: .12rem .4rem; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap;
}
.mhub__card-desc {
  font-size: .74rem; color: var(--text-muted);
  line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Arrow */
.mhub__card-go {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; flex-shrink: 0;
  color: var(--border); background: transparent;
  transition: all .2s;
}
.mhub__card:hover .mhub__card-go {
  background: var(--brand-accent, #93C11F);
  color: #084734;
  transform: translateX(2px);
}

/* ═══════════════════════ SKELETON ═══════════════════════ */
.mhub__sk-hero {
  height: 130px; border-radius: 16px;
  background: linear-gradient(135deg, #d1d5db, #e5e7eb);
  margin-bottom: 1.6rem;
  animation: mhub-pulse 1.4s ease-in-out infinite;
}
.mhub__sk-section-head {
  width: 160px; height: 14px; border-radius: 4px;
  background: var(--border); margin-bottom: .6rem;
  animation: mhub-pulse 1.4s ease-in-out infinite;
}
.mhub__sk-card {
  height: 70px; border-radius: 12px; background: var(--border);
  animation: mhub-pulse 1.4s ease-in-out infinite;
}
@keyframes mhub-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .75; }
}

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 768px) {
  .mhub__hero { padding: 1.1rem 1rem; border-radius: 12px; }
  .mhub__hero-text { gap: .65rem; }
  .mhub__hero-icon { width: 40px; height: 40px; font-size: 1.05rem; }
  .mhub__hero-title { font-size: 1.15rem; }
  .mhub__kpis { gap: .4rem; }
  .mhub__kpi { min-width: 110px; padding: .4rem .55rem; }
  .mhub__kpi-val { font-size: .85rem; }
  .mhub__grid { grid-template-columns: 1fr; }
}
@media (min-width: 1200px) {
  .mhub__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1500px) {
  .mhub__grid { grid-template-columns: repeat(4, 1fr); }
}
