/* ============================================================
 * ALPHA FITNESS — DASHBOARD PRO · SECCIÓN ADMINISTRACIÓN (ERP)
 * Ventas + Stock + Simulador. Replica la planilla Excel del titular.
 * Doc: NÚCLEO/Alpha Fitness/Web/Sistema de Administración (ERP).md
 * ============================================================ */

.adm {
  font-family: 'Raleway', system-ui, -apple-system, sans-serif;
  color: #e5e5e5;
  max-width: 1400px;
}

/* ── Hero ── */
.adm__hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: radial-gradient(circle at 0% 0%, rgba(57,255,20,0.10), transparent 60%), linear-gradient(180deg, #0d0d0d, #080808);
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.adm__hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #39ff14, transparent);
  opacity: 0.55;
}
.adm__hero-icon {
  flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 12px;
  background: rgba(57,255,20,0.10);
  border: 1px solid rgba(57,255,20,0.25);
  color: #39ff14;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 18px rgba(57,255,20,0.15) inset;
}
.adm__hero-text { flex: 1; min-width: 0; }
.adm__title { margin: 0; color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 0.4px; }
.adm__subtitle { margin: 4px 0 0; color: #888; font-size: 13px; }

/* ── Acciones del hero (importar + badge) ── */
.adm__hero-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.adm-btn--import { white-space: nowrap; }

/* ── Badge de almacenamiento ── */
.adm__storage { flex-shrink: 0; }
.adm__storage-ok, .adm__storage-warn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.adm__storage-ok { background: rgba(41,211,107,0.10); color: #29d36b; border: 1px solid rgba(41,211,107,0.25); }
.adm__storage-warn { background: rgba(255,176,32,0.10); color: #ffb020; border: 1px solid rgba(255,176,32,0.25); flex-wrap: wrap; }
.adm__storage-help {
  background: transparent; border: 1px solid currentColor; color: inherit;
  font-family: inherit; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; cursor: pointer; margin-left: 4px;
}
.adm__storage-help:hover { background: rgba(255,176,32,0.15); }

/* ── Sub-tabs ── */
.adm__tabs {
  display: flex;
  gap: 6px;
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 18px;
}
.adm__tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #999;
  font-family: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.adm__tab i { font-size: 13px; }
.adm__tab:hover { color: #ddd; background: rgba(255,255,255,0.02); }
.adm__tab--active {
  background: rgba(57,255,20,0.08);
  border-color: rgba(57,255,20,0.30);
  color: #39ff14;
  box-shadow: 0 0 14px rgba(57,255,20,0.10);
}

.adm__pane { min-height: 240px; }

/* ── Loading / error / empty ── */
.adm__loading, .adm__error {
  text-align: center; padding: 50px 20px; color: #888; font-size: 14px;
}
.adm__loading i { color: #39ff14; font-size: 22px; margin-right: 8px; }
.adm__error i { color: #ff5050; margin-right: 8px; }

.adm__empty {
  text-align: center; padding: 50px 24px;
  background: #0d0d0d; border: 1px dashed #1f1f1f; border-radius: 14px;
}
.adm__empty-icon {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(57,255,20,0.06); border: 1px solid rgba(57,255,20,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #39ff14;
}
.adm__empty-title { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.adm__empty-msg { color: #888; font-size: 13px; margin-bottom: 18px; }

/* ── Botones ── */
.adm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; cursor: pointer;
  border: 1px solid transparent; transition: all 0.16s ease;
  background: transparent; color: inherit;
}
.adm-btn--primary {
  background: #39ff14; color: #000; border-color: #39ff14;
  box-shadow: 0 4px 14px rgba(57,255,20,0.18);
}
.adm-btn--primary:hover { background: #4dff2e; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(57,255,20,0.32); }
.adm-btn--primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.adm-btn--ghost { border-color: #2a2a2a; color: #ddd; background: rgba(255,255,255,0.02); }
.adm-btn--ghost:hover { border-color: #39ff14; color: #39ff14; background: rgba(57,255,20,0.06); }

.adm-icon-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(255,255,255,0.03); border: 1px solid #2a2a2a; color: #aaa;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 0.14s ease;
}
.adm-icon-btn:hover { color: #39ff14; border-color: #39ff14; background: rgba(57,255,20,0.06); }
.adm-icon-btn--danger:hover { color: #ff5050; border-color: #ff5050; background: rgba(255,80,80,0.08); }

/* ═══════════════ TABLAS (compartidas) ═══════════════ */
.adm-table-wrap {
  background: #0d0d0d; border: 1px solid #1f1f1f; border-radius: 12px;
  overflow-x: auto;
}
.adm-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.adm-table thead th {
  text-align: left; padding: 13px 14px;
  color: #888; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  border-bottom: 1px solid #1f1f1f; white-space: nowrap;
  background: rgba(255,255,255,0.015);
}
.adm-table .adm-th-num { text-align: right; }
.adm-table tbody td { padding: 12px 14px; border-bottom: 1px solid #161616; color: #ddd; }
.adm-table tbody tr:hover { background: rgba(255,255,255,0.015); }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-td-num { text-align: right; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.adm-td-prod { color: #fff; font-weight: 600; }
.adm-td-acciones { text-align: right; white-space: nowrap; }
.adm-td-acciones .adm-icon-btn { margin-left: 4px; }
.adm-td-vacio { text-align: center; color: #666; padding: 26px; font-style: italic; }

.adm-table tfoot .adm-foot td { padding: 14px; border-top: 2px solid #1f1f1f; background: rgba(57,255,20,0.03); font-weight: 800; }
.adm-foot-count { color: #fff; font-size: 13px; }
.adm-foot-ingreso, .adm-foot-costototal { color: #39ff14; font-size: 15px; }
.adm-foot-costo { color: #ff8080; }
.adm-foot-inv { color: #4dabff; }

/* ═══════════════ VENTAS ═══════════════ */
.adm-ventas__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.adm-ventas__meses { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.adm-chip {
  padding: 8px 14px; border-radius: 100px;
  background: rgba(255,255,255,0.03); border: 1px solid #2a2a2a; color: #bbb;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.adm-chip:hover { border-color: #39ff14; color: #39ff14; }
.adm-chip--active { background: #39ff14; color: #000; border-color: #39ff14; }
.adm-chip--add {
  width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%;
  color: #39ff14;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; flex-shrink: 0; box-sizing: border-box;
}
.adm-chip--add i { font-size: 13px; line-height: 1; }

.adm-td-fecha { color: #aaa; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.adm-td-ingreso { color: #39ff14; font-weight: 700; }
.adm-td-costo { color: #ff8080; }
.adm-cuenta-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px;
  background: rgba(77,171,255,0.10); border: 1px solid rgba(77,171,255,0.25);
  color: #4dabff; font-size: 11px; font-weight: 700;
}
.adm-disp {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 100px;
  font-family: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; border: 1px solid; transition: all 0.15s ease;
}
.adm-disp i { font-size: 10px; }
.adm-disp--si { background: rgba(41,211,107,0.10); color: #29d36b; border-color: rgba(41,211,107,0.30); }
.adm-disp--si:hover { background: rgba(41,211,107,0.20); }
.adm-disp--no { background: rgba(255,176,32,0.10); color: #ffb020; border-color: rgba(255,176,32,0.30); }
.adm-disp--no:hover { background: rgba(255,176,32,0.20); }

.adm-ventas__resumen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.adm-resumen-card {
  background: #0d0d0d; border: 1px solid #1f1f1f; border-radius: 12px; padding: 18px;
  position: relative; overflow: hidden;
}
.adm-resumen-card--ganancia { border-color: rgba(57,255,20,0.25); background: linear-gradient(180deg, rgba(57,255,20,0.04), transparent 60%), #0d0d0d; }
.adm-resumen-card--reserva { border-color: rgba(77,171,255,0.25); background: linear-gradient(180deg, rgba(77,171,255,0.04), transparent 60%), #0d0d0d; }
.adm-resumen-label { color: #888; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.adm-resumen-val { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.adm-resumen-card--ganancia .adm-resumen-val { color: #39ff14; }
.adm-resumen-card--reserva .adm-resumen-val { color: #4dabff; }
.adm-resumen-sub { color: #666; font-size: 11px; margin-top: 8px; }

/* ═══════════════ STOCK ═══════════════ */
.adm-stock__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.adm-stock__leyenda { display: flex; gap: 16px; flex-wrap: wrap; }
.adm-leg { display: inline-flex; align-items: center; gap: 6px; color: #999; font-size: 11px; font-weight: 600; }
.adm-leg-dot { width: 10px; height: 10px; border-radius: 50%; }
.adm-leg-dot--rojo { background: #ff5050; box-shadow: 0 0 6px rgba(255,80,80,0.5); }
.adm-leg-dot--amarillo { background: #ffb020; box-shadow: 0 0 6px rgba(255,176,32,0.5); }
.adm-leg-dot--verde { background: #29d36b; box-shadow: 0 0 6px rgba(41,211,107,0.5); }

.adm-stock-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 26px; padding: 0 8px; border-radius: 7px;
  font-weight: 800; font-size: 13px; font-variant-numeric: lining-nums tabular-nums;
}
.adm-stock--ok { background: rgba(41,211,107,0.12); color: #29d36b; border: 1px solid rgba(41,211,107,0.30); }
.adm-stock--amarillo { background: rgba(255,176,32,0.14); color: #ffb020; border: 1px solid rgba(255,176,32,0.35); }
.adm-stock--rojo { background: rgba(255,80,80,0.14); color: #ff5050; border: 1px solid rgba(255,80,80,0.40); }
.adm-td-costototal { color: #39ff14; font-weight: 700; }

/* ═══════════════ SIMULADOR ═══════════════ */
.adm-sim__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 18px; }
.adm-sim-card {
  background: #0d0d0d; border: 1px solid #1f1f1f; border-radius: 14px; padding: 20px;
}
.adm-sim-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.adm-sim-card__icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(57,255,20,0.08); border: 1px solid rgba(57,255,20,0.25); color: #39ff14;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.adm-sim-card__title { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.3px; }

.adm-sim-card__inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }

.adm-field { display: flex; flex-direction: column; gap: 6px; }
.adm-field > span { color: #aaa; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.adm-field > span small { text-transform: none; letter-spacing: 0; color: #666; font-weight: 500; }
.adm-field input[type="text"], .adm-field input[type="number"], .adm-field select {
  background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 8px;
  padding: 10px 12px; color: #fff; font-family: inherit; font-size: 14px;
  outline: none; transition: all 0.16s ease; width: 100%; box-sizing: border-box;
}
.adm-field input:focus, .adm-field select:focus { border-color: #39ff14; box-shadow: 0 0 0 3px rgba(57,255,20,0.10); }
.adm-field--full { grid-column: 1 / -1; }
.adm-field--sm input { padding: 8px 10px; font-size: 13px; }
.adm-field--check { flex-direction: row; align-items: center; gap: 10px; }
.adm-field--check input { width: 18px; height: 18px; accent-color: #39ff14; flex-shrink: 0; }
.adm-field--check span { text-transform: none; letter-spacing: 0; color: #ddd; font-weight: 600; font-size: 13px; }

.adm-input-money { display: flex; align-items: center; background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 8px; padding-left: 12px; transition: all 0.16s ease; }
.adm-input-money:focus-within { border-color: #39ff14; box-shadow: 0 0 0 3px rgba(57,255,20,0.10); }
.adm-input-money > span { color: #888; font-size: 14px; font-weight: 700; }
.adm-input-money input { border: none !important; box-shadow: none !important; background: transparent !important; }

.adm-sim-card__out { display: flex; flex-direction: column; gap: 1px; border-top: 1px dashed #2a2a2a; padding-top: 14px; }
.adm-sim-out__costoconv { color: #888; font-size: 12px; margin-bottom: 10px; }
.adm-sim-out__costoconv strong { color: #4dabff; }
.adm-sim-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px;
}
.adm-sim-row__label { color: #bbb; font-size: 13px; }
.adm-sim-row__val { color: #fff; font-size: 15px; font-weight: 800; font-variant-numeric: lining-nums tabular-nums; text-align: right; }
.adm-sim-row__conv { display: block; color: #4dabff; font-size: 11px; font-weight: 600; margin-top: 2px; }
.adm-sim-row--bruta { background: rgba(255,255,255,0.03); margin-bottom: 6px; }
.adm-sim-row--bruta .adm-sim-row__val { color: #39ff14; }
.adm-sim-row--personal { background: rgba(57,255,20,0.06); border: 1px solid rgba(57,255,20,0.20); margin-top: 6px; }
.adm-sim-row--personal .adm-sim-row__val { color: #39ff14; }
.adm-sim-row--personal .adm-sim-row__conv { color: #ffd700; }
.adm-sim-row--neg .adm-sim-row__val { color: #ff5050; }

/* Config simulador */
.adm-sim__config { background: #0d0d0d; border: 1px solid #1f1f1f; border-radius: 12px; overflow: hidden; }
.adm-sim__config > summary {
  padding: 14px 18px; cursor: pointer; color: #ccc; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; list-style: none; -webkit-user-select: none; user-select: none;
}
.adm-sim__config > summary::-webkit-details-marker { display: none; }
.adm-sim__config > summary:hover { background: rgba(255,255,255,0.02); }
.adm-sim__config > summary i { color: #39ff14; }
.adm-sim__config-body { padding: 0 18px 18px; border-top: 1px solid #1f1f1f; }
.adm-sim-cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 18px 0; }
.adm-sim-cfg-col h4 { color: #39ff14; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 12px; }
.adm-sim-cfg-col .adm-field { margin-bottom: 10px; }
.adm-sim-cfg-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid #1f1f1f; }

/* ═══════════════ MODALES ═══════════════ */
.adm-modal {
  /* Sobre #dashPro (100000) — antes empataba y dependia del orden en el DOM */
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: adm-fade 0.16s ease;
}
@keyframes adm-fade { from { opacity: 0; } to { opacity: 1; } }
.adm-modal__box {
  background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 16px;
  width: 100%; max-width: 540px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(57,255,20,0.10);
  animation: adm-slide 0.2s cubic-bezier(.16,1,.3,1);
}
@keyframes adm-slide { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.adm-modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid #1f1f1f;
}
.adm-modal__title { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 10px; }
.adm-modal__title i { color: #39ff14; }
.adm-modal__close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid #2a2a2a; color: #aaa;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.15s ease;
}
.adm-modal__close:hover { color: #fff; border-color: #ff5050; background: rgba(255,80,80,0.10); }
.adm-modal__body { padding: 20px; }
.adm-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid #1f1f1f; }

.adm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-stock-preview { margin-top: 14px; padding: 12px 14px; background: rgba(57,255,20,0.04); border: 1px solid rgba(57,255,20,0.18); border-radius: 8px; color: #ddd; font-size: 13px; }
.adm-stock-preview strong { color: #39ff14; font-size: 15px; }

.adm-code {
  background: #000; border: 1px solid #1f1f1f; border-radius: 8px;
  padding: 14px; color: #39ff14; font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .adm-sim__grid { grid-template-columns: 1fr; }
  .adm-sim-cfg-grid { grid-template-columns: 1fr; gap: 18px; }
  .adm-ventas__resumen { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .adm__hero { flex-direction: column; align-items: flex-start; }
  .adm__tab span { display: none; }
  .adm__tab i { font-size: 16px; }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-sim-card__inputs { grid-template-columns: 1fr; }
}
