/* =====================================================
   TRADE MANAGER · COMPONENTES REUTILIZABLES
===================================================== */

.tm-panel{
  padding:22px;
  border:1px solid var(--line-soft);
  border-radius:24px;
  background:linear-gradient(180deg,#fff,#fbfdfb);
  box-shadow:var(--shadow);
}

.tm-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.tm-panel-head h3{
  margin:0;
  color:var(--primary);
  font-size:18px;
  font-weight:950;
}

.tm-panel-head span{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

/* KPI ENTERPRISE */
.tm-kpi-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
}

.tm-kpi{
  position:relative;
  overflow:hidden;
  min-height:112px;
  padding:16px;
  border:1px solid var(--line-soft);
  border-top:4px solid var(--primary);
  border-radius:22px;
  background:linear-gradient(180deg,#fff,#fbfdfb);
  box-shadow:var(--shadow);
}

.tm-kpi::after{
  content:"";
  position:absolute;
  right:-28px;
  top:-28px;
  width:90px;
  height:90px;
  border-radius:999px;
  background:rgba(15,107,87,.08);
}

.tm-kpi:nth-child(2){border-top-color:var(--success);}
.tm-kpi:nth-child(3){border-top-color:#f97316;}
.tm-kpi:nth-child(4){border-top-color:#8b5cf6;}
.tm-kpi:nth-child(5){border-top-color:var(--blue);}
.tm-kpi:nth-child(6){border-top-color:var(--gold);}

.tm-kpi-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:14px;
  margin-bottom:10px;
  background:var(--primary-soft);
  font-size:22px;
}

.tm-kpi.green .tm-kpi-icon{background:var(--success-soft);}
.tm-kpi.blue .tm-kpi-icon{background:var(--blue-soft);}
.tm-kpi.gold .tm-kpi-icon{background:var(--gold-soft);}
.tm-kpi.orange .tm-kpi-icon{background:var(--warning-soft);}
.tm-kpi.purple .tm-kpi-icon{background:#f3e8ff;}

.tm-kpi-label{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.tm-kpi strong{
  display:block;
  margin-top:12px;
  color:var(--heading);
  font-size:32px;
  line-height:1;
  font-weight:950;
}

.tm-kpi small{
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.tm-kpi-trend{
  display:inline-flex;
  margin-top:10px;
  padding:5px 9px;
  border-radius:999px;
  background:var(--success-soft);
  color:var(--success);
  font-size:11px;
  font-weight:900;
}

/* MODULE CARDS */
.tm-module-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.tm-module-card{
  min-height:150px;
  padding:18px;
  border:1px solid var(--line-soft);
  border-radius:22px;
  background:#fff;
  color:var(--text);
  box-shadow:var(--shadow-sm);
  text-align:left;
}

.tm-module-icon{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:17px;
  margin-bottom:14px;
  background:var(--primary-soft);
  font-size:25px;
}

.tm-module-card h4{
  margin:0;
  color:var(--heading);
  font-size:16px;
  font-weight:950;
}

.tm-module-card p{
  margin:7px 0 12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  font-weight:650;
}

.tm-module-card b{
  color:var(--primary);
  font-size:13px;
  font-weight:950;
}

/* CLIENT ROW */
.tm-client-row{
  width:100%;
  min-height:62px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid var(--line-soft);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
  text-align:left;
}

.tm-client-row + .tm-client-row{
  margin-top:9px;
}

.tm-client-row span{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--primary-soft);
}

.tm-client-row strong{
  display:block;
  color:var(--heading);
  font-size:13px;
  font-weight:950;
}

.tm-client-row small{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}

.tm-client-row b{
  padding:6px 9px;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:10px;
  font-weight:950;
  white-space:nowrap;
}

/* STATUS BAR */
.tm-status-bar{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  padding:16px 18px;
  border:1px solid var(--line-soft);
  border-radius:22px;
  background:#fff;
  box-shadow:var(--shadow);
}

.tm-status-item{
  display:flex;
  align-items:center;
  gap:12px;
}

.tm-status-item span{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--primary-soft);
}

.tm-status-item strong{
  display:block;
  color:var(--heading);
  font-size:13px;
  font-weight:900;
}

.tm-status-item small{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

/* Tablet / PC only: KPIs siempre en una línea */
@media(max-width:1200px){
  .tm-kpi-grid{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
}

@media(max-width:900px){
  .tm-kpi-grid{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }

  .tm-status-bar{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}