/**
 * ERP CALIDAD MP - Sistema de Diseño Corporativo
 * Paleta Olive Green & Warm Cream institucional
 */

:root {
  --erp-primary: #2b3e1c;
  --erp-primary-hover: #1e2c14;
  --erp-primary-light: #3e5828;
  --erp-sidebar-bg: #1c2b12;
  --erp-sidebar-active: #ffffff;
  --erp-sidebar-text: #c5d3bd;
  --erp-accent: #b58d3d;
  --erp-accent-hover: #9c762e;
  --erp-bg: #f4f5ef;
  --erp-card-bg: #ffffff;
  --erp-card-border: #e3e7db;
  --erp-text-main: #1f291e;
  --erp-text-muted: #677462;
  --erp-success: #2e7d32;
  --erp-warning: #ed6c02;
  --erp-danger: #d32f2f;
  --erp-info: #0288d1;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--erp-bg);
  color: var(--erp-text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT PRINCIPAL ERP
   ========================================================================== */
.erp-container {
  display: flex;
  min-height: 100vh;
}

.erp-sidebar {
  width: 250px;
  background-color: var(--erp-sidebar-bg);
  color: var(--erp-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-brand-badge {
  background: #ffffff;
  color: var(--erp-primary);
  font-weight: 800;
  font-size: 16px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.erp-brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.erp-brand-text p {
  font-size: 11px;
  color: #9cb190;
  margin-top: 2px;
}

.erp-nav-section {
  padding: 20px 14px 8px 14px;
}

.erp-nav-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7b946e;
  margin-bottom: 10px;
  padding-left: 10px;
}

.erp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #c9d8c0;
  text-decoration: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
  margin-bottom: 4px;
}

.erp-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.erp-nav-item.active {
  background: #ffffff;
  color: var(--erp-primary);
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.erp-sidebar-footer {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.erp-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-user-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}

.erp-user-info h4 {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.erp-user-info p {
  font-size: 10px;
  color: #9cb190;
}

.erp-logout-btn {
  background: transparent;
  border: none;
  color: #9cb190;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.erp-logout-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   CONTENIDO PRINCIPAL
   ========================================================================= */
.erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--erp-bg);
}

/* ==========================================================================
   BARRA SUPERIOR (TOPBAR) MODERNA & ELEGANTE
   ========================================================================= */
.erp-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8dd;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 40;
}

.erp-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.erp-menu-btn {
  background: #f4f6f1;
  border: 1px solid #d5ddce;
  color: #2b3e1c;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.erp-menu-btn:hover {
  background: #2b3e1c;
  color: #ffffff;
  border-color: #2b3e1c;
  transform: translateY(-1px);
}

.erp-breadcrumb-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-breadcrumb-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f4f6f1, #e7ece0);
  border: 1px solid #dbe2d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}

.erp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #1f2d14;
}

.erp-breadcrumb .erp-breadcrumb-main {
  color: #1f2d14;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.erp-breadcrumb .erp-breadcrumb-sep {
  color: #a4b39b;
  font-weight: 400;
  font-size: 13px;
}

.erp-breadcrumb .erp-breadcrumb-sub {
  color: #6c7e63;
  font-weight: 500;
  font-size: 13.5px;
}

.erp-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef7eb;
  border: 1px solid #cce8c4;
  color: #2e6622;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.erp-live-badge .erp-pulse-dot {
  width: 7px;
  height: 7px;
  background: #38a169;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(56, 161, 105, 0.4);
  animation: erpPulse 2s infinite;
}

@keyframes erpPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(56, 161, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0); }
}

.erp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-action-btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f4f6f1;
  border: 1px solid #d5ddce;
  color: #2b3e1c;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.erp-action-btn-portal:hover {
  background: #2b3e1c;
  color: #ffffff;
  border-color: #2b3e1c;
  box-shadow: 0 3px 10px rgba(43, 62, 28, 0.2);
  transform: translateY(-1px);
}

.erp-action-btn-portal span {
  font-size: 15px;
}

.erp-action-btn-refresh {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #d5ddce;
  color: #4a5c3d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.erp-action-btn-refresh:hover {
  background: #2b3e1c;
  color: #ffffff;
  border-color: #2b3e1c;
  transform: rotate(180deg);
  box-shadow: 0 3px 10px rgba(43, 62, 28, 0.2);
}

.erp-content {
  padding: 28px 32px;
  flex: 1;
}

/* Banner de bienvenida */
.erp-welcome-card {
  background: var(--erp-primary);
  color: #ffffff;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(43, 62, 28, 0.15);
}

.erp-welcome-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.erp-welcome-card p {
  font-size: 13px;
  color: #c9d8c0;
}

/* Métricas KPI */
.erp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.erp-kpi-card {
  background: #ffffff;
  border: 1px solid var(--erp-card-border);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.erp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

.erp-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.erp-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--erp-text-main);
  line-height: 1;
}

.erp-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--erp-text-muted);
}

/* Tarjetas de Módulos (Acceso rápido) */
.erp-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--erp-text-main);
  margin-bottom: 16px;
}

.erp-modules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.erp-module-card {
  background: #ffffff;
  border: 1px solid var(--erp-card-border);
  border-radius: 14px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.22s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.erp-module-card:hover {
  transform: translateY(-3px);
  border-color: #bcc5b0;
  box-shadow: 0 8px 18px rgba(43, 62, 28, 0.08);
}

.erp-module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.erp-module-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.erp-module-num {
  font-size: 12px;
  font-weight: 800;
  color: #9cb190;
}

.erp-module-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--erp-text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.erp-module-card p {
  font-size: 12px;
  color: var(--erp-text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.erp-module-btn-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--erp-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

/* Sincronización en tiempo real */
.erp-sync-card {
  background: #ffffff;
  border: 1px solid var(--erp-card-border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.erp-sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.erp-sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--erp-text-main);
}

.erp-dot-live {
  width: 9px;
  height: 9px;
  background: #2e7d32;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.erp-sync-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.erp-sync-subcard {
  background: #fbfcf9;
  border: 1px solid var(--erp-card-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.erp-sync-subcard h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--erp-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.erp-sync-subcard .records {
  font-size: 13px;
  font-weight: 800;
  color: var(--erp-primary);
  margin-bottom: 4px;
}

.erp-sync-subcard .date {
  font-size: 10.5px;
  color: var(--erp-text-muted);
}

/* Botones universales */
.btn-primary {
  background: var(--erp-primary);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--erp-primary-hover);
  box-shadow: 0 2px 8px rgba(43, 62, 28, 0.25);
}

.btn-secondary {
  background: #ffffff;
  color: var(--erp-text-main);
  border: 1px solid var(--erp-card-border);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f5f6f1;
  border-color: #cbd4c3;
}

/* ==========================================================================
   VISTA SUITE ASISTENTES (IMAGEN 1 MATCH EXACTO)
   ========================================================================== */
.suite-body {
  background-color: #f4f5ef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.suite-header {
  background: #283b1d;
  color: #ffffff;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.suite-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.suite-badge {
  background: #ffffff;
  color: #283b1d;
  font-weight: 800;
  font-size: 14px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.suite-brand h1 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.suite-brand p {
  font-size: 11px;
  color: #c9d8c0;
}

.suite-offline-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.suite-container {
  max-width: 1150px;
  margin: 40px auto;
  padding: 0 24px;
  width: 100%;
}

.suite-intro-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5c6b4f;
  margin-bottom: 4px;
}

.suite-intro-title {
  font-size: 26px;
  font-weight: 900;
  color: #283b1d;
  margin-bottom: 10px;
}

.suite-intro-desc {
  font-size: 13.5px;
  color: #586650;
  max-width: 780px;
  line-height: 1.5;
  margin-bottom: 30px;
}

.suite-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.suite-card {
  background: #ffffff;
  border: 1px solid #e1e6d7;
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.25s ease;
  position: relative;
}

.suite-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(40, 59, 29, 0.1);
  border-color: #b7c4a8;
}

.suite-card.disabled {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.8);
}

.suite-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.suite-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.suite-icon-01 { background: #2f443b; }
.suite-icon-02 { background: #874933; }
.suite-icon-03 { background: #4f6834; }
.suite-icon-04 { background: #3b5c46; }

.suite-card-num {
  font-size: 13px;
  font-weight: 800;
  color: #7b8e6f;
}

.suite-card h3 {
  font-size: 17px;
  font-weight: 800;
  color: #283b1d;
  margin-bottom: 10px;
  line-height: 1.25;
}

.suite-card p {
  font-size: 12.5px;
  color: #65745d;
  line-height: 1.45;
  margin-bottom: 24px;
}

.suite-card-link {
  font-size: 13px;
  font-weight: 800;
  color: #283b1d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.suite-notice-box {
  background: #eaeee3;
  border: 1px solid #d4dec9;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 12.5px;
  color: #4a5940;
  line-height: 1.5;
  margin-top: 10px;
}

.suite-footer {
  text-align: center;
  padding: 24px;
  font-size: 11.5px;
  color: #7b8e6f;
  margin-top: auto;
}

/* ==========================================================================
   PANTALLA LOGIN Y TECLADO PIN
   ========================================================================== */
.pin-login-body {
  background: #f4f5ef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-login-card {
  background: #ffffff;
  border: 1px solid #e1e6d7;
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(40, 59, 29, 0.08);
  text-align: center;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 28px 0;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #9cb190;
  background: #ffffff;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: #283b1d;
  border-color: #283b1d;
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 290px;
  margin: 0 auto;
}

.pin-key {
  background: #f8faf6;
  border: 1px solid #dde3d5;
  border-radius: 14px;
  padding: 16px 0;
  font-size: 20px;
  font-weight: 700;
  color: #283b1d;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pin-key:hover {
  background: #eef2e7;
  border-color: #b7c4a8;
  transform: translateY(-2px);
}

.pin-key:active {
  background: #283b1d;
  color: #ffffff;
  transform: translateY(1px);
}

.pin-key.action-key {
  font-size: 14px;
  font-weight: 600;
  color: #65745d;
}

/* Toast Notifications */
.erp-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.erp-toast {
  background: #283b1d;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.3s ease forwards;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Botón de Menú Móvil (Hamburguesa) */
.erp-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--erp-card-border);
  color: var(--erp-text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  transition: all 0.2s;
}

.erp-menu-btn:hover {
  background: #eef2e7;
}

.erp-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.erp-sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

@media (max-width: 1024px) {
  .erp-kpi-grid, .erp-modules-grid, .erp-sync-grid, .suite-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .erp-menu-btn {
    display: inline-flex;
  }
  
  .erp-container {
    flex-direction: row;
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
  }
  
  .erp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 275px;
    height: 100vh;
    max-height: 100vh;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
  }
  
  .erp-sidebar.open {
    transform: translateX(0);
  }
  
  .erp-main {
    width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 100vh;
  }
  
  .erp-topbar {
    padding: 10px 16px;
  }

  .erp-kpi-grid, .erp-modules-grid, .erp-sync-grid, .suite-grid {
    grid-template-columns: 1fr;
  }
  
  .erp-content {
    padding: 14px;
  }

  .suite-header {
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .suite-container {
    margin: 20px auto;
    padding: 0 16px;
  }
}


/* ==========================================================================
   SIDEBAR COLAPSABLE & RESPONSIVE INTELIGENTE
   ========================================================================== */
.erp-container {
  display: flex;
  min-height: 100vh;
  transition: all 0.25s ease;
}

.erp-sidebar {
  width: 250px;
  background-color: var(--erp-sidebar-bg);
  color: var(--erp-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

/* Modo colapsado en Desktop (Ancho reducido a 72px) */
.erp-container.sidebar-collapsed .erp-sidebar {
  width: 72px;
}
.erp-container.sidebar-collapsed .erp-brand-text,
.erp-container.sidebar-collapsed .erp-nav-title,
.erp-container.sidebar-collapsed .erp-user-info,
.erp-container.sidebar-collapsed .erp-nav-item span.nav-label {
  display: none !important;
}
.erp-container.sidebar-collapsed .erp-brand {
  justify-content: center;
  padding: 20px 8px;
}
.erp-container.sidebar-collapsed .erp-nav-item {
  justify-content: center;
  padding: 12px 0;
  margin: 4px 8px;
}
.erp-container.sidebar-collapsed .erp-sidebar-footer {
  justify-content: center;
  padding: 14px 4px;
}
.erp-container.sidebar-collapsed .erp-logout-btn {
  margin-top: 8px;
}

/* Backdrop únicamente activo en pantallas móviles */
.erp-sidebar-backdrop {
  display: none !important;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
  .erp-sidebar-backdrop.show {
    display: block !important;
    opacity: 1;
  }
}


/* ==========================================================================
   OPTIMIZACIÓN MÓVIL INTEGRAL: CONSOLIDADO, CONFIGURACIONES Y DESPLAZAMIENTO
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Contenedores de Tablas Consolidadas con Desplazamiento Táctil Fluido */
  .table-responsive, #recTabla, #dbTabla, #basedatos, .tbl-wrap, .table-wrap, .table-container, div[id*="Tabla"], div[id*="tabla"] {
    width: 100% !important;
    max-width: calc(100vw - 20px) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    box-sizing: border-box !important;
    padding-bottom: 12px;
    touch-action: pan-x pan-y !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .table-responsive table, #recTabla table, #dbTabla table, #basedatos table, table {
    min-width: 720px !important;
    width: max-content !important;
  }

  /* Barras de Herramientas y Filtros en Móviles */
  .toolbar, .actions-bar, .filter-bar, .topbar-tools, .fld-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .toolbar > *, .actions-bar > *, .filter-bar > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Sección de Configuración Operable en Móviles */
  #panel-config, #configuracion, .config-section, .config-card, .tab-panel {
    width: 100% !important;
    max-width: calc(100vw - 20px) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  #panel-config input, #configuracion input,
  #panel-config select, #configuracion select,
  #panel-config textarea, #configuracion textarea,
  #panel-config pre, #configuracion pre,
  #panel-config code, #configuracion code {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    word-break: break-all !important;
    white-space: pre-wrap !important;
    font-size: 13px !important;
  }

  /* Grid en Móvil a 1 Columna */
  .grid.g3, .grid.g2, .grid-2, .grid-3, .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Botones Táctiles */
  button, .btn, .btn-primary, .btn-secondary {
    min-height: 42px !important;
    touch-action: manipulation;
  }
}


/* ==========================================================================
   BLINDAJE MÓVIL TOTAL: TOPBAR RESPONSIVO Y TABLAS DESLIZABLES SIN CORTE
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  /* Barra superior compacta anti-desborde */
  .erp-topbar, .erp-topbar-pro {
    padding: 8px 12px !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  .erp-topbar-left {
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }
  .erp-breadcrumb-wrap {
    gap: 6px !important;
    min-width: 0 !important;
  }
  .erp-breadcrumb-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
  }
  .erp-breadcrumb {
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .erp-breadcrumb-sep, .erp-breadcrumb-sub, .erp-live-badge {
    display: none !important;
  }
  .erp-topbar-actions {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .erp-action-btn-portal {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
    border-radius: 7px !important;
    white-space: nowrap !important;
  }

  /* Paneles y Envolturas con Desplazamiento Horizontal 100% Fluido */
  .panel {
    overflow: visible !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .panel-body, .card-b, .trash-table-container, .table-responsive, 
  #recTabla, #dbTabla, #basedatos, #consultaLista, #galGrid, .table-scroll-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    box-sizing: border-box !important;
    display: block !important;
    padding-bottom: 14px !important;
  }

  /* Tablas con ancho mínimo asegurado para permitir deslizar todas las columnas */
  .panel-body table, .table-scroll-wrap table, .trash-table-container table,
  #recTabla table, #dbTabla table, #basedatos table, table {
    min-width: 780px !important;
    width: max-content !important;
  }

  /* Filtros de búsqueda en cuadrícula adaptable */
  .db-search, .trash-controls-bar, .toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .db-search > *, .trash-controls-bar > *, .toolbar > * {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}
