.module-shell{
  grid-column:1/-1;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.module-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.module-toolbar-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.module-toolbar-copy strong{
  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size:22px;
}

.module-toolbar-copy span{
  color:var(--muted);
  font-size:11px;
}

.module-badge{
  display:inline-flex;
  align-items:center;
  min-height:29px;

  padding:
    0 10px;

  border-radius:999px;

  background:
    #f0e6f2;

  color:
    var(--purple);

  font-size:9px;
  font-weight:800;

  letter-spacing:.04em;
}

.module-badge.live{
  background:#edf8f2;
  color:#23764f;
}

.module-badge.blocked{
  background:#fff1f3;
  color:#a94555;
}

.data-grid{
  display:grid;
  grid-template-columns:
    repeat(
      3,
      minmax(0,1fr)
    );

  gap:14px;
}

.data-card{
  min-width:0;
  padding:18px;

  border:
    1px solid
    var(--border);

  border-radius:16px;

  background:var(--paper);

  box-shadow:
    var(--shadow-soft);
}

.data-card h3{
  margin:
    0 0 12px;

  font-size:14px;
}

.data-card dl{
  display:grid;
  gap:8px;

  margin:0;
}

.data-card dl > div{
  display:grid;
  grid-template-columns:
    minmax(80px,.7fr)
    minmax(0,1.3fr);

  gap:10px;

  padding-bottom:7px;

  border-bottom:
    1px solid
    var(--border);
}

.data-card dt{
  color:var(--muted);
  font-size:9px;
  font-weight:700;

  text-transform:uppercase;
  letter-spacing:.05em;
}

.data-card dd{
  min-width:0;

  margin:0;

  color:var(--text);

  font-size:11px;

  overflow-wrap:anywhere;
}

.module-empty,
.module-error{
  padding:26px;

  border:
    1px dashed
    #d9cdd9;

  border-radius:16px;

  background:
    rgba(255,255,255,.6);

  color:var(--muted);

  font-size:12px;
}

.module-error{
  border-color:#edced4;
  background:#fff8f9;
  color:#9d4251;
}

.metric-grid{
  display:grid;
  grid-template-columns:
    repeat(
      4,
      minmax(0,1fr)
    );

  gap:12px;
}

.metric{
  padding:18px;

  border:
    1px solid
    var(--border);

  border-radius:16px;

  background:var(--paper);
}

.metric strong{
  display:block;

  font-family:
    Georgia,
    serif;

  font-size:28px;

  color:var(--purple);
}

.metric span{
  color:var(--muted);
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.raw-panel{
  padding:16px;

  overflow:auto;

  border:
    1px solid
    var(--border);

  border-radius:15px;

  background:#fff;

  color:#4f4354;

  font:
    10px/1.55
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;

  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.nav-button[data-v4-module="1"]:disabled,
.module-card[data-v4-module="1"]:disabled{
  opacity:1;
  cursor:pointer;
}

@media(max-width:1100px){
  .data-grid{
    grid-template-columns:
      repeat(
        2,
        minmax(0,1fr)
      );
  }

  .metric-grid{
    grid-template-columns:
      repeat(
        2,
        minmax(0,1fr)
      );
  }
}

@media(max-width:650px){
  .data-grid,
  .metric-grid{
    grid-template-columns:1fr;
  }
}

/* ==========================================================
   MAG V4 · WORKSPACE WIDE OVERRIDE
   ========================================================== */

.module-shell{
  width:100%;
  max-width:none;
}

/* En desktop grande, datos en cuatro columnas */
@media(min-width:1450px){

  .data-grid{
    grid-template-columns:
      repeat(
        4,
        minmax(0,1fr)
      );

    gap:16px;
  }

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

}

/* Desktop normal */
@media(
  min-width:1001px
)
and
(
  max-width:1449px
){

  .data-grid{
    grid-template-columns:
      repeat(
        3,
        minmax(0,1fr)
      );
  }

}

/* Formularios operativos largos */
.module-shell
.v4-action-zone{
  width:100%;
  max-width:none;
}
