/* =========================================================
   WIRTZ HUB · DASHBOARD DE INICIO
   Inicio operativo · stock · próximos módulos
   Premium · compacto · minimalista · responsive · dark safe
   ========================================================= */

/* =========================================================
   CONTENEDOR
   ========================================================= */

.dashboard {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;

  padding: 7px;

  animation: dashboardFadeUp 0.24s ease both;
}

/* =========================================================
   HERO
   ========================================================= */

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  gap: 8px;

  padding: 10px;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.035);

  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.dashboard-hero:hover {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 16px 34px rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .dashboard-hero {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(10, 10, 10, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .dashboard-hero:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 38px rgba(0, 0, 0, 0.34);
}

.dashboard-hero__copy {
  display: grid;
  align-content: center;
  gap: 7px;

  min-width: 0;
}

.dashboard-hero__copy .badge {
  display: inline-flex;
  align-items: center;

  width: max-content;
  max-width: 100%;

  padding: 5px 8px;

  border: 1px solid color-mix(in srgb, #2563eb 24%, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  background: color-mix(in srgb, #2563eb 6%, transparent);

  color: color-mix(in srgb, #2563eb 84%, var(--text-strong));

  font-size: 7.6px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

html[data-theme="dark"] .dashboard-hero__copy .badge {
  border-color: color-mix(in srgb, #60a5fa 26%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, #60a5fa 8%, transparent);
  color: #93c5fd;
}

.dashboard-hero__copy h2 {
  max-width: 800px;
  margin: 0;

  color: var(--text-strong);

  font-size: clamp(20px, 2.15vw, 29px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.067em;
}

html[data-theme="dark"] .dashboard-hero__copy h2 {
  color: rgba(255, 255, 255, 0.94);
}

.dashboard-hero__copy p {
  max-width: 760px;
  margin: 0;

  color: var(--muted);

  font-size: 9.6px;
  font-weight: 740;
  line-height: 1.45;
}

html[data-theme="dark"] .dashboard-hero__copy p {
  color: rgba(255, 255, 255, 0.52);
}

/* =========================================================
   STATUS PANEL
   ========================================================= */

.dashboard-status {
  display: grid;
  align-content: center;
  gap: 0;

  padding: 0;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 11px;
  background: transparent;

  overflow: hidden;

  transition:
    border-color var(--transition),
    background var(--transition);
}

html[data-theme="dark"] .dashboard-status {
  border-color: rgba(255, 255, 255, 0.11);
}

.dashboard-status__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-height: 27px;
  padding: 0 8px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.dashboard-status__row:last-child {
  border-bottom: 0;
}

.dashboard-status__row:hover {
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .dashboard-status__row {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .dashboard-status__row:hover {
  background: rgba(255, 255, 255, 0.065);
}

.dashboard-status__label {
  min-width: 0;

  color: var(--muted);

  font-size: 8.5px;
  font-weight: 850;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-status__value {
  color: var(--text-strong);

  font-size: 8.5px;
  font-weight: 950;

  white-space: nowrap;
}

html[data-theme="dark"] .dashboard-status__label {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .dashboard-status__value {
  color: rgba(255, 255, 255, 0.88);
}

.dashboard-status__value.text-success {
  color: #16a34a;
}

html[data-theme="dark"] .dashboard-status__value.text-success {
  color: #4ade80;
}

/* =========================================================
   SECTION TITLE
   ========================================================= */

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  margin-top: 0;
}

.section-title h2 {
  margin: 0;

  color: var(--text-strong);

  font-size: 12.4px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-title span {
  color: var(--muted);

  font-size: 8.9px;
  font-weight: 760;
  line-height: 1.25;
}

html[data-theme="dark"] .section-title h2 {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .section-title span {
  color: rgba(255, 255, 255, 0.48);
}

/* =========================================================
   KPI
   ========================================================= */

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

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.035);

  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="dark"] .dashboard-grid {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(10, 10, 10, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

.kpi {
  display: grid;
  align-content: center;
  gap: 5px;

  min-height: 62px;
  padding: 9px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.kpi:last-child {
  border-right: 0;
}

.kpi:hover {
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .kpi {
  border-right-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .kpi:hover {
  background: rgba(255, 255, 255, 0.065);
}

.kpi__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;

  min-width: 0;
}

.kpi__label {
  min-width: 0;

  color: var(--muted);

  font-size: 7.7px;
  font-weight: 950;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .kpi__label {
  color: rgba(255, 255, 255, 0.48);
}

.kpi__icon {
  display: grid;
  width: 23px;
  height: 23px;
  min-width: 23px;
  place-items: center;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 7px;
  background: transparent;

  color: var(--text-strong);

  transition:
    border-color var(--transition),
    background var(--transition),
    color var(--transition),
    transform var(--transition),
    filter var(--transition);
}

.kpi:hover .kpi__icon {
  transform: translateY(-1px);
}

.kpi__icon .icon {
  width: 11.5px;
  height: 11.5px;
  stroke-width: 2.15;
}

/* Colores Lucide KPI: no remover */
.kpi:nth-child(1) .kpi__icon {
  border-color: color-mix(in srgb, #16a34a 28%, rgba(0, 0, 0, 0.12));
  color: #16a34a;
}

.kpi:nth-child(2) .kpi__icon {
  border-color: color-mix(in srgb, #2563eb 28%, rgba(0, 0, 0, 0.12));
  color: #2563eb;
}

.kpi:nth-child(3) .kpi__icon {
  border-color: color-mix(in srgb, #7c3aed 28%, rgba(0, 0, 0, 0.12));
  color: #7c3aed;
}

.kpi:nth-child(4) .kpi__icon {
  border-color: color-mix(in srgb, #ea580c 28%, rgba(0, 0, 0, 0.12));
  color: #ea580c;
}

html[data-theme="dark"] .kpi:nth-child(1) .kpi__icon {
  color: #4ade80;
  border-color: color-mix(in srgb, #4ade80 30%, rgba(255, 255, 255, 0.12));
}

html[data-theme="dark"] .kpi:nth-child(2) .kpi__icon {
  color: #60a5fa;
  border-color: color-mix(in srgb, #60a5fa 30%, rgba(255, 255, 255, 0.12));
}

html[data-theme="dark"] .kpi:nth-child(3) .kpi__icon {
  color: #a78bfa;
  border-color: color-mix(in srgb, #a78bfa 30%, rgba(255, 255, 255, 0.12));
}

html[data-theme="dark"] .kpi:nth-child(4) .kpi__icon {
  color: #fb923c;
  border-color: color-mix(in srgb, #fb923c 30%, rgba(255, 255, 255, 0.12));
}

.kpi:hover .kpi__icon {
  filter: saturate(1.14) contrast(1.04);
}

.kpi__value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;

  min-width: 0;
}

.kpi__value {
  min-width: 0;

  color: var(--text-strong);

  font-size: 17.5px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .kpi__value {
  color: rgba(255, 255, 255, 0.92);
}

.kpi__note {
  color: var(--muted);

  font-size: 8.4px;
  font-weight: 760;
  line-height: 1.18;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[data-theme="dark"] .kpi__note {
  color: rgba(255, 255, 255, 0.48);
}

.kpi__mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  min-height: 22px;
  padding: 3px 7px;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 999px;
  background: transparent;

  color: var(--text-strong);

  font-size: 7.6px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;
  outline: none;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.kpi__mini-btn:hover {
  border-color: rgba(0, 0, 0, 0.24);
  background: rgba(0, 0, 0, 0.055);
}

.kpi__mini-btn:active {
  transform: scale(0.97);
}

.kpi__mini-btn:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-strong) 16%, transparent);
}

html[data-theme="dark"] .kpi__mini-btn {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .kpi__mini-btn:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
}

.kpi__mini-btn .icon {
  width: 9.8px;
  height: 9.8px;
  stroke-width: 2.2;
}

/* =========================================================
   STOCK REPORT
   ========================================================= */

.stock-report {
  display: grid;
  gap: 7px;
}

.stock-report__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.035);

  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="dark"] .stock-report__grid {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(10, 10, 10, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

.stock-card {
  display: grid;
  align-content: center;
  gap: 3px;

  min-height: 51px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.stock-card:last-child {
  border-right: 0;
}

.stock-card:hover {
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .stock-card {
  border-right-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .stock-card:hover {
  background: rgba(255, 255, 255, 0.065);
}

.stock-card span {
  color: var(--muted);

  font-size: 7.5px;
  font-weight: 950;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-card strong {
  color: var(--text-strong);

  font-size: 16.5px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-card small {
  color: var(--muted-2);

  font-size: 7.3px;
  font-weight: 820;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .stock-card span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .stock-card small {
  color: rgba(255, 255, 255, 0.38);
}

/* Colores stock: no remover */
.stock-card:nth-child(1) strong {
  color: #2563eb;
}

.stock-card:nth-child(2) strong {
  color: #16a34a;
}

.stock-card:nth-child(3) strong {
  color: #dc2626;
}

.stock-card:nth-child(4) strong {
  color: #ea580c;
}

.stock-card:nth-child(5) strong {
  color: #7c3aed;
}

.stock-card:nth-child(6) strong {
  color: #ca8a04;
}

html[data-theme="dark"] .stock-card:nth-child(1) strong {
  color: #60a5fa;
}

html[data-theme="dark"] .stock-card:nth-child(2) strong {
  color: #4ade80;
}

html[data-theme="dark"] .stock-card:nth-child(3) strong {
  color: #f87171;
}

html[data-theme="dark"] .stock-card:nth-child(4) strong {
  color: #fb923c;
}

html[data-theme="dark"] .stock-card:nth-child(5) strong {
  color: #a78bfa;
}

html[data-theme="dark"] .stock-card:nth-child(6) strong {
  color: #facc15;
}

/* =========================================================
   ALERTAS STOCK
   ========================================================= */

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

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.035);

  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="dark"] .stock-alerts {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(10, 10, 10, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

.stock-alert {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;

  min-height: 64px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.stock-alert:last-child {
  border-right: 0;
}

.stock-alert:hover {
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .stock-alert {
  border-right-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .stock-alert:hover {
  background: rgba(255, 255, 255, 0.065);
}

.stock-alert__icon {
  display: grid;
  width: 26px;
  height: 26px;
  min-width: 26px;
  place-items: center;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  background: transparent;

  color: var(--text-strong);

  transition:
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    filter var(--transition);
}

.stock-alert:hover .stock-alert__icon {
  transform: translateY(-1px);
  filter: saturate(1.12) contrast(1.03);
}

/* Colores alertas Lucide: no remover */
.stock-alert:nth-child(1) .stock-alert__icon {
  border-color: color-mix(in srgb, #dc2626 28%, rgba(0, 0, 0, 0.12));
  color: #dc2626;
}

.stock-alert:nth-child(2) .stock-alert__icon {
  border-color: color-mix(in srgb, #ea580c 28%, rgba(0, 0, 0, 0.12));
  color: #ea580c;
}

.stock-alert:nth-child(3) .stock-alert__icon {
  border-color: color-mix(in srgb, #2563eb 28%, rgba(0, 0, 0, 0.12));
  color: #2563eb;
}

html[data-theme="dark"] .stock-alert:nth-child(1) .stock-alert__icon {
  color: #f87171;
  border-color: color-mix(in srgb, #f87171 30%, rgba(255, 255, 255, 0.12));
}

html[data-theme="dark"] .stock-alert:nth-child(2) .stock-alert__icon {
  color: #fb923c;
  border-color: color-mix(in srgb, #fb923c 30%, rgba(255, 255, 255, 0.12));
}

html[data-theme="dark"] .stock-alert:nth-child(3) .stock-alert__icon {
  color: #60a5fa;
  border-color: color-mix(in srgb, #60a5fa 30%, rgba(255, 255, 255, 0.12));
}

.stock-alert__icon .icon {
  width: 12.5px;
  height: 12.5px;
  stroke-width: 2.15;
}

.stock-alert__body {
  display: grid;
  align-content: start;
  gap: 3px;

  min-width: 0;
}

.stock-alert__body strong {
  color: var(--text-strong);

  font-size: 9.5px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-alert__body p {
  margin: 0;

  color: var(--muted);

  font-size: 8.1px;
  font-weight: 760;
  line-height: 1.32;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.stock-alert__body small {
  color: var(--muted-2);

  font-size: 7.2px;
  font-weight: 850;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .stock-alert__body strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .stock-alert__body p {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .stock-alert__body small {
  color: rgba(255, 255, 255, 0.38);
}

/* =========================================================
   MODAL · PRÓXIMOS MÓDULOS
   ========================================================= */

.dashboard-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  place-items: center;

  padding: 18px;

  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.dashboard-modal.is-open {
  display: grid;
  animation: dashboardModalBackdropIn 0.16s ease both;
}

.dashboard-modal__card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);

  width: min(760px, 100%);
  max-height: min(680px, calc(100vh - 36px));

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 98%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;

  overflow: hidden;

  animation: dashboardModalIn 0.2s ease both;
}

html[data-theme="dark"] .dashboard-modal__card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.96);
  box-shadow:
    0 22px 80px rgba(0, 0, 0, 0.58),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.dashboard-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 9px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.11);
}

html[data-theme="dark"] .dashboard-modal__head {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dashboard-modal__title {
  display: flex;
  align-items: center;
  gap: 8px;

  min-width: 0;
}

.dashboard-modal__icon {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  place-items: center;

  border: 1px solid color-mix(in srgb, #ea580c 28%, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: transparent;

  color: #ea580c;
}

html[data-theme="dark"] .dashboard-modal__icon {
  color: #fb923c;
  border-color: color-mix(in srgb, #fb923c 30%, rgba(255, 255, 255, 0.12));
}

.dashboard-modal__icon .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.15;
}

.dashboard-modal__title h3 {
  margin: 0;

  color: var(--text-strong);

  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;
}

.dashboard-modal__title p {
  margin: 2px 0 0;

  color: var(--muted);

  font-size: 8.6px;
  font-weight: 730;
  line-height: 1.3;
}

html[data-theme="dark"] .dashboard-modal__title h3 {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .dashboard-modal__title p {
  color: rgba(255, 255, 255, 0.48);
}

.dashboard-modal__close {
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  place-items: center;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 9px;
  background: transparent;

  color: var(--text-strong);

  cursor: pointer;
  outline: none;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.dashboard-modal__close:hover {
  border-color: rgba(0, 0, 0, 0.24);
  background: rgba(0, 0, 0, 0.055);
}

.dashboard-modal__close:active {
  transform: scale(0.96);
}

.dashboard-modal__close:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-strong) 16%, transparent);
}

html[data-theme="dark"] .dashboard-modal__close {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .dashboard-modal__close:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
}

.dashboard-modal__close .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.15;
}

.dashboard-modal__body {
  display: grid;
  gap: 8px;

  min-height: 0;
  padding: 9px;

  overflow: auto;
}

.next-modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: transparent;

  overflow: hidden;
}

html[data-theme="dark"] .next-modules-grid {
  border-color: rgba(255, 255, 255, 0.1);
}

.next-module {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;

  min-height: 73px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.next-module:hover {
  background: rgba(0, 0, 0, 0.045);
}

.next-module:nth-child(2n) {
  border-right: 0;
}

.next-module:nth-last-child(1),
.next-module:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

html[data-theme="dark"] .next-module {
  border-right-color: rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .next-module:hover {
  background: rgba(255, 255, 255, 0.065);
}

.next-module__icon {
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 28px;
  place-items: center;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9px;
  background: transparent;

  color: var(--text-strong);

  transition:
    color var(--transition),
    transform var(--transition),
    filter var(--transition);
}

.next-module:hover .next-module__icon {
  transform: translateY(-1px);
  filter: saturate(1.12) contrast(1.03);
}

/* Colores módulos Lucide: no remover */
.next-module:nth-child(1) .next-module__icon {
  color: #2563eb;
}

.next-module:nth-child(2) .next-module__icon {
  color: #a855f7;
}

.next-module:nth-child(3) .next-module__icon {
  color: #16a34a;
}

.next-module:nth-child(4) .next-module__icon {
  color: #7c3aed;
}

.next-module:nth-child(5) .next-module__icon {
  color: #ca8a04;
}

.next-module:nth-child(6) .next-module__icon {
  color: #0f766e;
}

.next-module:nth-child(7) .next-module__icon {
  color: #ea580c;
}

.next-module:nth-child(8) .next-module__icon {
  color: #db2777;
}

.next-module:nth-child(9) .next-module__icon {
  color: #dc2626;
}

html[data-theme="dark"] .next-module:nth-child(1) .next-module__icon {
  color: #60a5fa;
}

html[data-theme="dark"] .next-module:nth-child(2) .next-module__icon {
  color: #c084fc;
}

html[data-theme="dark"] .next-module:nth-child(3) .next-module__icon {
  color: #4ade80;
}

html[data-theme="dark"] .next-module:nth-child(4) .next-module__icon {
  color: #a78bfa;
}

html[data-theme="dark"] .next-module:nth-child(5) .next-module__icon {
  color: #facc15;
}

html[data-theme="dark"] .next-module:nth-child(6) .next-module__icon {
  color: #2dd4bf;
}

html[data-theme="dark"] .next-module:nth-child(7) .next-module__icon {
  color: #fb923c;
}

html[data-theme="dark"] .next-module:nth-child(8) .next-module__icon {
  color: #f472b6;
}

html[data-theme="dark"] .next-module:nth-child(9) .next-module__icon {
  color: #f87171;
}

.next-module__icon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.15;
}

.next-module__body {
  display: grid;
  align-content: start;
  gap: 4px;

  min-width: 0;
}

.next-module__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;

  min-width: 0;
}

.next-module__top strong {
  min-width: 0;

  color: var(--text-strong);

  font-size: 9.7px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-module__status {
  display: inline-flex;
  align-items: center;

  min-height: 17px;
  padding: 2px 6px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: transparent;

  color: var(--muted);

  font-size: 7.3px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.next-module__body p {
  margin: 0;

  color: var(--muted);

  font-size: 8px;
  font-weight: 720;
  line-height: 1.35;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[data-theme="dark"] .next-module__top strong {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .next-module__status {
  border-color: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.46);
}

html[data-theme="dark"] .next-module__body p {
  color: rgba(255, 255, 255, 0.48);
}

.dashboard-modal__note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;

  padding: 8px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: transparent;
}

html[data-theme="dark"] .dashboard-modal__note {
  border-color: rgba(255, 255, 255, 0.1);
}

.dashboard-modal__note .icon {
  width: 13px;
  height: 13px;

  color: #2563eb;
  stroke-width: 2.15;
}

html[data-theme="dark"] .dashboard-modal__note .icon {
  color: #60a5fa;
}

.dashboard-modal__note p {
  margin: 0;

  color: var(--muted);

  font-size: 8.2px;
  font-weight: 720;
  line-height: 1.35;
}

html[data-theme="dark"] .dashboard-modal__note p {
  color: rgba(255, 255, 255, 0.48);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1240px) {
  .stock-report__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stock-card:nth-child(3n) {
    border-right: 0;
  }

  .stock-card:nth-child(n + 4) {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  html[data-theme="dark"] .stock-card:nth-child(n + 4) {
    border-top-color: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 980px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

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

  .kpi:nth-child(2n) {
    border-right: 0;
  }

  .kpi:nth-child(n + 3) {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  html[data-theme="dark"] .kpi:nth-child(n + 3) {
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .stock-alerts {
    grid-template-columns: 1fr;
  }

  .stock-alert {
    border-right: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .stock-alert:first-child {
    border-top: 0;
  }

  html[data-theme="dark"] .stock-alert {
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .next-modules-grid {
    grid-template-columns: 1fr;
  }

  .next-module {
    border-right: 0;
  }

  .next-module:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  html[data-theme="dark"] .next-module:nth-last-child(2):nth-child(odd) {
    border-bottom-color: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 760px) {
  .dashboard {
    gap: 7px;
    padding: 6px;
  }

  .dashboard-hero {
    gap: 8px;
    padding: 8px;
  }

  .dashboard-hero__copy h2 {
    font-size: clamp(19px, 7vw, 25px);
    letter-spacing: -0.06em;
  }

  .dashboard-hero__copy p {
    font-size: 9px;
  }

  .dashboard-grid,
  .stock-report__grid {
    grid-template-columns: 1fr;
  }

  .kpi,
  .stock-card {
    border-right: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .kpi:first-child,
  .stock-card:first-child {
    border-top: 0;
  }

  html[data-theme="dark"] .kpi,
  html[data-theme="dark"] .stock-card {
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .dashboard-modal {
    padding: 10px;
  }

  .dashboard-modal__card {
    max-height: calc(100vh - 20px);
  }

  .dashboard-modal__head {
    align-items: flex-start;
  }

  .next-module__top {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .dashboard {
    padding: 5px;
  }

  .dashboard-hero {
    padding: 8px;
    border-radius: 14px;
  }

  .dashboard-hero__copy .badge {
    max-width: 100%;
    font-size: 7px;
  }

  .dashboard-status__row {
    min-height: 26px;
    padding: 0 7px;
  }

  .dashboard-status__label,
  .dashboard-status__value {
    font-size: 8px;
  }

  .kpi {
    min-height: 58px;
    padding: 8px;
  }

  .kpi__value {
    font-size: 16px;
  }

  .stock-card {
    min-height: 48px;
    padding: 8px;
  }

  .stock-card strong {
    font-size: 15.5px;
  }

  .stock-alert {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 7px;
    min-height: 62px;
    padding: 8px;
  }

  .stock-alert__icon {
    width: 25px;
    height: 25px;
    min-width: 25px;
  }

  .dashboard-modal__title p {
    display: none;
  }

  .dashboard-modal__body {
    padding: 8px;
  }
}

@media (max-width: 380px) {
  .dashboard-hero__copy h2 {
    font-size: 18px;
  }

  .dashboard-hero__copy p {
    font-size: 8.7px;
  }

  .kpi__mini-btn span {
    display: none;
  }

  .kpi__mini-btn {
    width: 22px;
    min-width: 22px;
    padding: 0;
  }

  .stock-alert__body p {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes dashboardFadeUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardModalBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dashboardModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Respeta usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .dashboard,
  .dashboard *,
  .dashboard *::before,
  .dashboard *::after,
  .dashboard-modal,
  .dashboard-modal *,
  .dashboard-modal *::before,
  .dashboard-modal *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}