/* ==================================================
   OPERATIVA.APP — BASE GLOBAL STYLES
   Uso general ERP + Landing
================================================== */

/* ===============================
   RESET BÁSICO
================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

/* ===============================
   DESIGN TOKENS (ROOT)
================================ */

:root {
  /* Colores */
  --color-primary: #2563eb;
  --color-primary-soft: #3b82f6;

  --color-text: #0f172a;
  --color-muted: #475569;
  --color-subtle: #64748b;

  --color-bg: #f8fafc;
  --color-bg-soft: #f1f5f9;
  --color-white: #ffffff;

  --color-border: rgba(15, 23, 42, 0.12);

  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #0ea5e9;

  /* Tipografía */
  --font-base: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
               "Open Sans", "Helvetica Neue", sans-serif;

  /* Tamaños de texto */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-lg: 1.1rem;
  --text-xl: 1.4rem;
  --text-2xl: 2rem;

  /* Espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 64px;

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 18px;

  /* Sombras */
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 40px rgba(15, 23, 42, 0.16);

  /* Header */
  --erp-header-height: 64px;
  --erp-content-gap: 36px;
}

/* ===============================
   BODY / BASE
================================ */

body {
  font-family: var(--font-base);
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-soft) 100%);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===============================
   TIPOGRAFÍA
================================ */

h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  font-size: var(--text-base);
  color: var(--color-muted);
  line-height: 1.5;
}

small {
  font-size: var(--text-xs);
  color: var(--color-subtle);
}

strong {
  font-weight: 650;
}

/* ===============================
   LINKS
================================ */

a {
  color: inherit;
  text-decoration: none;
}

/* ===============================
   BOTONES
================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;

  cursor: pointer;
  border: none;
  text-decoration: none;

  /* 🔑 NORMALIZACIÓN BOTONES NATIVOS */
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
  line-height: 1.2;
}

/* CTA PRINCIPAL */
.btn-primary {
  padding: 14px 28px;
  min-height: 48px;

  background: linear-gradient(
    180deg,
    var(--color-primary-soft),
    var(--color-primary)
  );

  color: var(--color-white);

  border-radius: var(--radius-md);

  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.28),
    0 2px 6px rgba(37, 99, 235, 0.18);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px rgba(37, 99, 235, 0.35),
    0 4px 10px rgba(37, 99, 235, 0.22);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  padding: 12px 24px;
  height: 44px;
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--color-white);
  color: var(--color-text);

  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);

  box-shadow:
    0 4px 10px rgba(15, 23, 42, 0.08);

  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;

  white-space: nowrap;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn-secondary:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.12);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow:
    0 3px 8px rgba(15, 23, 42, 0.08);
}

.erp-logout{
  height: 34px;          /* más bajo */
  padding: 0 16px;

  font-size: 0.9rem;

  display: inline-flex;
  align-items: center;   /* centra el texto verticalmente */
  justify-content: center;

  line-height: 1;
}

/* ===============================
   NORMALIZACIÓN BOTONES NATIVOS
================================ */

button.btn,
input.btn {
  font-family: inherit;
}

/* Firefox: padding interno fantasma */
button.btn::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Asegura render idéntico */
.btn {
  line-height: 1.2;
  white-space: nowrap;
}

/* ===============================
   CARDS / CONTENEDORES
================================ */

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

/* ===============================
   HEADER ERP — LAYOUT DEFINITIVO
================================ */

.erp-topbar {
  height: 64px;
  padding: 0 var(--space-5);

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);

  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.erp-left,
.erp-center,
.erp-right {
  display: flex;
  align-items: center;
}

.erp-center {
  flex: 1;
  justify-content: center;
}

.erp-right {
  gap: 16px;
}

/* ===============================
   MAIN ERP
================================ */

.erp-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;

  /* 🔑 área útil coherente */
  padding-top: 36px;
 
}

.erp-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;

  max-width: 1100px;
  width: 100%;
}

.erp-dashboard .card {
  display: flex;
  flex-direction: column;

  /* 🔑 ALTURA UNIFORME */
  min-height: 190px;
}

.erp-dashboard .card > .card-actions,
.erp-dashboard .card > div:last-child {
  margin-top: auto;
}

/* ===============================
   CONTENEDOR BASE DE MÓDULO
================================ */

.erp-module {
  max-width: 1100px;       /* o 900px según módulo */
  margin: 0 auto;
  padding-top: 0px;      /* 🎯 AQUÍ está la distancia correcta */
}

/*.erp-main > .erp-module {
  padding-top: 0;      /* anula el padding heredado 
}*/

/* ===============================
   ERP · LAYOUT ANCHO (LISTADOS)
================================ */

.erp-main-wide {
  flex: 1;
  display: block;
  /*padding-top: var(--erp-content-gap); /* 36px exactos */
}

.erp-main-wide .erp-module {
  max-width: none;
  width: 100%;
  padding: 0 32px; /* aire lateral ERP */
}

/* ===============================
   ACCIONES DEL MÓDULO
================================ */

.erp-module-actions {
  margin-bottom: 20px;
}


/* ===============================
   ESTADO ERP (HEADER) — TEXTO PEQUEÑO
================================ */

.erp-status {
  display: flex;
  flex-direction: column;
  gap: 1px;

  font-size: 0.72rem;     /* ⬅ base más pequeña */
  line-height: 1.1;

  color: var(--color-subtle);
}

/*.status-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;

  border-radius: 50%;
  background-color: var(--color-success);

  display: inline-block;
  flex-shrink: 0;

  animation: erp-pulse 1.6s ease-in-out infinite;
}

@keyframes erp-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.35); opacity: 0.55; }
  100% { transform: scale(1);   opacity: 1; }
}*/

.status-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;

  border-radius: 50%;
  background-color: var(--color-success);

  /* 🔥 más presencia visual */
  box-shadow:
    0 0 0 0 rgba(34, 197, 94, 0.6),
    0 0 6px rgba(34, 197, 94, 0.9);

  display: inline-block;
  flex-shrink: 0;

  animation: erp-pulse 1.6s ease-in-out infinite;
}

@keyframes erp-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(34, 197, 94, 0.55),
      0 0 6px rgba(34, 197, 94, 0.9);
    opacity: 1;
  }

  50% {
    box-shadow:
      0 0 0 4px rgba(34, 197, 94, 0.15),
      0 0 10px rgba(34, 197, 94, 0.85);
    opacity: 0.9;
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(34, 197, 94, 0.55),
      0 0 6px rgba(34, 197, 94, 0.9);
    opacity: 1;
  }
}





.erp-title {
  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 0.72rem;
  font-weight: 500;
}

.erp-subtitle {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: var(--text-base);
  line-height: 1.5;
}

.erp-user {
  font-size: 0.68rem;     /* ⬅ aún más pequeño */
  color: var(--color-muted);
}

.erp-user strong {
  font-weight: 600;
}

/* ===============================
   MENSAJES
================================ */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ===============================
   UTILIDADES
================================ */

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.muted {
  color: var(--color-muted);
}

/* ===============================
   FOOTER GLOBAL — AISLADO
================================ */

.landing-footer {
  margin-top: auto;
  padding: 24px 20px;

  text-align: center;

  font-family: var(--font-base);
  font-size: var(--text-xs);
  line-height: 1.4;
  font-weight: 400;

  color: var(--color-subtle);
}

/* ===============================
   FAB AJUSTES ERP
================================ */

.erp-fab-settings {
  position: fixed;
  bottom: 32px;
  right: 32px;

  width: 56px;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    180deg,
    var(--color-primary-soft),
    var(--color-primary)
  );

  border-radius: 50%;
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.35),
    0 4px 10px rgba(37, 99, 235, 0.25);

  z-index: 1000;
}

.erp-fab-settings svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.erp-fab-settings:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 32px rgba(37, 99, 235, 0.4);
}

/* ===============================
   FORMULARIOS (GLOBAL ERP)
================================ */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-field label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;

  font-size: var(--text-base);
  font-family: var(--font-base);

  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-white);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-actions {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===============================
   LAYOUT · PANTALLA ÚNICA
================================ */

.erp-single {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* tarjeta tipo login / cobro / alta */
.erp-card-form {
  width: 420px;
  max-width: calc(100% - 32px);
}

/* ==================================================
   ERP · PANTALLAS ANCHAS (LISTADOS GRANDES)
================================================== */

.erp-main-wide {
  max-width: none;              /* ⬅️ rompe el corsé */
  padding-left: 48px;
  padding-right: 48px;
}

@media (max-width: 1400px) {
  .erp-main-wide {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ==================================================
   FOOTER ERP · DEFINITIVO
================================================== */

/*.erp-footer {
  margin-top: auto;          /* empuja al fondo */
  padding: 24px 0 32px;      /* aire inferior real */

  /*text-align: center;*/
  /*font-size: 0.72rem;
  color: var(--color-subtle);*/

  /*width: 100%;
}

.erp-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}*/

/* ==================================================
   FOOTER ERP · DEFINITIVO (LAYOUT COMPLEJO)
================================================== */

/* === OVERRIDE FOOTER: SIEMPRE CENTRADO ABAJO (gana a todo) === */
.erp-footer{
  position: fixed !important;
  left: 50% !important;
  bottom: 24px !important;
  transform: translateX(-50%) !important;

  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;

  text-align: center !important;
  font-size: 0.72rem !important;
  color: var(--color-subtle) !important;

  white-space: nowrap !important;
  pointer-events: none !important;
  z-index: 2000 !important;
}
/* ==================================================
   EMBEBED
================================================== */


.erp-nomina-fullscreen{
  height: calc(100vh - 70px); /* altura header ERP */
  display:flex;
  flex-direction:column;
}

.erp-nomina-fullscreen .tab-panel.active{
  flex:1;
  display:grid;
  grid-template-columns:1fr 1fr;
  overflow:hidden;
}

.panel-form{
  overflow-y:auto;
}

.panel-results{
  overflow-y:auto;
}