/* Ruta: /home/mjbixbia/profesuite.rocasupport.com/assets/estilos.css */

:root {
  --card: #ffffff;
  --brand: #1d4ed8;        /* azul puro — color de marca definitivo de Profesuite */
  --brand-dark: #1e40af;   /* azul oscuro, hover/estados activos */
  --brand-light: #dbeafe;  /* azul suave, fondos tenues */
  --navy: #0f172a;         /* fondo del sidebar — consistente con el resto del ecosistema CTP */
  --accent: #f59e0b;       /* ámbar — reservado para créditos/tokens */
  --accent-soft: #fef3c7;
  --text-mute: #6b6560;
  --bg-app: #fafaf9;
  --ink: #1c1917;
  --line: #e7e4e1;
  --danger: #dc2626;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg-app);
  color: var(--ink);
  font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6, .fw-semibold, .fw-bold {
  font-family: var(--font-display);
}

/* fondo oscurecido de pantalla completa */
.modal-fondo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-fondo.activo {
  display: flex;
}

/* la caja blanca del modal en sí */
.modal-caja {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-caja .modal-titulo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -1.5rem -1.5rem 1.25rem;
  padding: 1.1rem 1.5rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line, #e7e4e1);
  border-radius: 14px 14px 0 0;
}
.modal-caja .modal-cerrar {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 20px;
  cursor: pointer;
}

/* boton "+ Nuevo" arriba a la derecha */
.btn-nuevo {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-nuevo:hover {
  color: #fff;
  opacity: 0.92;
}

/* etiqueta pequeña sobre cada input dentro del modal */
.campo-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 4px;
}

/* Botones y elementos Bootstrap reteñidos con la marca */
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}
.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline-primary:hover {
  background-color: var(--brand);
  border-color: var(--brand);
}
a { color: var(--brand); }
.nav-tabs .nav-link.active {
  color: var(--brand);
  border-bottom: 2px solid var(--brand);
  font-weight: 600;
}
.card {
  border: 1px solid #e9edf0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

/* Card con acento de color — arriba (secciones de ancho completo) o a
   la izquierda (ítems comparables dentro de un mismo grupo, como una
   lista de preguntas por estado). El color se define con las clases
   .acento-* de abajo, compartidas entre ambas orientaciones. */
.card-acento-superior { border-top: 4px solid var(--acento-color, var(--brand)); }
.card-acento-izquierda { border-left: 4px solid var(--acento-color, var(--brand)); }

.acento-rojo   { --acento-color: #ef4444; }
.acento-teal   { --acento-color: #14b8a6; }
.acento-sky    { --acento-color: #3b82f6; }
.acento-amber  { --acento-color: #f59e0b; }
.acento-slate  { --acento-color: #94a3b8; }
.acento-indigo { --acento-color: var(--brand); }
.acento-emerald { --acento-color: #10b981; }
.acento-orange  { --acento-color: #f97316; }

/* Punto de color pequeño — para etiquetar visualmente un tipo de ítem
   junto a su nombre (ej. en el título de una sección colapsable),
   reutilizando el mismo --acento-color de las clases .acento-*. */
.acento-punto {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acento-color, var(--brand));
  margin-right: 6px;
  vertical-align: middle;
}

/* Flecha de secciones colapsables — rota al abrir, con transición
   suave, para que quede claro que hay más contenido debajo. */
.chevron-colapsable {
  transition: transform 0.2s ease;
  color: var(--text-mute);
}
.chevron-colapsable.abierto {
  transform: rotate(90deg);
  color: var(--brand);
}
.seccion-colapsable-header {
  padding: 6px 8px;
  margin: -6px -8px 2px;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.seccion-colapsable-header:hover {
  background: var(--bg-app);
}

/* =====================================================================
   Botones de acción pequeños (ver / editar / eliminar) — redondeados,
   con color propio según la acción, en vez del estilo genérico de
   Bootstrap. Pensados para filas de tabla o listas de tarjetas.
   ===================================================================== */
.btn-accion {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-accion:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}
.btn-accion-ver { background: #dbeafe; color: #1d4ed8; }
.btn-accion-ver:hover { background: #bfdbfe; color: #1e40af; }
.btn-accion-editar { background: var(--brand-light); color: var(--brand-dark); }
.btn-accion-editar:hover { background: #c7d2fe; color: var(--brand-dark); }
.btn-accion-eliminar { background: #fee2e2; color: #b91c1c; }
.btn-accion-eliminar:hover { background: #fecaca; color: #991b1b; }

.btn-accion-lote {
  font-weight: 700;
  border: none;
  color: #fff;
  padding: 7px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.btn-accion-lote.aprobar { background: #059669; }
.btn-accion-lote.aprobar:hover { background: #047857; color: #fff; }
.btn-accion-lote.descartar { background: #dc2626; }
.btn-accion-lote.descartar:hover { background: #b91c1c; color: #fff; }

/* Badges suaves — alternativa a los bg-secondary/bg-dark genéricos de
   Bootstrap para estados como "borrador" / "finalizada". */
.badge-suave {
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
}
.badge-suave.slate  { background: #f1f5f9; color: #475569; }
.badge-suave.verde  { background: #d1fae5; color: #065f46; }
.badge-suave.amber  { background: #fef3c7; color: #92400e; }
.badge-suave.rojo   { background: #fee2e2; color: #991b1b; }

/* Tablas dentro de una card: más aire entre filas y una línea sutil,
   en vez del borde denso por defecto de Bootstrap. */
.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
}
.table thead th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  border-bottom-width: 1px;
}

/* =====================================================================
   Layout general con sidebar (módulo docente)
   ===================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.app-sidebar .app-brand {
  padding: 20px 20px 16px;
  font-weight: 700;
  font-size: 17px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.app-sidebar .app-brand .app-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-sidebar .app-brand .app-brand-mark i {
  font-size: 17px;
  color: #fff;
}
.app-sidebar nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.app-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.78);
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-sidebar .nav-link i {
  font-size: 18px;
  flex-shrink: 0;
}
.app-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.app-sidebar .nav-link.activo {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--accent);
}
.app-sidebar .app-usuario {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.app-sidebar .app-usuario .nombre {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sidebar .app-usuario a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  text-decoration: none;
}
.app-sidebar .app-usuario a:hover {
  color: #fff;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  display: none;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e9edf0;
}
.app-content {
  padding: 24px 28px 60px;
  flex: 1;
}

.app-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 30, 0.5);
  z-index: 1040;
}
.app-sidebar-overlay.activo {
  display: block;
}

@media (max-width: 900px) {
  .app-topbar {
    display: flex;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    z-index: 1050;
    transition: left 0.2s ease;
  }
  .app-sidebar.abierto {
    left: 0;
  }
  .app-content {
    padding: 18px 16px 50px;
  }
}

/* =====================================================================
   Stepper de pasos (ej. tabla de especificación)
   ===================================================================== */
.stepper {
  display: flex;
  align-items: flex-start;
}
.stepper-paso {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.stepper-circulo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.stepper-paso.completo .stepper-circulo {
  background: var(--brand-light);
  color: var(--brand);
}
.stepper-paso.activo .stepper-circulo {
  background: var(--brand);
  color: #fff;
}
.stepper-paso.activo .stepper-etiqueta {
  color: var(--brand);
  font-weight: 600;
}
.stepper-etiqueta {
  font-size: 12px;
  white-space: nowrap;
  text-align: center;
}
.stepper-linea {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 15px 10px 0;
  min-width: 24px;
}

/* Un color propio por paso — el mismo tono se repite en el botón
   principal de ese paso, para que la asociación visual sea clara. */
.stepper-paso[data-paso="1"].activo .stepper-circulo { background: #3b82f6; color: #fff; }
.stepper-paso[data-paso="1"].completo .stepper-circulo { background: #dbeafe; color: #1d4ed8; }
.stepper-paso[data-paso="1"].activo .stepper-etiqueta { color: #3b82f6; font-weight: 600; }

.stepper-paso[data-paso="2"].activo .stepper-circulo { background: #f59e0b; color: #fff; }
.stepper-paso[data-paso="2"].completo .stepper-circulo { background: #fef3c7; color: #92400e; }
.stepper-paso[data-paso="2"].activo .stepper-etiqueta { color: #f59e0b; font-weight: 600; }

.stepper-paso[data-paso="3"].activo .stepper-circulo { background: #14b8a6; color: #fff; }
.stepper-paso[data-paso="3"].completo .stepper-circulo { background: #ccfbf1; color: #0f766e; }
.stepper-paso[data-paso="3"].activo .stepper-etiqueta { color: #14b8a6; font-weight: 600; }

.btn-paso1 { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.btn-paso1:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-paso2 { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-paso2:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-paso2:disabled { background: #fde68a; border-color: #fde68a; opacity: 0.7; }
.btn-paso3 { background: #14b8a6; border-color: #14b8a6; color: #fff; }
.btn-paso3:hover { background: #0d9488; border-color: #0d9488; color: #fff; }

/* =====================================================================
   Estado vacío (cuando una lista todavía no tiene nada)
   ===================================================================== */
.estado-vacio {
  text-align: center;
  padding: 48px 20px;
}
.estado-vacio .icono {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
}
.estado-vacio p.titulo {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}
.estado-vacio p.descripcion {
  color: var(--text-mute);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 16px;
}

/* archivo: assets/estilos.css, reemplaza el bloque que agregamos antes */
.app-main {
  transform: translateZ(0);
  will-change: transform;
}

/* =====================================================================
   Componentes reutilizables del rediseño (usados a partir del paso 2:
   sistema de créditos, grid de módulos, KPIs)
   ===================================================================== */
.credit-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
}
.credit-pill .coin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #78350f;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.credit-pill .amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.credit-pill .lbl {
  font-size: 10.5px;
  color: var(--text-mute);
}

.grid-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.module-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--module-accent, var(--brand));
  border-radius: 8px;
  padding: 18px;
  display: flex;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.module-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: inherit;
}
.module-card .module-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--module-accent-soft, var(--brand-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.module-card h3 {
  font-size: 14.5px;
  margin: 0 0 4px;
  font-weight: 700;
}
.module-card p {
  font-size: 12.5px;
  color: var(--text-mute);
  margin: 0;
}
.module-card .module-badge {
  margin-left: auto;
  align-self: flex-start;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}
.kpi .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 2px;
}
.kpi .lbl {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0;
}
.kpi.teal .num { color: var(--brand-dark); }
.kpi.amber .num { color: #b45309; }

/* Variante "full color" — fondo pastel completo, como los KPI del
   sistema de inventario. Cada tarjeta lleva un color de tema propio,
   dentro de la paleta de Profesuite. */
.kpi-full {
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid transparent;
  transition: transform .15s ease;
}
.kpi-full:hover {
  transform: translateY(-1px);
  color: inherit;
}
.kpi-full .kpi-full-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 21px;
}
.kpi-full .num {
  font-size: 28px;
  margin: 0;
}
.kpi-full .lbl {
  font-size: 12.5px;
  margin: 0;
  opacity: 0.85;
}

.kpi-full.tema-teal { background: #ccfbf1; }
.kpi-full.tema-teal .num, .kpi-full.tema-teal .kpi-full-icon i { color: #0f766e; }
.kpi-full.tema-teal { border-left-color: #14b8a6; }

.kpi-full.tema-sky { background: #dbeafe; }
.kpi-full.tema-sky .num, .kpi-full.tema-sky .kpi-full-icon i { color: #1d4ed8; }

.kpi-full.tema-amber { background: #fef3c7; }
.kpi-full.tema-amber .num, .kpi-full.tema-amber .kpi-full-icon i { color: #92400e; }

.kpi-full.tema-rose { background: #fee2e2; }
.kpi-full.tema-rose .num, .kpi-full.tema-rose .kpi-full-icon i { color: #b91c1c; }

.kpi-full.tema-slate { background: #e2e8f0; }
.kpi-full.tema-slate .num, .kpi-full.tema-slate .kpi-full-icon i { color: #334155; }
.kpi-full.tema-slate { border-left-color: #94a3b8; }

.kpi-full.tema-sky { border-left-color: #3b82f6; }
.kpi-full.tema-amber { border-left-color: #f59e0b; }
.kpi-full.tema-rose { border-left-color: #ef4444; }

/* Botón pastel — más suave que btn-outline-primary (teal), para
   acciones secundarias como los accesos rápidos del panel. */
.btn-pastel {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 13.5px;
}
.btn-pastel:hover, .btn-pastel:focus {
  background: #cbd5e1;
  border-color: #94a3b8;
  color: #1e293b;
}