/*
 * Hoja de estilos corporativa DITAR - G-NESYS
 * Diseño unificado: Lito, Rollos Térmicos y Formas Continuas.
 */

:root {
  /* Colores corporativos principales derivados del logotipo DITAR */
  --primary-color: #293d66;      /* Azul Oxford (principal) */
  --secondary-color: #18527b;    /* Azul intermedio (hover/acciones) */
  --accent-success: #10b981;     /* Verde Esmeralda (Guardar/Éxito) */
  --primary-ring: rgba(41, 61, 102, 0.2); /* Halo de enfoque para inputs */

  /* Paleta del Panel de Resumen (Escandallos) - Tema Claro Empresarial */
  --summary-bg-top: #ffffff;
  --summary-bg-bottom: #f8fafc;
  --summary-text: #1e293b;       /* slate-800 */
  --summary-muted: #64748b;      /* slate-500 */
  --summary-divider: #e2e8f0;    /* slate-200 */
  --summary-accent: #293d66; 
  --summary-card: #ffffff;
  --summary-card-strong: #f8fafc;
  --app-bg-image-light: url('FONDO.jpg');
  --app-bg-image-dark: url('FONDO MODO OSCURO.jpg'), url('FONDO.jpg');
}

/* =========================================================
   Fondo Global de la Aplicación (App Bg)
   ========================================================= */
.app-bg {
  background-color: #f8fafc;
  position: relative;
  isolation: isolate;
}

.app-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  /* Imagen corporativa de fondo */
  background-image: var(--app-bg-image-light);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: -1;
  pointer-events: none;
}

/* =========================================================
   Pantalla de Inicio de Sesion (Auth)
   ========================================================= */
#auth-screen {
  background-color: #081b45;
  background-image: url('FONDO MODO OSCURO.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-shell {
  position: relative;
  border: 1px solid rgba(154, 180, 230, 0.28);
  background: rgba(11, 28, 67, 0.92);
  box-shadow: 0 24px 44px -24px rgba(3, 10, 28, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-shell::before {
  content: none;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.65rem;
}

.auth-logo {
  width: min(220px, 72vw);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.18));
}

.auth-form {
  position: relative;
  z-index: 1;
}

.auth-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #1f3665 !important;
  background: #071a45 !important;
  color: #d7e4ff !important;
  font-size: 1.02rem;
  line-height: 1.3;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input::placeholder {
  color: #9cb0d7 !important;
}

.auth-input:focus {
  border-color: #3a5a96 !important;
  box-shadow: 0 0 0 3px rgba(36, 63, 112, 0.2) !important;
  background: #0a214f !important;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.15rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #d6e3ff;
  font-size: 0.94rem;
  font-weight: 500;
}

.auth-check input {
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 0.2rem;
  accent-color: #293d66;
}

.auth-link {
  border: 0;
  background: transparent;
  color: #9eb9f2;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.auth-link:hover {
  text-decoration: underline;
  color: #c8dcff;
}

.auth-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #334b79 0%, #293d66 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 30px -16px rgba(41, 61, 102, 0.42);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #3a5a8f 0%, #18527b 100%);
  box-shadow: 0 22px 34px -16px rgba(24, 82, 123, 0.44);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.2rem;
  color: #8ea7d9;
  font-size: 0.92rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(143, 170, 220, 0) 0%, rgba(143, 170, 220, 0.62) 100%);
}

.auth-divider::after {
  background: linear-gradient(90deg, rgba(143, 170, 220, 0.62) 0%, rgba(143, 170, 220, 0) 100%);
}

.auth-create {
  margin: 0.25rem 0 0 0;
  text-align: center;
  color: #cfddfa;
  font-size: 1.05rem;
}

.auth-create button {
  border: 0;
  background: transparent;
  color: #8fb4ff;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.auth-create button:hover {
  color: #bbd2ff;
  text-decoration: underline;
}

.auth-hint {
  margin-top: 0.25rem;
  text-align: center;
  font-size: 0.73rem;
  color: #8ea7cf;
}

.auth-hint b {
  color: #d7e7ff;
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 1.5rem 1.15rem;
    border-radius: 1.5rem;
  }

  .auth-submit {
    font-size: 1.02rem;
  }

  .auth-check,
  .auth-link {
    font-size: 0.85rem;
  }

  .auth-create {
    font-size: 0.98rem;
  }
}

/* =========================================================
   Paneles de Resumen (Summary Panel) - Mejora Progresiva
   ========================================================= */
/* El HTML ya controla la mayoría de colores con Tailwind, 
   esto añade el degradado sutil y la sombra corporativa */
.summary-panel {
  background: linear-gradient(180deg, var(--summary-bg-top), var(--summary-bg-bottom));
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* =========================================================
   Utilidades y Correcciones Globales
   ========================================================= */
/* Ocultar las flechas (spinners) en los inputs de tipo número para un look más limpio */
.no-spinner::-webkit-inner-spin-button, 
.no-spinner::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

.no-spinner {
  -moz-appearance: textfield;
}

/* Transiciones suaves para botones interactivos (Poka-yoke y toggles) */
.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

/* =========================================================
   Barra superior de acciones (toolbar compacta)
   ========================================================= */
.top-actions-wrap {
  display: flex;
  justify-content: flex-end;
}

.top-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.55);
}

.top-action-item {
  border: 0;
  background: transparent;
  color: #2c4265;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border-radius: 10px;
  padding: 0.58rem 0.78rem;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.top-action-item:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.top-action-item i,
.top-action-item svg {
  color: #5a739a;
}

.top-action-item:hover {
  background: rgba(41, 61, 102, 0.12);
  color: #1f3356;
}

.top-action-item:focus-visible {
  outline: 2px solid rgba(41, 61, 102, 0.35);
  outline-offset: 1px;
}

.top-action-divider {
  width: 1px;
  height: 24px;
  background: rgba(100, 116, 139, 0.35);
  margin: 0 0.2rem;
}

.top-action-logout {
  color: #b42337;
}

.top-action-logout i,
.top-action-logout svg {
  color: #d84a5d;
}

.top-action-logout:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #8d1322;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  max-width: 290px;
}

.user-menu-avatar {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3fb;
  color: #3a547c;
}

.user-menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 185px;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 240px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 28px -18px rgba(15, 23, 42, 0.45);
  padding: 0.7rem;
  z-index: 35;
}

.user-menu-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #233a5f;
  margin: 0;
}

.user-menu-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin: 0.2rem 0 0.55rem;
}

.user-menu-logout {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.58rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.84rem;
  font-weight: 800;
  color: #b42337;
  background: rgba(220, 38, 38, 0.08);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.user-menu-logout:hover {
  background: rgba(220, 38, 38, 0.16);
  color: #8d1322;
}

.user-menu-logout i,
.user-menu-logout svg {
  color: #d84a5d;
}

@media (max-width: 1080px) {
  .top-actions-wrap {
    width: 100%;
  }

  .top-actions-bar {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .top-actions-bar {
    gap: 0.14rem;
    padding: 0.28rem 0.3rem;
  }

  .top-action-item {
    font-size: 0.82rem;
    padding: 0.52rem 0.62rem;
  }

  .top-action-divider {
    display: none;
  }
}
/* ========================================== */
/* ESTILOS: ASISTENTE G-NESYS (COLUMNA ÚNICA) */
/* ========================================== */

.g-nesys-smart-panel {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    font-family: inherit;
    /* Al no poner un width forzado, respeta el ancho natural de tu contenedor principal */
}

.smart-header {
    margin-bottom: 16px;
}

.icon-brain {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.title-text {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 600;
}

.smart-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    resize: none;
    font-size: 1rem;
    color: #475569;
    box-sizing: border-box;
    margin-bottom: 16px;
    font-family: inherit;
}

.smart-textarea:focus {
    outline: none;
    border-color: #10b981;
}

.btn-process {
    background-color: #10b981;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 16px;
    transition: background-color 0.2s;
}

.btn-process:hover {
    background-color: #059669;
}

.smart-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-row {
    font-size: 1rem;
    color: #1e293b;
}

.text-blue { color: #293d66; font-weight: 600; }
.text-green { color: #10b981; font-weight: 600; }

.btn-apply {
    background-color: transparent;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: background-color 0.2s;
}

.btn-apply:hover:not(:disabled) {
    background-color: #f8fafc;
    color: #1e293b;
}

.btn-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================================
   Litografia - Contraste visual y modulos plegables
   ========================================================= */
#lito-module .module-panel {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-color: #dfe7f3;
  box-shadow: 0 10px 24px -24px rgba(15, 23, 42, 0.45), 0 6px 14px -16px rgba(41, 61, 102, 0.32);
}

#lito-module .module-panel .border-b {
  border-color: #e6edf7;
}

#lito-module .module-panel .bg-slate-50,
#lito-module .module-panel .bg-slate-50\/60 {
  background-color: #f7fafe !important;
}

#lito-module .module-panel .rounded-2xl.border {
  border-color: #dce5f2 !important;
}

#lito-module .module-panel input:not([type="checkbox"]):not([type="radio"]),
#lito-module .module-panel select,
#lito-module .module-panel textarea {
  background-color: #fafcff !important;
  border-color: #d9e3f1 !important;
  color: #1f2e46 !important;
}

#lito-module .module-panel .text-slate-400 {
  color: #647992 !important;
}

#lito-module .lito-module-header,
#formas-module .lito-module-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.2rem;
}

#lito-module .lito-collapse-btn,
#formas-module .lito-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid transparent;
  background: transparent;
  color: #6a7f9a;
  font-size: 1.1rem;
  border-radius: 999px;
  padding: 0;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#lito-module .lito-collapse-btn:hover,
#formas-module .lito-collapse-btn:hover {
  background: #eef4fc;
  border-color: #d5e2f3;
  color: #304b76;
}

#lito-module .lito-collapse-btn .lito-collapse-arrow,
#formas-module .lito-collapse-btn .lito-collapse-arrow {
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

#lito-module .lito-collapse-btn[aria-expanded="false"] .lito-collapse-arrow,
#formas-module .lito-collapse-btn[aria-expanded="false"] .lito-collapse-arrow {
  transform: rotate(-90deg);
}

#lito-module .lito-collapsible-body,
#formas-module .lito-collapsible-body {
  margin-top: 0.35rem;
}

#lito-module .lito-collapsible-body.hidden,
#formas-module .lito-collapsible-body.hidden {
  display: none;
}

/* Vista previa corte: piezas con variacion de color para lectura rapida */
#visual-corte {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fd 100%);
}

#visual-corte .cut-piece {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #1f3d67;
  border: 1px solid #8ea7c6;
  background: linear-gradient(180deg, #dceafc 0%, #cbdff8 100%);
}

#visual-corte .cut-piece.cut-piece-alt {
  background: linear-gradient(180deg, #c9ddf9 0%, #b7d1f3 100%);
}

/* =========================================================
   Tema Oscuro (toggle)
   ========================================================= */
body.theme-dark {
  color: #dbe7ff;
  background-color: #0b1220;
}

body.theme-dark.app-bg {
  background-color: #0b1220;
}

body.theme-dark.app-bg::before {
  background-image: var(--app-bg-image-dark);
  opacity: 1;
  filter: none;
}

body.theme-dark.app-bg::after {
  content: none;
}

body.theme-dark .bg-white {
  background-color: #121c2f !important;
}

body.theme-dark .bg-slate-50,
body.theme-dark .bg-slate-50\/60 {
  background-color: #1a2740 !important;
}

body.theme-dark .bg-slate-200 {
  background-color: #1c2a42 !important;
}

body.theme-dark .border-slate-100,
body.theme-dark .border-slate-200,
body.theme-dark .border-slate-300 {
  border-color: #2a3a57 !important;
}

body.theme-dark .text-slate-900,
body.theme-dark .text-slate-800 {
  color: #e6efff !important;
}

body.theme-dark .text-slate-700 {
  color: #cfdcf4 !important;
}

body.theme-dark .text-slate-600 {
  color: #b7c7e2 !important;
}

body.theme-dark .text-slate-500,
body.theme-dark .text-slate-400 {
  color: #8da1bf !important;
}

body.theme-dark input:not([type="checkbox"]):not([type="radio"]),
body.theme-dark select,
body.theme-dark textarea {
  background-color: #101a2c !important;
  border-color: #314665 !important;
  color: #e6efff !important;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #8fa4c3 !important;
}

body.theme-dark option {
  background-color: #101a2c;
  color: #e6efff;
}

body.theme-dark .summary-panel {
  background: linear-gradient(180deg, #141f34 0%, #10192b 100%);
}

body.theme-dark #lito-module .module-panel {
  background: linear-gradient(180deg, #141f34 0%, #111a2c 100%);
  border-color: #2a3a57;
  box-shadow: 0 18px 30px -24px rgba(2, 8, 24, 0.75);
}

body.theme-dark #lito-module .module-panel .bg-slate-50,
body.theme-dark #lito-module .module-panel .bg-slate-50\/60 {
  background-color: #16233a !important;
}

body.theme-dark #lito-module .module-panel .rounded-2xl.border {
  border-color: #304867 !important;
}

body.theme-dark #lito-module .module-panel input:not([type="checkbox"]):not([type="radio"]),
body.theme-dark #lito-module .module-panel select,
body.theme-dark #lito-module .module-panel textarea {
  background-color: #0f1a2c !important;
  border-color: #3a4f71 !important;
  color: #e9f1ff !important;
}

body.theme-dark #lito-module .module-panel input::placeholder,
body.theme-dark #lito-module .module-panel textarea::placeholder {
  color: #91a6c6 !important;
}

body.theme-dark #lito-module .module-panel .text-slate-400,
body.theme-dark #lito-module .module-panel .text-slate-500,
body.theme-dark #lito-module .module-panel .text-slate-600,
body.theme-dark #lito-module .module-panel .text-slate-700,
body.theme-dark #lito-module .module-panel .text-slate-800 {
  color: #cfe0fb !important;
}

body.theme-dark #lito-module .module-panel [class*="text-[#293d66]"] {
  color: #d7e6ff !important;
}

body.theme-dark #lito-module .module-panel [class*="bg-[#293d66]"] {
  background-color: #2d4a75 !important;
}

body.theme-dark #lito-module .lito-collapse-btn:hover,
body.theme-dark #formas-module .lito-collapse-btn:hover {
  background: #1d2b44;
  border-color: #2f4569;
  color: #c8daf7;
}

body.theme-dark #visual-corte {
  background: linear-gradient(180deg, #162338 0%, #111c2e 100%);
}

body.theme-dark #visual-corte .cut-piece {
  color: #e4efff;
  border-color: #3e5b82;
  background: linear-gradient(180deg, #304a70 0%, #233b5d 100%);
}

body.theme-dark #visual-corte .cut-piece.cut-piece-alt {
  background: linear-gradient(180deg, #385680 0%, #294468 100%);
}

body.theme-dark #btn-theme-toggle {
  background-color: #18253c !important;
  color: #d7e5fc !important;
  border-color: #304564 !important;
}

body.theme-dark .top-actions-bar {
  background: rgba(10, 24, 50, 0.82);
  border-color: rgba(87, 120, 167, 0.48);
  box-shadow: 0 16px 22px -18px rgba(2, 8, 24, 0.85);
}

body.theme-dark .top-action-item {
  color: #d2e4ff;
}

body.theme-dark .top-action-item i,
body.theme-dark .top-action-item svg {
  color: #aac7f4;
}

body.theme-dark .top-action-item:hover {
  background: rgba(120, 158, 210, 0.2);
  color: #f1f6ff;
}

body.theme-dark .top-action-divider {
  background: rgba(123, 155, 202, 0.45);
}

body.theme-dark .top-action-logout {
  color: #ffb5bd;
}

body.theme-dark .top-action-logout i,
body.theme-dark .top-action-logout svg {
  color: #ff8f9d;
}

body.theme-dark .top-action-logout:hover {
  background: rgba(239, 68, 68, 0.17);
  color: #ffd8dd;
}

body.theme-dark .user-menu-avatar {
  background: rgba(138, 171, 221, 0.22);
  color: #d8e8ff;
}

body.theme-dark .user-menu-panel {
  background: rgba(12, 27, 52, 0.98);
  border-color: rgba(87, 120, 167, 0.52);
  box-shadow: 0 20px 28px -20px rgba(2, 8, 24, 0.9);
}

body.theme-dark .user-menu-name {
  color: #e7f2ff;
}

body.theme-dark .user-menu-role {
  color: #aac2e4;
}

body.theme-dark .user-menu-logout {
  color: #ffd1d7;
  background: rgba(239, 68, 68, 0.14);
}

body.theme-dark .user-menu-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ffe3e7;
}

body.theme-dark .bg-slate-100 {
  background-color: #172740 !important;
}

/* Evita botones claros residuales en modo oscuro */
body.theme-dark button[class*="bg-white"],
body.theme-dark button[class*="bg-slate-50"],
body.theme-dark button[class*="bg-slate-100"] {
  background-color: #12223a !important;
  border-color: #2f4769 !important;
  color: #d9e9ff !important;
}

body.theme-dark button[class*="bg-white"]:hover,
body.theme-dark button[class*="bg-slate-50"]:hover,
body.theme-dark button[class*="bg-slate-100"]:hover {
  background-color: #1a2f4d !important;
}

/* Selectores/botones activos en verde corporativo */
body.theme-dark #lito-module .arte-btn.bg-\[\#293d66\],
body.theme-dark #formas-module .fc-papel-btn.bg-\[\#293d66\],
body.theme-dark #formas-module .fc-num-btn.bg-\[\#293d66\] {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: #f4fffb !important;
}

body.theme-dark #lito-module .arte-btn.bg-\[\#293d66\]:hover,
body.theme-dark #formas-module .fc-papel-btn.bg-\[\#293d66\]:hover,
body.theme-dark #formas-module .fc-num-btn.bg-\[\#293d66\]:hover {
  background-color: #059669 !important;
}

/* Todos los selects sin glow ni borde verde */
body.theme-dark select,
body.theme-dark #lito-module .module-panel select,
body.theme-dark #thermal-module select,
body.theme-dark #formas-module select {
  border-color: #314665 !important;
  box-shadow: none !important;
}

body.theme-dark #lito-module .module-panel select {
  border-color: #3a4f71 !important;
}

body.theme-dark select:focus,
body.theme-dark #lito-module .module-panel select:focus,
body.theme-dark #thermal-module select:focus,
body.theme-dark #formas-module select:focus {
  border-color: #314665 !important;
  box-shadow: none !important;
  outline: none !important;
}

body.theme-dark #lito-module .module-panel select:focus {
  border-color: #3a4f71 !important;
}

body.theme-dark select:focus-visible,
body.theme-dark #lito-module .module-panel select:focus-visible,
body.theme-dark #thermal-module select:focus-visible,
body.theme-dark #formas-module select:focus-visible {
  box-shadow: none !important;
  outline: none !important;
}

/* =========================================================
   Centro de Solicitudes - Tema Oscuro (alto contraste)
   ========================================================= */
body.theme-dark #cs-module #cs-drawer {
  background: linear-gradient(180deg, #12233d 0%, #0f1d33 100%) !important;
  border-color: #35527a !important;
  box-shadow: 0 24px 38px -24px rgba(2, 8, 24, 0.85);
}

body.theme-dark #cs-module .bg-white {
  background-color: #112039 !important;
}

body.theme-dark #cs-module .bg-slate-50,
body.theme-dark #cs-module .bg-slate-50\/40,
body.theme-dark #cs-module .bg-slate-50\/60 {
  background-color: #162840 !important;
}

body.theme-dark #cs-module .border-slate-100,
body.theme-dark #cs-module .border-slate-200,
body.theme-dark #cs-module .border-slate-300 {
  border-color: #335076 !important;
}

body.theme-dark #cs-module #cs_search,
body.theme-dark #cs-module #cs_filter_estado {
  background-color: #0e1c32 !important;
  border-color: #3a5a83 !important;
  color: #e7f1ff !important;
}

body.theme-dark #cs-module #cs_search::placeholder {
  color: #9bb1d3 !important;
}

body.theme-dark #cs-module #cs_search:focus,
body.theme-dark #cs-module #cs_filter_estado:focus {
  border-color: #6f95cc !important;
  box-shadow: 0 0 0 2px rgba(111, 149, 204, 0.22) !important;
}

body.theme-dark #cs-module #cs_btn_new {
  background: linear-gradient(180deg, #3a5f93 0%, #2c4a75 100%) !important;
  border: 1px solid #5275a8 !important;
  color: #f1f7ff !important;
}

body.theme-dark #cs-module #cs_btn_new:hover {
  background: linear-gradient(180deg, #436ca5 0%, #355887 100%) !important;
}

body.theme-dark #cs-module #cs_list {
  background: linear-gradient(180deg, rgba(11, 21, 38, 0.45) 0%, rgba(9, 18, 33, 0.68) 100%);
}

body.theme-dark #cs-module .cs-row-item {
  background: #102039 !important;
  border-color: #345178 !important;
}

body.theme-dark #cs-module .cs-row-item:hover {
  background: #172b49 !important;
  border-color: #4a6b9a !important;
}

body.theme-dark #cs-module .cs-row-item.cs-row-selected {
  background: linear-gradient(180deg, #1d3353 0%, #1a2e4b 100%) !important;
  border-color: #6c92cb !important;
  box-shadow: 0 0 0 1px rgba(108, 146, 203, 0.35), 0 10px 18px -16px rgba(2, 8, 24, 0.9) !important;
}

body.theme-dark #cs-module .cs-row-item .text-slate-800,
body.theme-dark #cs-module .cs-row-item .text-slate-700 {
  color: #e6efff !important;
}

body.theme-dark #cs-module .cs-row-item .text-slate-600,
body.theme-dark #cs-module .cs-row-item .text-slate-500 {
  color: #afc3e0 !important;
}

body.theme-dark #cs-module .cs-row-item .border-slate-200.bg-white {
  background-color: #1a2f4d !important;
  border-color: #3f5f8c !important;
  color: #d5e4fb !important;
}

body.theme-dark #cs-module .border-blue-200.bg-blue-50 {
  border-color: #3b6292 !important;
  background: rgba(59, 130, 246, 0.22) !important;
  color: #c7e0ff !important;
}

body.theme-dark #cs-module .border-amber-200.bg-amber-50 {
  border-color: #7c5b20 !important;
  background: rgba(245, 158, 11, 0.2) !important;
  color: #ffe4a8 !important;
}

body.theme-dark #cs-module .border-indigo-200.bg-indigo-50 {
  border-color: #4a4f9b !important;
  background: rgba(99, 102, 241, 0.22) !important;
  color: #d5d8ff !important;
}

body.theme-dark #cs-module .border-sky-200.bg-sky-50 {
  border-color: #2f6f9c !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #c6ecff !important;
}

body.theme-dark #cs-module .border-emerald-200.bg-emerald-50 {
  border-color: #2e6f58 !important;
  background: rgba(16, 185, 129, 0.2) !important;
  color: #bffbe4 !important;
}

body.theme-dark #cs-module .border-slate-200.bg-slate-100 {
  border-color: #436082 !important;
  background: rgba(71, 98, 133, 0.24) !important;
  color: #d3e1f4 !important;
}

body.theme-dark #cs-module #cs_summary > .rounded-xl {
  background: #111f36 !important;
  border-color: #35527a !important;
}

body.theme-dark #cs_context_menu {
  background: #11233d !important;
  border-color: #3e628f !important;
  box-shadow: 0 22px 34px -20px rgba(2, 8, 24, 0.9);
}

body.theme-dark #cs_context_menu button {
  color: #d7e6ff !important;
}

body.theme-dark #cs_context_menu button:hover {
  background: #1a3254 !important;
}

body.theme-dark #cs_form_modal .mx-auto,
body.theme-dark #cs_flow_modal .mx-auto {
  background: linear-gradient(180deg, #162842 0%, #121f35 100%) !important;
  border-color: #37587f !important;
  overflow: hidden;
  border-radius: 1rem;
}

body.theme-dark #cs_form_modal .sticky,
body.theme-dark #cs_flow_modal .sticky {
  background: rgba(17, 32, 56, 0.94) !important;
  border-color: #325076 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Contraste del resumen */
body.theme-dark .summary-panel span[id*="cost"],
body.theme-dark .summary-panel span[id*="costo"],
body.theme-dark .summary-panel span[id*="total"],
body.theme-dark .summary-panel span[id*="precio"],
body.theme-dark .summary-panel span[id*="unit"] {
  color: #d3f9e8 !important;
}

body.theme-dark #costo-total,
body.theme-dark #precio-venta,
body.theme-dark #fc_costo_total,
body.theme-dark #fc_precio_venta,
body.theme-dark #th_total,
body.theme-dark #th_precio {
  color: #34d399 !important;
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.28);
}

/* =========================================================
   Identidad visual por modulo de Rollos (Nacional vs Loteria)
   ========================================================= */
#lito-module #smart-ingestion-lito {
  border-color: #cfdaf0;
  box-shadow: 0 20px 30px -24px rgba(15, 23, 42, 0.32);
}

#lito-module #smart-ingestion-lito > div:first-child {
  background: linear-gradient(90deg, #293d66 0%, #1e2d4a 100%) !important;
}

#lito-module #smart-ingestion-lito > div:first-child .p-2 {
  color: #bfdbfe;
}

#formas-module #smart-ingestion-formas {
  border-color: #bfe8d4;
  box-shadow: 0 20px 30px -24px rgba(2, 44, 34, 0.32);
}

#formas-module #smart-ingestion-formas > div:first-child {
  background: linear-gradient(90deg, #14532d 0%, #166534 100%) !important;
}

#formas-module #smart-ingestion-formas > div:first-child .p-2 {
  color: #86efac;
}

#thermal-module {
  --roll-head-from: #0f5f77;
  --roll-head-to: #0b4d63;
  --roll-accent: #0f5f77;
  --roll-border: #d8e1f0;
  --roll-soft-bg: #f8fafc;
  --roll-soft-border: #e2e8f0;
  --roll-soft-text: #475569;
}

#thermal-module.rollos-mode-thermal {
  --roll-head-from: #0f5f77;
  --roll-head-to: #0b4d63;
  --roll-accent: #0f5f77;
  --roll-border: #bfe0ea;
  --roll-soft-bg: #eef9fc;
  --roll-soft-border: #c8e9f2;
  --roll-soft-text: #134152;
}

#thermal-module.rollos-mode-loteria {
  --roll-head-from: #7c2d12;
  --roll-head-to: #9a3412;
  --roll-accent: #b45309;
  --roll-border: #fde3bf;
  --roll-soft-bg: #fffbeb;
  --roll-soft-border: #fde68a;
  --roll-soft-text: #7c2d12;
}

#thermal-module #smart-ingestion-thermal {
  border-color: var(--roll-border);
  box-shadow: 0 20px 30px -24px rgba(15, 23, 42, 0.35);
}

#thermal-module #smart-ingestion-thermal > div:first-child {
  background: linear-gradient(90deg, var(--roll-head-from) 0%, var(--roll-head-to) 100%) !important;
}

#thermal-module #th_module_identity {
  border-color: var(--roll-soft-border);
  background: var(--roll-soft-bg);
}

#thermal-module #th_module_identity_name {
  color: var(--roll-accent);
}

#thermal-module #th_module_identity_rule {
  color: var(--roll-soft-text);
}

#thermal-module .summary-panel {
  border-color: var(--roll-border);
}

#thermal-module #th_total,
#thermal-module #th_precio {
  color: var(--roll-accent);
}

#thermal-module.rollos-mode-loteria #th_mode_lock {
  border-color: #fcd34d;
  background: #fffbeb;
}

#thermal-module.rollos-mode-loteria #th_mode_lock p:first-child {
  color: #b45309;
}

#thermal-module.rollos-mode-loteria #th_mode_lock p:last-child {
  color: #92400e;
}

body.theme-dark #thermal-module #smart-ingestion-thermal {
  border-color: #355176;
  box-shadow: 0 20px 36px -20px rgba(2, 8, 24, 0.75);
}

body.theme-dark #lito-module #smart-ingestion-lito {
  border-color: #355176;
}

body.theme-dark #formas-module #smart-ingestion-formas {
  border-color: #2f6953;
}

body.theme-dark #thermal-module #th_module_identity {
  background: #162338;
  border-color: #355176;
}

body.theme-dark #thermal-module #th_module_identity_rule {
  color: #c7dbfb;
}

body.theme-dark #thermal-module.rollos-mode-thermal #th_module_identity_name {
  color: #67e8f9;
}

body.theme-dark #thermal-module.rollos-mode-loteria #th_module_identity_name {
  color: #fbbf24;
}

body.theme-dark #thermal-module.rollos-mode-loteria #th_mode_lock {
  border-color: #a16207;
  background: rgba(161, 98, 7, 0.16);
}

body.theme-dark #thermal-module.rollos-mode-loteria #th_mode_lock p:first-child {
  color: #facc15;
}

body.theme-dark #thermal-module.rollos-mode-loteria #th_mode_lock p:last-child {
  color: #fef3c7;
}
