/* ─────────────────────────────────────────────────────────────────
 * erp-landing.css · Eligentia v8
 * Estilos especificos del landing del ERP (/erp.html).
 * Usa tokens.css, base.css, layout.css, components.css existentes.
 * No re-declara variables — solo las consume.
 * ───────────────────────────────────────────────────────────────── */

body.erp-landing {
  /* 2026-06-06: Fondo sala de control (imagen oscura) con overlay para
   * mantener contraste de los cards blancos que flotan encima.
   * El attachment fixed mantiene la imagen quieta al hacer scroll. */
  background:
    linear-gradient(rgba(10, 18, 35, 0.55), rgba(10, 18, 35, 0.75)),
    url('../img/fondoERP.jpg') center center / cover no-repeat fixed,
    #0A1223;
  min-height: 100vh;
  color: #e8eef7;
}

/* ─── Wrapper principal ─── */
.erp-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
}

.erp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-bottom: 14px;
  transition: color var(--t-fast);
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
}
.erp-back:hover { color: #fff; background: rgba(255,255,255,0.15); text-decoration: none; }
.erp-back svg  { width: 14px; height: 14px; }

/* ─── Hero ─── */
.erp-hero {
  text-align: center;
  margin-bottom: 32px;
  padding: 36px 20px 28px;
  /* sin background — deja ver la imagen detras */
}
.erp-hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(28px, 4vw, 42px);
  color: #ffffff;
  letter-spacing: -.01em;
  margin: 0 0 10px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.5);
}
.erp-hero .erp-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 20px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.erp-hero .erp-empresa-line {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background: rgba(15, 25, 45, 0.65);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
.erp-hero .erp-empresa-line strong { font-weight: 700; color: #ffffff; }
.erp-hero .erp-empresa-line .erp-rol-chip {
  padding: 2px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── P5 (2026-06-08): selector de espacio + pill de tipo ─── */
.erp-hero .erp-empresa-line .erp-espacio-select {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 4px 26px 4px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  /* Custom chevron arrow */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.erp-hero .erp-empresa-line .erp-espacio-select:hover {
  background-color: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.erp-hero .erp-empresa-line .erp-espacio-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 99, 102, 241), 0.4);
}
.erp-hero .erp-empresa-line .erp-espacio-select option {
  /* Las opciones se muestran con el estilo nativo del browser; en dark mode
     puede tener mejor contraste. Forzamos color seguro. */
  background: #1f2937;
  color: #ffffff;
}
.erp-hero .erp-empresa-line .erp-tipo-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
}

/* ─── Seccion (grupo de modulos) ─── */
.erp-section {
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
}
.erp-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  border-left: 4px solid var(--seccion-color, var(--accent));
}
.erp-section-icon {
  font-size: 22px;
  line-height: 1;
}
.erp-section-titles { flex: 1; }
.erp-section-titles h2 {
  font-family: var(--ff-display);
  font-size: 18px;
  margin: 0 0 2px;
  color: var(--gray-900);
}
.erp-section-titles .erp-section-desc {
  font-size: 12px;
  color: var(--gray-600);
  margin: 0;
}
.erp-section-count {
  font-size: 12px;
  color: var(--gray-500);
  padding: 2px 10px;
  background: var(--gray-100);
  border-radius: 999px;
}

/* ─── Grid de cards de modulo ─── */
.erp-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

/* 2026-06-06 v3: cada card = main button (titulo + desc) + actions (3 botones) */
.erp-module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  transition: all var(--t-fast, 150ms) ease;
  position: relative;
}
.erp-module-card:hover {
  background: #fff;
  border-color: var(--seccion-color, var(--accent));
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.erp-module-main {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  color: inherit;
}
.erp-module-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.erp-module-id {
  font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--gray-500);
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.erp-module-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
  margin: 0 0 4px;
  line-height: 1.25;
}
.erp-module-desc {
  font-size: 12.5px;
  /* 2026-06-08: contraste subido — gray-600 se confundía con el fondo de la card */
  color: var(--gray-800, #1f2937);
  line-height: 1.45;
  font-weight: 500;
}
/* En hover, la card cambia a fondo blanco. El texto sigue legible. */
.erp-module-card:hover .erp-module-desc {
  color: var(--gray-900, #111827);
}

/* ──────────────────────────────────────────────────────────────
   2026-06-07 O8: estado LOCKED (modulo no incluido en el plan)
   ────────────────────────────────────────────────────────────── */
.erp-module-card--locked {
  opacity: 0.62;
  background: repeating-linear-gradient(
    135deg,
    var(--gray-50) 0,
    var(--gray-50) 8px,
    var(--gray-100) 8px,
    var(--gray-100) 16px
  );
  border-style: dashed;
}
.erp-module-card--locked:hover {
  opacity: 0.85;
  border-color: #b07a00;
  box-shadow: 0 4px 12px rgba(176,122,0,0.18);
}
.erp-module-main--locked {
  cursor: pointer;     /* sigue clickeable para llevar a /upgrade */
}
.erp-module-card--locked .erp-module-title,
.erp-module-card--locked .erp-module-desc {
  color: var(--gray-500);
}
.erp-lock-icon {
  font-size: 11px;
  margin-left: 4px;
}
.erp-module-upgrade-hint {
  margin-top: 4px;
  font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #b07a00;
  letter-spacing: .04em;
}

/* ── Action buttons row (Ayuda / Auto Demo / Video) ── */
.erp-module-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.erp-mb {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font: 600 11px var(--ff-body, system-ui);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.erp-mb span { overflow: hidden; text-overflow: ellipsis; }
.erp-mb:hover {
  background: var(--seccion-color, var(--accent));
  color: #fff;
  border-color: var(--seccion-color, var(--accent));
}
.erp-mb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.erp-mb-help:hover    { background: #4F46E5; border-color: #4F46E5; }
.erp-mb-demo:hover    { background: #10b981; border-color: #10b981; }
.erp-mb-video:hover   { background: #f59e0b; border-color: #f59e0b; }

/* ── Help modal ── */
.erp-help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 35, 0.75);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.erp-help-backdrop.open { display: flex; }
.erp-help-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,0.4);
}
.erp-help-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.erp-help-head h2 {
  flex: 1;
  margin: 0;
  font-family: var(--ff-display);
  font-size: 18px;
  color: var(--gray-900);
}
.erp-help-close {
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--gray-700);
  display: inline-flex;
}
.erp-help-close:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.erp-help-content {
  padding: 20px 22px 26px;
  overflow: auto;
  flex: 1;
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.55;
}
.erp-help-summary {
  font-size: 15px;
  font-style: italic;
  color: var(--gray-700);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--gray-200);
}
.erp-help-section {
  margin-bottom: 18px;
}
.erp-help-section h3 {
  font-family: var(--ff-display);
  font-size: 15px;
  color: var(--gray-900);
  margin: 0 0 6px;
}
.erp-help-section .erp-help-body {
  color: var(--gray-700);
}

/* ── Toast minimalista ── */
.erp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 11000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  max-width: 480px;
  text-align: center;
}
.erp-toast[data-visible="1"] { opacity: 1; pointer-events: auto; cursor: pointer; }
.erp-toast[data-kind="warn"] { background: #b06a1f; }
.erp-toast[data-kind="success"] { background: #16a34a; }
.erp-toast[data-kind="error"] { background: #b91c1c; }

/* ─── Footer dev only ─── */
.erp-dev-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dashed rgba(255,255,255,0.2);
}
.erp-dev-footer-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.erp-dev-footer-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.erp-dev-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all var(--t-fast);
  backdrop-filter: blur(6px);
}
.erp-dev-link:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}
.erp-dev-link::before {
  content: '🛠';
  font-size: 12px;
}

/* ─── Modal full-screen para abrir un CRUD ─── */
.erp-crud-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9000;
  display: none;
  align-items: stretch;
  justify-content: stretch;
}
.erp-crud-modal-backdrop.open {
  display: flex;
}
.erp-crud-modal {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.erp-crud-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.erp-crud-modal-head h2 {
  flex: 1;
  font-size: 16px;
  margin: 0;
  color: var(--gray-900);
}
.erp-crud-modal-close {
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-700);
}
.erp-crud-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.erp-crud-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

/* ─── Loading / Empty states ─── */
.erp-loading,
.erp-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-600);
  font-size: 14px;
}
.erp-error {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .erp-hero h1 { font-size: 22px; }
  .erp-modules-grid { grid-template-columns: 1fr; }
  .erp-section-head { flex-wrap: wrap; }
}

/* ============================================================
 * Sprint PB.6 v3 FIX (2026-06-10) - Legibilidad cards locked
 * El opacity 0.62 + color gray-500 sobre patrón de rayas hacia
 * el texto ilegible. Fix: opacity 1, contenido más contrastado,
 * patrón más sutil. Heads-up visual sigue claro (candado + dashed + tint ámbar).
 * ============================================================ */

.erp-module-card--locked {
  opacity: 1;                      /* antes 0.62 — ilegible */
  background: repeating-linear-gradient(
    135deg,
    rgba(245, 245, 240, 0.85) 0,
    rgba(245, 245, 240, 0.85) 10px,
    rgba(232, 232, 226, 0.5) 10px,
    rgba(232, 232, 226, 0.5) 20px
  );
  border-style: dashed;
  border-color: #d4a857;            /* borde ámbar suave para señalar locked */
}
.erp-module-card--locked:hover {
  opacity: 1;
  border-color: #b07a00;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 248, 230, 0.95) 0,
    rgba(255, 248, 230, 0.95) 10px,
    rgba(248, 235, 200, 0.7) 10px,
    rgba(248, 235, 200, 0.7) 20px
  );
  box-shadow: 0 4px 12px rgba(176, 122, 0, 0.18);
}
.erp-module-card--locked .erp-module-id {
  color: rgba(176, 122, 0, 0.85);   /* ID en ámbar fuerte */
}
.erp-module-card--locked .erp-module-title {
  color: #4a3c1d;                   /* título oscuro legible */
  opacity: 1;
}
.erp-module-card--locked .erp-module-desc {
  color: #6b5a35;                   /* descripción ámbar oscuro */
  opacity: 1;
}
.erp-module-card--locked .erp-lock-icon {
  font-size: 13px;
  margin-left: 6px;
  opacity: 1;
}
