@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

/* Variables globales de texto y tamaños base */
:root {
  --text-color: #1f2937;
  --text-muted: #4b5563;
  --title-color: #111827;
  --h2-size: 20px;
  --h3-size: 16px;
  --p-size: 12px;
}

/* Tipografia general para toda la app */
html,
body {
  font-family: "Roboto", sans-serif;
  color: var(--text-color);
}

/* Modelo de caja consistente para todo el proyecto */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Imagenes adaptables al contenedor */
img {
  max-width: 100%;
  height: auto;
}

/* Reset basico de margen para textos (h2 con clase: solo modulos; ver h2:not([class]) abajo) */
h3,
p {
  margin: 0;
}

/* Fondo y margen base del documento */
body {
  margin: 0;
  background: #fff;
}

/* Base global: todos los campos en fondo blanco */
input,
select,
textarea {
  background: #ffffff !important;
}

/* Quita el relleno azul/amarillo del autocompletado del navegador */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #1f2937;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Contenedor principal de header reutilizable */
.header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Agrupa logo y boton menu dentro del header */
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Titulos h2 sin clase: tipografia global (evita solaparse con .ent-page-title, .epp-page-title, etc.) */
h2:not([class]) {
  margin: 0;
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 31px;
  color: var(--title-color);
}

/* Subtitulos h3 sin clase (los h3 con clase usan reglas del modulo, p. ej. .ent-search-label) */
h3:not([class]) {
  font-size: var(--h3-size);
  font-weight: 700;
  line-height: 24px;
  color: var(--title-color);
}

/* Estilo general para parrafos */
p {
  font-size: var(--p-size);
  font-weight: 400;
  line-height: 24px;
  color: var(--text-muted);
}

/* Utilidad global para filas de formulario */
.responsive-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Auto-ocultar mensajes (3s desde JS) */
.auto-dismiss-message {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.auto-dismiss-hide {
  opacity: 0;
  transform: translateY(-4px);
}

/* Toast global para mensajes del sistema */
.app-toast {
  position: fixed;
  right: 16px;
  top: 88px;
  z-index: 10060;
  min-width: 260px;
  max-width: min(460px, calc(100vw - 24px));
  min-height: 42px;
  margin: 0 !important;
  padding: 10px 12px !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 24px #00000026;
  border-radius: 8px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.app-toast--ok {
  background: #dcfce7 !important;
  border: 1px solid #86efac !important;
  color: #166534 !important;
}

.app-toast.app-toast--error {
  background: #fee2e2 !important;
  border: 1px solid #fecaca !important;
  color: #991b1b !important;
}

.app-toast.app-toast--info {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1e3a8a !important;
}

/* Responsive global para tablet y celular */
@media (max-width: 768px) {
  :root {
    --h2-size: 18px;
    --h3-size: 15px;
    --p-size: 12px;
  }

  .header {
    gap: 12px;
    padding: 10px 12px;
  }

  .header-left {
    gap: 12px;
  }

  .admin-layout {
    padding: 12px 12px 20px 12px;
  }

  .demo-section {
    width: 100%;
    margin: 0 auto;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  .responsive-row {
    flex-direction: column;
    align-items: stretch;
  }
}
