@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
/* ==========================================================================
   DC ASESORIAS - ESTILOS CORPORATIVOS
   "TU ALIADO EN LA GESTION DE TU NEGOCIO"
   ========================================================================== */

:root {
  /* Paleta Profesional y Gastronómica (Teal & Ámbar) */
  --primary-navy: #0f4c5c;
  --primary-deep: #08333e;
  --primary-blue: #0d9488;
  --primary-gradient: linear-gradient(135deg, #0f4c5c 0%, #0d9488 100%);
  --primary-gradient-hover: linear-gradient(135deg, #08333e 0%, #0f766e 100%);
  
  --accent-blue: #0d9488;
  --accent-cyan: #2dd4bf;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-gold-light: rgba(245, 158, 11, 0.14);
  --bg-gradient: #f8fafc;
  
  /* Tonos Neutros de Alta Definición */
  --card-bg: #ffffff;
  --surface-alt: #f0fdfa;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #64748b;
  --border-color: #cbd5e1;
  --border-focus: #0d9488;

  /* Estados */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #0d9488;

  /* Sombras y Bordes */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 76, 92, 0.16), 0 8px 10px -6px rgba(15, 76, 92, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 76, 92, 0.28);
  --shadow-gold: 0 4px 14px rgba(245, 158, 11, 0.30);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s ease-in-out;
}

/* Tipografía Oficial DC Restaurantes: Inter 15.5px */
:root {
  --font-family-base: 'Inter', sans-serif;
  --font-size-base: 15.5px;
}

html {
  font-size: 15.5px !important;
  font-family: 'Inter', sans-serif !important;
  -webkit-text-size-adjust: 100%;
}

/* Reset Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  font-family: 'Inter', sans-serif !important;
  font-size: 15.5px !important;
}

input, button, select, textarea, optgroup {
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
}

table, th, td {
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f8fafc;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  overflow-x: hidden;
  width: 100% !important;
  max-width: 100% !important;
}

/* Ocultar fondos decorativos circulares para mantener interfaz limpia edge-to-edge */
body::before,
body::after {
  display: none !important;
}

/* Contenedor Principal Edge to Edge Pantalla Completa */
.app-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-container.wide-layout,
.app-container.full-screen-active,
.app-container:has(#dashboard-section:not(.hidden)),
.app-container:has(#master-companies-section:not(.hidden)),
body:has(#dashboard-section:not(.hidden)) .app-container,
body:has(#master-companies-section:not(.hidden)) .app-container,
body.dashboard-screen-active .app-container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:has(#dashboard-section:not(.hidden)),
body:has(#master-companies-section:not(.hidden)),
body.dashboard-screen-active {
  padding: 0 !important;
  background: #f8fafc !important;
}

/* ==========================================================================
   PANTALLA DE AUTENTICACIÓN (LOGIN MÓVIL Y BASE)
   ========================================================================== */
.auth-card,
#auth-section {
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  border: none;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 36px 20px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-out;
}

/* Ocultar sección de autenticación por completo cuando no está en login */
#auth-section.hidden,
#auth-section[hidden],
body.dashboard-screen-active #auth-section,
body:has(#dashboard-section:not(.hidden)) #auth-section,
body:has(#master-companies-section:not(.hidden)) #auth-section {
  display: none !important;
}

/* Ocultar hero panel en pantallas pequeñas por defecto */
.auth-hero-panel {
  display: none;
}

.auth-forms-panel {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CABECERA Y LOGO CORPORATIVO
   ========================================================================== */
.brand-header {
  text-align: center;
  margin-bottom: 16px;
  border-bottom: none !important;
  padding-bottom: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100%;
}

.logo-wrapper {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}

.logo-wrapper.mini {
  margin-bottom: 0;
  flex-shrink: 0;
}

.brand-logo-circle {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: none;
  background: transparent;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s ease;
}

.brand-logo-circle:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 10px 22px rgba(11, 25, 44, 0.4));
}

.brand-logo-circle.mini {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  margin: 0;
  border-radius: 50%;
  object-fit: contain;
  border: none;
  filter: drop-shadow(0 3px 8px rgba(11, 25, 44, 0.2));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.brand-logo-circle.mini:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 12px rgba(11, 25, 44, 0.3));
}

@media (max-width: 600px) {
  .brand-logo-circle.mini {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
  }
}

.logo-emblem {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-deep) 100%);
  border: 3px solid var(--accent-gold);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
  position: relative;
  transform: rotate(-3deg);
  transition: transform 0.3s ease;
}

.logo-emblem:hover {
  transform: rotate(0deg) scale(1.04);
}

.logo-letters {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-emblem.mini {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border-width: 2px;
  transform: none;
}

.logo-emblem.mini .logo-letters {
  font-size: 17px;
}

.brand-title {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.brand-slogan {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-gold-hover);
  text-transform: uppercase;
  background: var(--accent-gold-light);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   VISTAS (LOGIN & REGISTRO)
   ========================================================================== */
.form-view {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.form-view.hidden,
.hidden {
  display: none !important;
}

.view-header {
  text-align: center;
  margin-bottom: 24px;
}

.view-title {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 6px;
}

.view-subtitle {
  font-size: 15.5px;
  color: var(--text-muted);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-deep);
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 0;
}

/* ==========================================================================
   CAMPOS DE FORMULARIO
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 580px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-navy);
  margin-bottom: 6px;
}

.req {
  color: var(--color-error);
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  font-size: 15px;
  transition: color 0.2s ease;
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select.form-select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 14px;
  color: var(--text-main);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

select.form-select {
  padding-left: 14px;
  cursor: pointer;
}

input:focus,
select:focus {
  background: #ffffff;
  border-color: var(--primary-deep);
  box-shadow: 0 0 0 4px rgba(30, 62, 98, 0.12);
}

input:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: var(--primary-deep);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--primary-deep);
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ==========================================================================
   SECCIONES AVANZADAS DE CREACIÓN DE EMPRESA (ROLES Y MÓDULOS)
   ========================================================================== */
.form-section-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
  text-align: left;
}

.section-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 4px;
}

.section-box-title i {
  color: var(--accent-gold);
}

.section-box-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Selector de Rol: Master vs Lite */
.role-selector-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .role-selector-cards {
    grid-template-columns: 1fr;
  }
}

.role-card-option {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.role-card-option input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-deep);
  cursor: pointer;
}

.role-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-card-header strong {
  font-size: 13px;
  color: var(--primary-navy);
}

.role-card-content p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.role-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.role-icon-box.master {
  background: #fefce8;
  color: #b45309;
  border: 1px solid #fde047;
}

.role-icon-box.lite {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.role-card-option:hover {
  border-color: var(--primary-deep);
  transform: translateY(-1px);
}

.role-card-option.selected,
.role-card-option:has(input[type="radio"]:checked) {
  border-color: var(--primary-deep);
  background: #f0f7ff;
  box-shadow: 0 4px 12px rgba(30, 62, 98, 0.1);
}

/* Grid de tarjetas de rol (nuevo selector master/lite) */
.role-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .role-cards-grid { grid-template-columns: 1fr; }
}

.role-card-option {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.role-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.role-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-navy);
}

.role-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.role-check-mark {
  font-size: 16px;
  color: var(--primary-deep);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.role-card-option:has(input[type="radio"]:checked) .role-check-mark {
  opacity: 1;
}

.role-card-option:has(input[value="master"]:checked) {
  border-color: #b45309;
  background: #fffbeb;
}

.role-card-option:has(input[value="lite"]:checked) {
  border-color: #1d4ed8;
  background: #eff6ff;
}

/* Ocultar radio nativo dentro de las nuevas tarjetas */
.role-cards-grid .role-card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Cabecera de activación de módulos */
.modules-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.modules-quick-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary-blue);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-text-action:hover {
  text-decoration: underline;
  color: var(--primary-navy);
}

/* Grilla de selección de módulos */
.modules-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

@media (max-width: 520px) {
  .modules-selection-grid {
    grid-template-columns: 1fr;
  }
}

.module-check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-navy);
  transition: var(--transition);
  user-select: none;
}

.module-check-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-deep);
  cursor: pointer;
  margin: 0;
}

.module-check-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.module-check-card:has(input[type="checkbox"]:checked) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--primary-deep);
  font-weight: 600;
}

.future-modules-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.future-modules-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-navy);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.future-modules-box label i {
  color: var(--accent-gold);
}

.future-modules-box input {
  padding: 9px 12px !important;
  font-size: 12.5px;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.28);
  border: none;
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 58, 95, 0.38);
}

.btn-outline-gold {
  background: #ffffff;
  border: 1.5px solid var(--accent-gold-hover);
  color: #b45309;
  font-weight: 700;
}

.btn-outline-gold:hover {
  background: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transform: translateY(-1px);
}

.btn-outline-dark {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--primary-navy);
}

.btn-outline-dark:hover {
  background: var(--surface-alt);
  border-color: var(--primary-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  margin-top: 10px;
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--primary-navy);
}

.btn-logout {
  background: #fee2e2;
  color: #b91c1c;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-logout:hover {
  background: #fecaca;
  color: #991b1b;
}

.btn-action-sm {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.text-gold {
  color: var(--accent-gold-hover) !important;
}

.text-blue {
  color: var(--primary-blue) !important;
}

.btn-pay-tip {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.btn-pay-tip:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-tip-done {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border: 1px solid #e2e8f0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0 16px 0;
  color: var(--text-light);
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 12px;
}

.form-actions {
  margin-top: 24px;
}

/* ==========================================================================
   ACCESOS RÁPIDOS POR ROL (DEMO)
   ========================================================================== */
.demo-box {
  margin-top: 24px;
  padding: 14px 16px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-gold);
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
}

.demo-box strong {
  color: var(--primary-navy);
}

.role-quick-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-role-quick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.btn-role-quick strong {
  display: block;
  font-size: 12px;
}

.btn-role-quick small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.btn-role-quick.master {
  border-color: rgba(212, 175, 55, 0.4);
}

.btn-role-quick.master i {
  color: var(--accent-gold);
  font-size: 16px;
}

.btn-role-quick.master:hover {
  background: #fefce8;
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn-role-quick.client i {
  color: var(--primary-blue);
  font-size: 16px;
}

.btn-role-quick.client:hover {
  background: #eff6ff;
  border-color: var(--primary-blue);
  transform: translateY(-1px);
}

/* ==========================================================================
   CONTROL DE PERMISOS Y ROLES (MASTER VS CLIENTE)
   ========================================================================== */
.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.badge-role.master {
  background: linear-gradient(135deg, #091728 0%, #152d47 100%);
  color: var(--accent-gold);
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.badge-role.client,
.badge-role.lite {
  background: #eef4fb;
  color: var(--primary-navy);
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(30, 58, 95, 0.1);
}

/* CUANDO EL USUARIO ES CLIENTE O LITE: OCULTAR ACCIONES DE EDICIÓN Y ARCHIVOS PLANOS */
body.role-client .master-only,
body.role-lite .master-only,
body.role-client .btn-pay-tip,
body.role-lite .btn-pay-tip {
  display: none !important;
}

/* En modo cliente / lite, las propinas pagadas se muestran estáticas */
body.role-client .btn-tip-done,
body.role-lite .btn-tip-done {
  display: inline-block !important;
}

/* Módulos Personalizados / Futuros Dinámicos */
.tab-btn.custom-module-tab {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--primary-navy);
}

.tab-btn.custom-module-tab:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--accent-gold);
}

.tab-btn.custom-module-tab.active {
  background: linear-gradient(135deg, #0B192C 0%, #1E3E62 100%);
  border-color: var(--accent-gold);
  color: #ffffff;
}

.custom-module-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  margin-top: 16px;
}

.custom-module-banner .banner-icon {
  width: 58px;
  height: 58px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
}

.custom-module-banner h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 8px;
}

.custom-module-banner p {
  font-size: 15.5px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}

.custom-module-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Acciones en encabezados de módulos */
.module-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flex-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-upload-label,
.btn-upload-exclusive-label {
  margin-bottom: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-outline-exclusive {
  background: #ffffff;
  border: 1.5px solid #2563eb;
  color: #1e3a5f;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(30, 58, 95, 0.08);
  transition: var(--transition);
}

.btn-outline-exclusive i {
  color: #2563eb;
  font-size: 13px;
}

.btn-outline-exclusive:hover {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #1e3a5f;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.28);
  transform: translateY(-1px);
}

.btn-outline-exclusive:hover i {
  color: #ffffff;
}

.badge-exclusive-template {
  background: #eef4fb;
  color: #1e3a5f;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   PANEL INTEGRAL POST-LOGIN (DASHBOARD)
   ========================================================================== */
.dashboard-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 32px;
  animation: fadeIn 0.4s ease-out;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 22px;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 1.5px;
}

.dash-slogan {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-gold-hover);
  letter-spacing: 1px;
  display: block;
}

/* Badge dinámico de Versión del Software DC Restaurantes */
.app-version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.28));
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: none;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  user-select: none;
}

.brand-title .app-version-badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  margin-left: 8px;
}

.dash-title .app-version-badge,
.master-panel-title .app-version-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  margin-left: 6px;
}

.hero-main-heading .app-version-badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  margin-left: 8px;
}

.dash-footer .app-version-badge {
  font-size: 0.60rem;
  padding: 1px 5px;
  margin-left: 4px;
}

.app-version-badge:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #a7f3d0;
}

.system-status-pill i {
  font-size: 8px;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ==========================================================================
   FICHA TÉCNICA DE LA EMPRESA (MÓDULO DE IDENTIDAD)
   ========================================================================== */
.company-profile-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #2563eb 100%);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  color: #ffffff;
  margin-bottom: 26px;
  box-shadow: 0 10px 30px rgba(30, 58, 95, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.company-profile-card::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 140px;
  height: 140px;
  border: 14px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 14px;
}

.profile-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-avatar-box {
  width: 48px;
  height: 48px;
  background: #ffffff;
  color: var(--primary-navy);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tag-registered {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #bae6fd;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.company-main-name {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
}

.profile-timestamp span {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  color: #e2e8f0;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: stretch;
  width: 100%;
}

.profile-detail-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.profile-detail-box .detail-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.profile-detail-box .detail-val {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .profile-details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .profile-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .profile-detail-box {
    max-width: 100%;
    min-width: 0;
  }
}

/* ==========================================================================
   NAVEGACIÓN DE LOS MÓDULOS DE GESTIÓN OPERATIVA & REPORTES
   ========================================================================== */
.business-tabs-container {
  background: #ffffff;
}

.tabs-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modules-suite-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modules-suite-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
  background: #e0f2fe;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #bae6fd;
}

.tabs-nav-wrapper {
  overflow-x: auto;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) #f1f5f9;
}

.tabs-nav-wrapper::-webkit-scrollbar {
  height: 6px;
}

.tabs-nav-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--accent-gold);
  border-radius: 4px;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  min-width: max-content;
  padding: 2px 0;
}

.tab-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #e2e8f0;
  color: var(--primary-navy);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.tab-btn:hover {
  color: var(--primary-navy);
  background: #eef4fb;
  border-color: #cbd5e1;
}

.tab-btn.active {
  color: #ffffff;
  font-weight: 700;
  background: var(--primary-gradient);
  border-color: var(--primary-navy);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.28);
}

.tab-btn.active .tab-number {
  background: #ffffff;
  color: var(--primary-navy);
}

.tab-btn.active i {
  color: #bfdbfe;
}

/* Botón especial de Reportes Gráficos */
.btn-highlight-charts {
  background: #eef4fb;
  border-color: #cbd5e1;
  color: var(--primary-navy);
  font-weight: 700;
}

.btn-highlight-charts i {
  color: var(--primary-navy);
}

.btn-highlight-charts:hover {
  background: var(--primary-navy);
  color: #ffffff;
}

.btn-highlight-charts:hover i {
  color: #ffffff;
}

.btn-highlight-charts.active {
  background: var(--primary-gradient);
  border-color: var(--primary-navy);
  color: #ffffff;
}

.btn-highlight-charts.active i {
  color: #bfdbfe;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

.tab-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tab-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-num {
  background: var(--accent-gold);
  color: var(--primary-navy);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.tab-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   BARRA DE HERRAMIENTAS DE REPORTES (FILTROS)
   ========================================================================== */
.reports-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.period-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.select-period {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-navy);
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   CUADRÍCULA DE GRÁFICOS (CHARTS GRID)
   ========================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.chart-header h5 {
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header h5 i {
  color: var(--accent-gold);
}

.chart-header p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-canvas-container {
  position: relative;
  width: 100%;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   TARJETAS KPI (INDICADORES CLAVE)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 260px));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-deep);
  box-shadow: var(--shadow-sm);
}

.kpi-card.gold-border {
  border-left: 4px solid var(--accent-gold);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-val {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1.25;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-sub.positive,
.positive {
  color: #059669 !important;
  font-weight: 600;
}

.kpi-sub.warning,
.warning {
  color: #d97706 !important;
  font-weight: 600;
}

/* ==========================================================================
   TABLAS DE DATOS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  background: #ffffff;
  border: 1.5px solid #000000;
}

.data-table th {
  background: #f1f5f9;
  color: #000000;
  font-weight: 700;
  padding: 10px 14px;
  border: 1.5px solid #000000;
  white-space: nowrap;
  font-size: 12px;
}

.data-table td {
  padding: 10px 14px;
  border: 1px solid #222222;
  color: #000000;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f0f4ff;
}

.data-table tbody tr:last-child td {
  border-bottom: 1.5px solid #000000;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* Badges de Estado */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.status-paid,
.status-completed {
  background: #ecfdf5;
  color: #059669;
}

.status-pending {
  background: #fffbeb;
  color: #b45309;
}

.status-active {
  background: #eff6ff;
  color: #1d4ed8;
}

/* ==========================================================================
   TABLA DE VENTAS DIARIAS (15 COLUMNAS OPERATIVAS) & TFOOT TOTALES
   ========================================================================== */
.kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 260px));
  gap: 10px;
}

.table-sales-responsive {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.data-table-sales {
  min-width: 1380px;
  font-size: 12px;
  border-collapse: collapse;
  width: 100%;
}

.data-table-sales th {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 10px;
  border-bottom: 2px solid #2563eb;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.data-table-sales th.col-highlight {
  background: #1e3a5f;
  color: #ffffff;
}

.data-table-sales td {
  padding: 8px 10px;
  border: 1px solid #222222;
  color: #000000;
  white-space: nowrap;
}

.data-table-sales td.col-highlight {
  background: #fffbeb;
  font-weight: 700;
  color: #000000;
}

.data-table-sales tbody tr:hover td.col-highlight {
  background: #fef3c7;
}

.data-table-sales tfoot {
  background: #091728;
  border-top: 3px solid var(--accent-gold);
}

.data-table-sales tfoot td {
  padding: 11px 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid #333333;
  border-top: none;
}

.data-table-sales tfoot .total-gold {
  color: var(--accent-gold) !important;
  font-weight: 800;
  font-size: 13px;
}

.badge-day {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--primary-navy);
}

.badge-day.weekend {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.row-sales-zero {
  opacity: 0.5;
  background: #fafbfc;
}

.row-sales-zero:hover {
  opacity: 0.9;
}

.modal-box-lg {
  max-width: 640px !important;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Barras de Participación de Productos */
.rank-num {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  background: var(--surface-alt);
  border-radius: 50%;
  text-align: center;
  font-weight: 700;
  color: var(--primary-navy);
  font-size: 12px;
}

.rank-top {
  background: var(--accent-gold);
  color: #ffffff;
}

.share-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.share-bar-bg {
  flex: 1 1 auto !important;
  min-width: 30px !important;
  height: 8px !important;
  background: #e2e8f0 !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.share-bar-fill {
  height: 100% !important;
  background: linear-gradient(90deg, var(--primary-deep, #0f2b48) 0%, var(--accent-gold, #cda45e) 100%) !important;
  border-radius: 4px !important;
}

.share-percent {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  min-width: 44px !important;
  width: 44px !important;
  text-align: right !important;
  white-space: nowrap !important;
  flex: 0 0 44px !important;
}

/* Cuadro de Diagnóstico DC Asesorías */
.advisor-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 5px solid var(--accent-gold);
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.advisor-box.rentable {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-left-color: #16a34a;
}

.advisor-box.alerta {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: #d97706;
}

.advisor-box.perdida {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left-color: #dc2626;
}

.advisor-box.sin-datos {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left-color: #64748b;
}

.advisor-verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.advisor-verdict-badge.rentable {
  background: #16a34a;
  color: #ffffff;
}

.advisor-verdict-badge.alerta {
  background: #d97706;
  color: #ffffff;
}

.advisor-verdict-badge.perdida {
  background: #dc2626;
  color: #ffffff;
}

.advisor-verdict-badge.sin-datos {
  background: #64748b;
  color: #ffffff;
}

.advisor-box h5 {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.advisor-box p {
  font-size: 15.5px;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 10px;
}

.advisor-metrics-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.summary-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.advisor-recommendation {
  background: rgba(255, 255, 255, 0.85);
  border-left: 3px solid var(--accent-gold);
  padding: 10px 14px;
  border-radius: 4px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
}

/* ==========================================================================
   MODAL FLOTANTE
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 25, 44, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  z-index: 10000;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 26px 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.25s ease-out;
  margin: auto;
  position: relative;
}

.modal-box-scrollable {
  max-height: calc(100vh - 48px) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.modal-box-scrollable .modal-header {
  padding: 16px 22px;
  margin-bottom: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
}

.modal-box-scrollable .modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.modal-box-scrollable .modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h5 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: var(--primary-navy);
}

.modal-actions {
  margin-top: 22px;
}

/* ==========================================================================
   PIE DE PÁGINA DEL DASHBOARD
   ========================================================================== */
.dash-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 11.5px;
  color: var(--text-light);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999999 !important;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.5px;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 5px solid #64748b;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success {
  border-left-color: var(--color-success);
}
.toast.toast-success i {
  color: var(--color-success);
}

.toast.toast-error {
  border-left-color: var(--color-error);
}
.toast.toast-error i {
  color: var(--color-error);
}

.toast.toast-info {
  border-left-color: var(--primary-deep);
}
.toast.toast-info i {
  color: var(--primary-deep);
}

/* ==========================================================================
   RESPONSIVIDAD & IMPRESIÓN
   ========================================================================== */
@media (max-width: 768px) {
  .dashboard-card {
    padding: 20px 16px;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .dash-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .tab-content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .reports-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .role-quick-buttons {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  .tabs-nav-wrapper,
  .btn,
  .topbar-actions,
  .toast-container,
  .modal-backdrop,
  .master-only {
    display: none !important;
  }

  .dashboard-card {
    box-shadow: none !important;
    padding: 0 !important;
  }

  .charts-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}




/* Badge de Empresa y Correo Vinculado en Barra Superior */
.badge-company-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-company-pill strong {
  color: #ffffff;
}

.topbar-email-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}


/* Período de Auditoría y badges en la cabecera */
.profile-timestamp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.profile-top-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.system-audit-badge span,
.system-audit-badge strong,
.system-audit-badge #lbl-audit-period-range {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.system-audit-badge i {
  color: #ffffff !important;
}

/* Tarjeta informativa de usuario Lite en el registro de empresas */
.role-lite-notice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.role-notice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-notice-desc {
  font-size: 12.5px;
  color: #334155;
  margin: 0;
  line-height: 1.45;
}

.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* -- KPI Ventas Diarias - Comparativos -- */
.kpi-grid-sales {
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-grid-sales .kpi-card {
  padding: 16px 18px;
  gap: 4px;
}
.kpi-grid-sales .kpi-val {
  font-size: 19px;
}
@media (max-width: 1100px) {
  .kpi-grid-sales { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid-sales { grid-template-columns: 1fr; }
}
.kpi-comparatives {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}
.kpi-comp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #334155;
  flex-wrap: wrap;
}
.kpi-comp-row i {
  color: #4f46e5;
  font-size: 0.85rem;
}
.kpi-comp-label {
  font-size: 0.82rem;
  color: #334155;
  font-weight: 500;
}
.kpi-comp-val {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.88rem;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}
.kpi-comp-delta {
  font-weight: 600;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 2px;
}
.kpi-comp-delta.positive {
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}
.kpi-comp-delta.negative {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TABLA VENTAS DIARIAS — Cabeceras agrupadas y columnas organizadas
──────────────────────────────────────────────────────────────────────────────── */
.sales-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
}

.table-sales-detail {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  width: max-content;
  min-width: 100%;
}

/* Fila de grupos (nivel 1) */
.table-sales-detail .thead-group-row th {
  padding: 7px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 2;
}

.th-group {
  text-align: center !important;
  border-right: 2px solid rgba(255,255,255,0.06) !important;
}

/* Grupos con colores diferenciados y alto contraste */
.th-group-date {
  background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(148, 163, 184, 0.5) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.th-group-sales {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(96, 165, 250, 0.6) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.th-group-totals {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(251, 191, 36, 0.7) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.th-group-service {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(52, 211, 153, 0.6) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.th-group-discounts {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(254, 202, 202, 0.6) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Fila de detalle (nivel 2) */
.table-sales-detail .thead-detail-row th {
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
  color: #ffffff !important;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-top: 1px solid rgba(255,255,255,0.2);
  border-right: 1px solid rgba(255,255,255,0.12);
  position: sticky;
  top: 33px;
  z-index: 2;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
.table-sales-detail .thead-detail-row th.col-fecha,
.table-sales-detail .thead-detail-row th.col-dia {
  text-align: left;
  color: #ffffff !important;
}

/* Encabezados específicos con colores brillantes y alta legibilidad */
.table-sales-detail .thead-detail-row th.col-neg {
  color: #ffffff !important;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.table-sales-detail .thead-detail-row th.col-subtot {
  color: #e0f2fe !important;
  font-weight: 700 !important;
}
.table-sales-detail .thead-detail-row th.col-impo {
  color: #fef08a !important;
  font-weight: 700 !important;
}
.table-sales-detail .thead-detail-row th.col-total-vta {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  font-weight: 800 !important;
}
.table-sales-detail .thead-detail-row th.col-propina {
  color: #d1fae5 !important;
  font-weight: 700 !important;
}

/* Separadores de grupo en columnas */
.table-sales-detail td:nth-child(2),
.table-sales-detail th:nth-child(2) {
  border-right: 2px solid rgba(90,160,220,0.25) !important;
}
.table-sales-detail td:nth-child(7),
.table-sales-detail th:nth-child(7) {
  border-right: 2px solid rgba(90,160,220,0.25) !important;
}
.table-sales-detail td:nth-child(10),
.table-sales-detail th:nth-child(10) {
  border-right: 2px solid rgba(220,160,30,0.35) !important;
}

/* Colores especiales en columnas */
.col-fecha { font-weight: 600; white-space: nowrap; }
.col-dia   { text-align: center !important; }
tbody td.col-neg { color: #b91c1c !important; }
tbody td.col-subtot { color: #1a56a0 !important; }
tbody td.col-impo  { color: #7c5a00 !important; }
tbody td.col-total-vta { font-size: 0.88rem !important; }
tbody td.col-propina { color: #065f46 !important; }

/* Celdas del body */
.table-sales-detail tbody td {
  padding: 5px 8px;
  font-size: 0.81rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* Fila cero (sin ventas) */
.table-sales-detail tr.row-sales-zero td {
  opacity: 0.45;
}

/* TFOOT - fila de totales */
.table-sales-detail tfoot tr td {
  background: rgba(200, 150, 20, 0.12);
  border-top: 2px solid rgba(200,150,20,0.4);
  font-size: 0.8rem;
  padding: 7px 8px;
  white-space: nowrap;
}

/* Celda vacía o en cero — discreta */
.cell-zero {
  color: #000000;
  font-size: 0.76rem;
  font-weight: 400;
}

/* Badge de día de semana */
.badge-day {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.07);
  color: #ccc;
  white-space: nowrap;
}
.badge-day.weekend {
  background: rgba(240,180,30,0.18);
  color: #f0c040;
}

/* ── LÍNEAS DE CUADRÍCULA TABLA VENTAS DIARIAS ─────────────────────────────── */
.table-sales-detail {
  border-collapse: collapse !important;
}

/* Bordes en todas las celdas del cuerpo */
.table-sales-detail tbody td {
  border-right: 1px solid rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.table-sales-detail tbody td:first-child {
  border-left: 1px solid rgba(255,255,255,0.10);
}

/* Bordes en encabezados detalle */
.table-sales-detail .thead-detail-row th {
  border-right: 1px solid rgba(255,255,255,0.14) !important;
  border-bottom: 2px solid rgba(255,255,255,0.18) !important;
}
.table-sales-detail .thead-detail-row th:first-child {
  border-left: 1px solid rgba(255,255,255,0.14) !important;
}

/* Bordes en encabezados de grupo */
.table-sales-detail .thead-group-row th {
  border-right: 1px solid rgba(255,255,255,0.18) !important;
  border-bottom: 1px solid rgba(255,255,255,0.18) !important;
  border-top: 1px solid rgba(255,255,255,0.14) !important;
}
.table-sales-detail .thead-group-row th:first-child {
  border-left: 1px solid rgba(255,255,255,0.14) !important;
}

/* Bordes en fila de totales (tfoot) */
.table-sales-detail tfoot tr td {
  border-right: 1px solid rgba(255,255,255,0.12) !important;
  border-top: 2px solid rgba(200,150,20,0.55) !important;
}
.table-sales-detail tfoot tr td:first-child {
  border-left: 1px solid rgba(255,255,255,0.12) !important;
}

/* Hover en filas del body */
.table-sales-detail tbody tr:hover td {
  background: rgba(255,255,255,0.04);
}

/* Separador más grueso entre grupos de columnas */
.table-sales-detail td:nth-child(2),
.table-sales-detail .thead-detail-row th:nth-child(2) {
  border-right: 2px solid rgba(130,135,170,0.55) !important;
}
.table-sales-detail td:nth-child(7),
.table-sales-detail .thead-detail-row th:nth-child(7) {
  border-right: 2px solid rgba(50,120,200,0.55) !important;
}
.table-sales-detail td:nth-child(10),
.table-sales-detail .thead-detail-row th:nth-child(10) {
  border-right: 2px solid rgba(200,150,20,0.55) !important;
}

/* ── OVERRIDE: Bordes y texto negros en tabla grupos ventas diarias ──────── */
.table-sales-detail tbody td {
  border: 1px solid #222222 !important;
  color: #000000 !important;
  background: #ffffff;
}
.table-sales-detail tbody tr.row-sales-zero td {
  background: #f9f9f9;
  opacity: 0.6;
}
.table-sales-detail tbody tr:hover td {
  background: #f0f4ff !important;
}
/* Texto negro en columnas con colores propios — mantener solo el color de fondo */
.table-sales-detail tbody td.col-subtot { color: #1a56a0 !important; }
.table-sales-detail tbody td.col-impo   { color: #7c5a00 !important; }
.table-sales-detail tbody td.col-neg    { color: #b91c1c !important; }
.table-sales-detail tbody td.col-propina { color: #065f46 !important; }
.table-sales-detail tbody td.col-highlight { color: #000000 !important; font-weight: 400 !important; }

/* Tfoot con bordes negros */
.table-sales-detail tfoot tr td {
  border: 1.5px solid #000000 !important;
  color: #ffffff !important;
}

/* Separadores de grupo en celdas del body — mas gruesos */
.table-sales-detail tbody td:nth-child(2)  { border-right: 2px solid #444 !important; }
.table-sales-detail tbody td:nth-child(7)  { border-right: 2px solid #444 !important; }
.table-sales-detail tbody td:nth-child(10) { border-right: 2px solid #444 !important; }

/* Plazoleta de San Antonio: separadores y anchos para tabla de 10 columnas */
.table-sales-detail.table-sales-pdsa tbody td:nth-child(7) {
  border-right: 1px solid rgba(255,255,255,0.08) !important;
}
.table-sales-detail.table-sales-pdsa tbody td:nth-child(10) {
  border-right: 1px solid rgba(255,255,255,0.08) !important;
}
.table-sales-detail.table-sales-pdsa tbody td:nth-child(5) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-sales-pdsa tbody td:nth-child(8) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-sales-pdsa .col-pdsa-otros {
  max-width: 85px !important;
  width: 85px !important;
}

/* Plazoleta de San Antonio: separadores para tabla de productos diarios (9 columnas) */
.table-sales-detail.table-daily-prod-pdsa tbody td:nth-child(2) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-daily-prod-pdsa tbody td:nth-child(3) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-daily-prod-pdsa tbody td:nth-child(4) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-daily-prod-pdsa tbody td:nth-child(8) {
  border-right: 2px solid #444 !important;
}

/* Plazoleta de San Antonio: separadores para tabla de compras por proveedor (5 columnas) */
.table-sales-detail.table-suppliers-pdsa tbody td:nth-child(2) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-suppliers-pdsa tbody td:nth-child(4) {
  border-right: 2px solid #444 !important;
}

/* Plazoleta de San Antonio: separadores para tabla de compras por insumos (5 columnas) */
.table-sales-detail.table-supplies-pdsa tbody td:nth-child(2) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-supplies-pdsa tbody td:nth-child(4) {
  border-right: 2px solid #444 !important;
}

/* Plazoleta de San Antonio: separadores para tabla de costos de compras (8 columnas) */
.table-sales-detail.table-purchase-costs-pdsa tbody td:nth-child(2) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-purchase-costs-pdsa tbody td:nth-child(4) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-purchase-costs-pdsa tbody td:nth-child(5) {
  border-right: 2px solid #444 !important;
}

/* Plazoleta de San Antonio: separadores para tabla de costos de ventas (9 columnas) */
.table-sales-detail.table-cogs-pdsa tbody td:nth-child(2) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-cogs-pdsa tbody td:nth-child(4) {
  border-right: 2px solid #444 !important;
}
.table-sales-detail.table-cogs-pdsa tbody td:nth-child(7) {
  border-right: 2px solid #444 !important;
}

/* ── TFOOT COLOR FIX */

/* ── Columna DIA: texto negro en badge-day ─────────────────────────────────── */
.table-sales-detail .badge-day,
.badge-day {
  color: #111111 !important;
  background: rgba(0,0,0,0.08) !important;
  font-weight: 700;
}
.table-sales-detail .badge-day.weekend,
.badge-day.weekend {
  background: rgba(180,120,0,0.18) !important;
  color: #7c4a00 !important;
}

/* ── Fila TOTALES ACUMULADOS (tfoot): fondo claro, texto negro ─────────────── */
.table-sales-detail tfoot tr td {
  background: #e8edf2 !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
}
/* Celda Total Vta en tfoot: fondo claro suave de alto contraste y números nítidos */
.table-sales-detail tfoot tr td.col-highlight,
.table-sales-detail tfoot tr td.total-gold {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 800 !important;
}

/* ── COMPACTAR tabla ventas diarias ─────────────────────────────────────────── */
.table-sales-detail {
  font-size: 0.76rem !important;
}
.table-sales-detail tbody td {
  padding: 4px 6px !important;
  font-size: 0.76rem !important;
  white-space: nowrap;
}
.table-sales-detail .thead-detail-row th {
  padding: 5px 6px !important;
  font-size: 0.70rem !important;
}
.table-sales-detail .thead-group-row th {
  padding: 5px 8px !important;
  font-size: 0.70rem !important;
}
.table-sales-detail tfoot tr td {
  padding: 5px 6px !important;
  font-size: 0.74rem !important;
}

/* ==========================================================================
   TABLA FORMAS DE PAGO — Columnas y filas compactas y organizadas
   ========================================================================== */
.kpi-grid-pm {
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-grid-pm .kpi-card {
  padding: 10px 14px;
  gap: 2px;
}
.kpi-grid-pm .kpi-val {
  font-size: 17px;
}
.kpi-grid-pm .kpi-label {
  font-size: 11px;
}
.kpi-grid-pm .kpi-sub {
  font-size: 11px;
}

.pm-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  max-width: 100%;
}

.table-pm-detail {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.75rem !important;
  width: max-content;
  min-width: 100%;
  border: 1.5px solid #222222;
}

/* Fila de grupos (nivel 1) */
.table-pm-detail .thead-group-row th {
  padding: 6px 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: none;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.table-pm-detail .th-group-folios {
  background: rgba(80, 60, 140, 0.70) !important;
  color: #ede9fe !important;
  border-left: 2px solid rgba(139, 92, 246, 0.45) !important;
}

.table-pm-detail .th-group-cxc {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important;
  color: #ffffff !important;
  border-left: 2px solid rgba(251, 191, 36, 0.7) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Fila de detalle (nivel 2) */
.table-pm-detail .thead-detail-row th {
  padding: 5px 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  text-align: right;
  color: #ffffff !important;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 26px;
  z-index: 2;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.table-pm-detail .thead-detail-row th.col-fecha,
.table-pm-detail .thead-detail-row th.col-dia {
  text-align: center;
  color: #ffffff !important;
}

.table-pm-detail thead .thead-detail-row th.col-cxc {
  color: #fef3c7 !important;
  background: linear-gradient(135deg, #92400e 0%, #78350f 100%) !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.table-pm-detail tbody td.col-cxc {
  color: #92400e !important;
  font-weight: 700 !important;
}

.table-pm-detail tfoot tr td.col-cxc {
  color: #78350f !important;
  font-weight: 800 !important;
  background: #fef3c7 !important;
}

/* Celdas del cuerpo */
.table-pm-detail tbody td {
  padding: 3.5px 5px !important;
  font-size: 0.75rem !important;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.25;
  border: 1px solid #222222 !important;
  color: #000000 !important;
  background: #ffffff;
}

/* Reducir tamaño del badge del día */
.table-pm-detail .badge-day {
  padding: 1px 5px !important;
  font-size: 10px !important;
  line-height: 1.2;
}

/* Separadores de grupo en columnas */
.table-pm-detail td:nth-child(2),
.table-pm-detail .thead-detail-row th:nth-child(2) {
  border-right: 2px solid #333333 !important;
}
.table-pm-detail td:nth-child(3),
.table-pm-detail .thead-detail-row th:nth-child(3) {
  border-right: 2px solid #333333 !important;
}
.table-pm-detail td:nth-child(6),
.table-pm-detail .thead-detail-row th:nth-child(6) {
  border-right: 2px solid #333333 !important;
}

/* Fila cero */
.table-pm-detail tr.row-sales-zero td {
  background: #f9f9f9;
  opacity: 0.55;
}

/* TFOOT - fila de totales */
.table-pm-detail tfoot tr td {
  background: #e8edf2 !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
  font-size: 0.75rem !important;
  padding: 4px 5px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.table-pm-detail tfoot tr td.col-highlight {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 800 !important;
}

/* Hover de filas */
.table-pm-detail tbody tr:hover td {
  background: #f0f4ff !important;
}



/* ==========================================================================
   PANEL MASTER: SELECCIÓN Y GESTIÓN MULTIEMPRESA
   ========================================================================== */
.master-companies-card {
  width: 100%;
  max-width: 100% !important;
  margin: 10px auto 30px;
  background: #ffffff;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 28px 32px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.master-companies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 24px;
}

.master-header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.master-panel-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-navy, #0B192C);
  margin-bottom: 4px;
}

.master-panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-light, #64748b);
  margin: 0;
}

.master-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.master-companies-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.master-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.master-search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light, #64748b);
  font-size: 14px;
}

.master-search-wrap .search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 13px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #000000;
  transition: all 0.2s ease;
}

.master-search-wrap .search-input:focus {
  border-color: var(--accent-gold, #c9a227);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.badge-count {
  background: #f1f5f9;
  color: var(--primary-navy, #0B192C);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color, #e2e8f0);
}

/* Selector de Modo de Visualización (Lista vs Cuadrícula) */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.btn-view-mode {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-view-mode:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.btn-view-mode.active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

body.theme-modern-slate .btn-view-mode.active {
  color: #2563eb;
}

/* ==========================================================================
   MODO LISTA COMPACTA DE EMPRESAS (PANEL MASTER)
   ========================================================================== */
.master-companies-grid.is-list-view {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

.company-row-master {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-left: 5px solid #0d9488;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.company-row-master:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.company-row-master.is-master-company {
  border-left-color: var(--accent-gold, #f59e0b) !important;
  background: linear-gradient(90deg, #fffdf8 0%, #ffffff 100%);
}

.company-row-master.is-terminated {
  border-left-color: #cbd5e1 !important;
  background: #f8fafc;
  opacity: 0.88;
}

.company-row-master.is-sandbox-company {
  border-left-color: #6366f1 !important;
  background: linear-gradient(90deg, #fafafe 0%, #ffffff 100%);
}

/* Lado Principal (Icono + Ficha) */
.company-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.company-row-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1.5px solid #ccfbf1;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.company-row-master.is-master-company .company-row-icon {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.company-row-master.is-sandbox-company .company-row-icon {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

.company-row-info {
  flex: 1;
  min-width: 0;
}

.company-row-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.company-row-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.company-row-meta-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
}

.company-row-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.company-row-meta-item i {
  color: #64748b;
  font-size: 11.5px;
}

/* Barra de Botones de Acción en Cada Fila */
.company-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-row-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1.5px solid transparent;
  background: transparent;
  text-decoration: none;
}

.btn-row-action:hover {
  transform: translateY(-1px);
}

/* Botón Entrar en Modo Lista */
.btn-row-enter {
  background: #ffffff !important;
  border: 2px solid #2563eb !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12) !important;
}

.btn-row-enter:hover {
  background: #eff6ff !important;
  border-color: #1e40af !important;
  color: #1e3a8a !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2) !important;
}

/* Botón Ver */
.btn-row-action.btn-row-view,
.btn-row-action.btn-outline-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.btn-row-action.btn-row-view:hover,
.btn-row-action.btn-outline-primary:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* Botón Editar */
.btn-row-action.btn-row-edit,
.btn-row-action.btn-outline-info {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}
.btn-row-action.btn-row-edit:hover,
.btn-row-action.btn-outline-info:hover {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #115e59;
}

/* Botón Módulos */
.btn-row-action.btn-row-modules,
.btn-row-action.btn-outline-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.btn-row-action.btn-row-modules:hover,
.btn-row-action.btn-outline-warning:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* Botón Clave */
.btn-row-action.btn-row-pass,
.btn-row-action.btn-outline-dark {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-row-action.btn-row-pass:hover,
.btn-row-action.btn-outline-dark:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Botón Terminar */
.btn-row-action.btn-row-terminate,
.btn-row-action.btn-outline-secondary {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}
.btn-row-action.btn-row-terminate:hover,
.btn-row-action.btn-outline-secondary:hover {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

/* Botón Reactivar */
.btn-row-action.btn-row-reactivate,
.btn-row-action.btn-outline-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.btn-row-action.btn-row-reactivate:hover,
.btn-row-action.btn-outline-success:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Botón Eliminar */
.btn-row-action.btn-row-delete,
.btn-row-action.btn-danger-outline {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  padding: 6px 9px;
}
.btn-row-action.btn-row-delete:hover,
.btn-row-action.btn-danger-outline:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

@media (max-width: 960px) {
  .company-row-master {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .company-row-actions {
    justify-content: flex-start !important;
    border-top: 1px dashed #e2e8f0 !important;
    padding-top: 10px !important;
  }
}

.master-companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.company-card-master {
  background: #ffffff;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.company-card-master:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  border-color: var(--accent-gold, #c9a227);
}

.company-card-master.is-master-company {
  border-color: var(--accent-gold, #c9a227);
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
}

.company-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.company-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--primary-navy, #0B192C);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.company-card-master.is-master-company .company-card-icon {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 100%);
  color: var(--accent-gold, #c9a227);
}

.company-card-title-wrap {
  flex: 1;
}

.company-card-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
  line-height: 1.3;
}

.badge-company-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-company-type.lite {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-company-type.master {
  background: #fffbeb;
  color: #b45309;
}

.company-card-details {
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 0;
  margin-bottom: 16px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475569;
}

.company-card-details strong {
  color: #000000;
}

.company-card-details .detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.company-card-details .detail-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.company-card-details .detail-item i {
  width: 14px;
  color: var(--accent-gold, #c9a227);
  flex-shrink: 0;
}

.company-card-footer {
  margin-top: auto;
}

.btn-enter-company {
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

/* ==========================================================================
   NAVEGACIÓN MASTER: DIRECTORIO vs TORRE DE CONTROL MULTI-EMPRESA
   ========================================================================== */
.master-subview-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.master-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.96rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: -2px;
}

.master-nav-tab:hover {
  color: var(--primary-navy, #0f4c5c);
  background: rgba(15, 76, 92, 0.04);
  border-radius: 8px 8px 0 0;
}

.master-nav-tab.active {
  color: var(--primary-navy, #0f4c5c);
  border-bottom-color: var(--accent-gold, #f59e0b);
  background: rgba(13, 148, 136, 0.06);
  border-radius: 8px 8px 0 0;
}

.nav-tag-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0d9488 0%, #0f4c5c 100%);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(13, 148, 136, 0.25);
}

.master-subview-panel {
  width: 100%;
  animation: fadeIn 0.25s ease-in-out;
}

/* ==========================================================================
   TORRE DE CONTROL MULTI-EMPRESA (DASHBOARD CONSOLIDADO)
   ========================================================================== */
.tower-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.tower-toolbar-left,
.tower-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.tower-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tower-control-group label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tower-select {
  height: 38px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px;
  transition: all 0.2s ease;
}

.tower-select:focus {
  border-color: var(--primary-blue, #0d9488);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.tower-search-wrap {
  position: relative;
  min-width: 240px;
}

.tower-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
}

.tower-search-wrap .search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.tower-search-wrap .search-input:focus {
  border-color: var(--primary-blue, #0d9488);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.tower-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
}

/* KPIs Consolidados */
.tower-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.tower-kpi-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tower-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.tower-kpi-card.highlight-card {
  background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #86efac;
}

.tower-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tower-kpi-icon.icon-teal {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
}

.tower-kpi-icon.icon-gold {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.tower-kpi-icon.icon-amber {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.tower-kpi-icon.icon-navy {
  background: rgba(15, 76, 92, 0.12);
  color: #0f4c5c;
}

.tower-kpi-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.tower-kpi-content {
  flex: 1;
  min-width: 0;
}

.tower-kpi-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.tower-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.tower-kpi-desc {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

/* Semáforo de Salud */
.tower-health-banner {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.health-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  color: #1e293b;
}

.health-summary-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.health-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.health-summary-chip.chip-healthy {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.health-summary-chip.chip-caution {
  background: #fefce8;
  color: #a16207;
  border-color: #fef08a;
}

.health-summary-chip.chip-warning {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.health-summary-chip.chip-critical {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.health-summary-chip.chip-empty {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Tabla Ejecutiva */
.tower-table-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tower-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.tower-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.tower-table thead th {
  background: #0f4c5c;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 2px solid #08333e;
}

.tower-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.tower-table tbody tr:hover {
  background-color: #f0fdfa;
}

.tower-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: #1e293b;
}

.tower-table tfoot td {
  background: #f8fafc;
  font-weight: 800;
  border-top: 2px solid #cbd5e1;
  padding: 14px;
  color: #0f172a;
}

.table-company-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.table-company-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 15.5px;
}

.table-company-sub {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.metric-pill.pill-good {
  background: #dcfce7;
  color: #15803d;
}

.metric-pill.pill-warn {
  background: #fef3c7;
  color: #b45309;
}

.metric-pill.pill-bad {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-health-pill.healthy {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-health-pill.caution {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.badge-health-pill.warning {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-health-pill.critical {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-health-pill.neutral {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.btn-tower-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--primary-navy, #0f4c5c);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tower-enter:hover {
  background: var(--primary-blue, #0d9488);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(13, 148, 136, 0.3);
}

/* ==========================================================================
   BARRA DE FILTROS EN MÓDULOS (FECHA Y GRUPO)
   ========================================================================== */
.module-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.module-filter-bar .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-filter-bar .filter-group label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.module-filter-bar .filter-group label i {
  color: var(--primary-navy, #1e3a5f);
  font-size: 14px;
}

.module-filter-bar .filter-select {
  height: 38px;
  padding: 6px 30px 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  min-width: 200px;
  max-width: 280px;
  transition: all 0.2s ease;
}

.module-filter-bar .filter-select:focus {
  border-color: #1e3e62;
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 62, 98, 0.15);
}

.module-filter-bar .filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.module-filter-bar .filter-count-badge {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.module-filter-bar .btn-reset-filter {
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 6px;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.module-filter-bar .btn-reset-filter:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ==========================================================================
   FILTRO DE RANGO DE FECHAS (MÓDULO VENTAS DIARIAS)
   ========================================================================== */
.date-range-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.date-range-filter-bar .filter-bar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-navy, #1e3a5f);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.date-range-filter-bar .filter-inputs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-range-filter-bar .filter-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.date-range-filter-bar .filter-date-input {
  height: 34px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.date-range-filter-bar .filter-date-input:focus {
  border-color: #1e3e62;
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 62, 98, 0.12);
}

.date-range-filter-bar .filter-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-filter-bar .filter-actions-group button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  border-radius: 6px;
}

.date-range-filter-bar .filter-active-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.date-range-filter-bar .filter-active-badge.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .date-range-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .date-range-filter-bar .filter-inputs-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .date-range-filter-bar .filter-input-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .date-range-filter-bar .filter-date-input {
    width: 100%;
  }
  .date-range-filter-bar .filter-actions-group {
    display: flex;
    gap: 8px;
  }
  .date-range-filter-bar .filter-actions-group button {
    flex: 1;
    justify-content: center;
  }
  .date-range-filter-bar .filter-active-badge {
    margin-left: 0;
    align-self: flex-start;
  }
}


/* ==========================================================================
   PWA & MOBILE APP INSTALL BANNER & STYLES
   ========================================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: linear-gradient(135deg, #0B192C 0%, #172B4D 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99999;
  animation: slideUpPwa 0.35s ease-out;
}
@keyframes slideUpPwa {
  from { transform: translate(-50%, 120%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #D4AF37;
  object-fit: cover;
  flex-shrink: 0;
}
.pwa-banner-text {
  min-width: 0;
}
.pwa-banner-text strong {
  color: #ffffff;
  font-size: 0.90rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-banner-text p {
  color: #94a3b8;
  font-size: 0.76rem;
  margin: 2px 0 0 0;
  line-height: 1.25;
}
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-pwa-install-action {
  background: linear-gradient(135deg, #D4AF37 0%, #F3C623 100%);
  color: #0B192C;
  font-weight: 700;
  font-size: 0.82rem;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-pwa-install-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-pwa-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-pwa-close:hover {
  color: #ffffff;
}

.btn-install-pwa {
  display: none; /* Se muestra automáticamente al detectar dispositivo */
}
.pwa-guide-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}
.pwa-guide-box h5 {
  font-size: 0.90rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   BOTONES DE ACCIÓN MASTER: BORRADO, TERMINACIÓN Y ESTADOS
   ========================================================================== */
.btn-danger {
  background: #dc2626;
  color: #ffffff !important;
  border: 1px solid #b91c1c;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: #fef2f2;
  color: #dc2626 !important;
  border: 1.5px solid #fecaca;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  transition: all 0.2s ease;
}
.btn-danger-outline:hover {
  background: #dc2626;
  color: #ffffff !important;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

.btn-outline-warning {
  background: #fffbeb;
  color: #b45309 !important;
  border: 1.5px solid #fde68a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  transition: all 0.2s ease;
}
.btn-outline-warning:hover {
  background: #f59e0b;
  color: #ffffff !important;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-outline-success {
  background: #ecfdf5;
  color: #047857 !important;
  border: 1.5px solid #a7f3d0;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  transition: all 0.2s ease;
}
.btn-outline-success:hover {
  background: #10b981;
  color: #ffffff !important;
  border-color: #10b981;
  transform: translateY(-1px);
}

.btn-outline-info {
  background: #f0f9ff;
  color: #0369a1 !important;
  border: 1.5px solid #bae6fd;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  transition: all 0.2s ease;
}
.btn-outline-info:hover {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.btn-xs {
  padding: 5px 9px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

/* FILTROS SEGMENTADOS DE ESTADO DE EMPRESAS (PANEL MASTER) */
.company-status-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
}
.status-filter-pill {
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.status-filter-pill:hover {
  color: var(--primary-navy);
}
.status-filter-pill.active {
  background: #ffffff;
  color: var(--primary-navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.status-filter-pill .pill-count {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.status-filter-pill.active .pill-count {
  background: var(--primary-navy);
  color: #ffffff;
}

/* BADGES DE CONTRATO ACTIVO / TERMINADO EN TARJETAS */
.badge-status-contract {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.badge-status-contract.active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.badge-status-contract.terminated {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.company-card-master.is-terminated {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.company-card-master.is-terminated .company-card-name {
  color: #64748b;
}

.company-card-subactions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.contract-notice-banner {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  color: #9a3412;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contract-notice-banner i {
  font-size: 16px;
  color: #ea580c;
}

/* ==========================================================================
   ELEMENTOS DE AUTENTICACIÓN DUAL (POR DEFECTO OCULTOS EN MÓVILES Y APPS)
   ========================================================================== */
.auth-hero-panel {
  display: none !important;
}
.auth-social-footer {
  display: block !important;
  margin-top: 18px;
  text-align: center;
  width: 100%;
}

.auth-divider-line {
  position: relative;
  text-align: center;
  margin-bottom: 12px;
}

.auth-divider-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e2e8f0;
  z-index: 1;
}

.auth-divider-line span {
  position: relative;
  z-index: 2;
  background: #ffffff;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
}

.auth-social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.social-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.social-icon-btn.whatsapp {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #10b981;
}

.social-icon-btn.instagram {
  background: #fdf2f8;
  border: 1.5px solid #fbcfe8;
  color: #ec4899;
}

.social-icon-btn.email {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: var(--primary-navy);
}

.social-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.header-pretitle-web {
  display: none !important;
}
.auth-forms-panel {
  width: 100%;
}

/* ==========================================================================
   MODELO PANTALLA COMPLETA LIMPIA PARA VERSIÓN WEB Y MÓVIL
   ========================================================================== */
@media (min-width: 768px) {
  /* Fondo limpio y pantalla completa para la versión web (sin fondo azul) */
  body.is-web-version:not(.is-mobile-app) {
    background: #f8fafc !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Modo Pantalla Completa De Borde a Borde SOLO PARA LOGIN */
  body.is-web-version:not(.is-mobile-app).auth-screen-active:not(.register-screen-active) {
    height: 100vh !important;
    max-height: 100vh !important;
    width: 100vw !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  /* Desplazamiento completo, fluido y natural en Dashboard y Panel Master */
  body.is-web-version:not(.is-mobile-app):not(.auth-screen-active):not(.register-screen-active) {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 0 60px 0 !important;
    background: #f8fafc !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.is-web-version:not(.is-mobile-app):not(.auth-screen-active):not(.register-screen-active) .app-container {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ==========================================================================
     VISTA DE REGISTRO / CREAR EMPRESA — PANTALLA COMPLETA DESPLAZABLE
     ========================================================================== */
  body.register-screen-active,
  body:has(#register-view:not(.hidden)) {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding: 30px 16px 80px !important;
    background: #f1f5f9 !important;
  }

  body.register-screen-active .app-container,
  body:has(#register-view:not(.hidden)) .app-container {
    max-width: 820px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.register-screen-active #auth-section,
  body:has(#register-view:not(.hidden)) #auth-section,
  #auth-section.auth-card-register {
    max-width: 820px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 32px 36px 40px !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
    border: 1px solid #cbd5e1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  body.register-screen-active .auth-forms-panel,
  body:has(#register-view:not(.hidden)) .auth-forms-panel {
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
  }

  body.register-screen-active #auth-hero-panel,
  body:has(#register-view:not(.hidden)) #auth-hero-panel {
    display: none !important;
  }

  /* Cabecera con botón cancelar superior */
  .register-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid #e2e8f0;
  }

  .view-header-left {
    flex: 1;
  }

  .btn-cancel-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 4px;
  }

  .btn-cancel-top:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    transform: translateY(-1px);
  }


  body.is-web-version:not(.is-mobile-app) .app-container.auth-web-mode {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    height: 100vh !important;
    max-height: 100vh !important;
    width: 100vw !important;
  }

  /* PANEL IZQUIERDO HERO (Degradado Teal gastronómico profundo Edge-to-Edge 58%) */
  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .auth-hero-panel {
    display: flex !important;
    flex: 0 0 58% !important;
    width: 58% !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #092837 0%, #051923 60%, #020b10 100%) !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 26px 40px 20px 40px !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #ffffff !important;
    text-align: center !important;
  }

  /* Formas decorativas fluidas orgánicas de fondo */
  .hero-decorative-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.28;
  }
  .blob-1 {
    width: 320px;
    height: 320px;
    background: #0d9488;
    top: -80px;
    left: -80px;
  }
  .blob-2 {
    width: 300px;
    height: 300px;
    background: #f59e0b;
    bottom: -60px;
    right: -60px;
  }
  .blob-3 {
    width: 160px;
    height: 160px;
    background: #2dd4bf;
    top: 50%;
    left: 20%;
    opacity: 0.20;
  }

  /* Barra superior del hero con indicador de ecosistema */
  .hero-top-bar {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: 8px;
  }

  .hero-ecosystem-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #2dd4bf;
    user-select: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  }

  .hero-ecosystem-tag .hero-status-dot {
    color: #34d399;
    font-size: 9px;
  }

  /* Contenido centrado del hero */
  .hero-inner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 660px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 6px 0;
  }

  .hero-cloud-pill {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
  }

  .hero-brand-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 4px;
  }

  .hero-brand-mini-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.45));
  }

  .hero-logo-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    filter: drop-shadow(0 0 25px rgba(45, 212, 191, 0.45));
  }

  .hero-emblem-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    display: block;
  }

  .hero-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5eead4;
    margin-bottom: 2px;
  }

  .hero-main-heading {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    color: #ffffff;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .hero-description {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 400;
    max-width: 440px;
    margin: 0 auto 8px auto;
  }

  /* ========================================================
     COMPOSICIÓN DE DISPOSITIVOS: LAPTOP + SMARTPHONE REAL
     ======================================================== */
  .devices-composition-wrap {
    position: relative;
    width: 100%;
    max-width: 630px;
    height: 385px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0 auto;
  }

  /* Marco de Laptop / PC en fondo (Más amplio y nítido) */
  .desktop-device-frame {
    position: absolute;
    left: 0;
    top: 15px;
    width: 470px;
    height: 290px;
    background: #091728;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(2, 132, 199, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 3;
    transform: perspective(900px) rotateY(4deg) rotateX(2deg);
    transition: all 0.35s ease;
  }

  .desktop-device-frame:hover {
    transform: perspective(900px) rotateY(0deg) rotateX(0deg) scale(1.02);
    border-color: var(--accent-gold);
  }

  .desktop-top-bar {
    height: 22px;
    background: #0b1a2e;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dot { width: 7px; height: 7px; border-radius: 50%; }
  .dot-red { background: #ef4444; }
  .dot-yellow { background: #f59e0b; }
  .dot-green { background: #10b981; }

  .desktop-bar-url {
    font-size: 0.60rem;
    color: #94a3b8;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .desktop-img-content {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    background: #fff;
  }

  /* Marco de Smartphone Celular en primer plano (Más grande y definido) */
  .smartphone-device-frame {
    position: absolute;
    right: 10px;
    bottom: -4px;
    width: 200px;
    height: 365px;
    background: #050b14;
    border: 3.5px solid #223753;
    border-radius: 34px;
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 6;
    transform: perspective(900px) rotateY(-6deg) rotateX(2deg);
    transition: all 0.35s ease;
  }

  .smartphone-device-frame:hover {
    transform: perspective(900px) rotateY(0deg) rotateX(0deg) scale(1.04);
    border-color: var(--accent-gold);
  }

  .phone-top-island {
    height: 16px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .phone-camera-dot {
    width: 44px;
    height: 7px;
    background: #111;
    border-radius: 5px;
  }

  .phone-img-content {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    background: #fff;
  }

  .phone-bottom-bar {
    height: 12px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .phone-home-indicator {
    width: 45px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    opacity: 0.6;
  }

  /* Badges Flotantes */
  .floating-pill {
    position: absolute;
    background: rgba(7, 19, 36, 0.92);
    border: 1.5px solid var(--accent-gold);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 8;
    animation: floatBadge 3.2s infinite ease-in-out;
  }

  .pill-pos-1 { top: 2px; left: 10px; }
  .pill-pos-2 { bottom: -4px; left: 20px; animation-delay: 1.6s; border-color: #38bdf8; }

  @keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }

  .hero-bottom-bar {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
  }

  .hero-status-left {
    font-size: 11.5px;
    font-weight: 600;
    color: #99f6e4;
  }

  .hero-status-right {
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .hero-status-dot {
    color: #34d399;
    font-size: 10px;
  }

  /* PANEL DERECHO DE FORMULARIO Edge-to-Edge 42% */
  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .auth-forms-panel {
    flex: 0 0 42% !important;
    width: 42% !important;
    height: 100vh !important;
    padding: 44px 45px 24px 45px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: #ffffff !important;
    overflow-y: auto !important;
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web #login-view {
    max-width: 440px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  /* Ocultar la cabecera repetida en vista web */
  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .brand-header {
    display: none !important;
  }

  /* Encabezado limpio de login */
  body.is-web-version:not(.is-mobile-app) .header-pretitle-web {
    display: block !important;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  body.is-web-version:not(.is-mobile-app) .login-header-clean .view-title {
    font-size: 24px;
    font-weight: 800;
    color: #0b192c;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
    text-align: center;
  }

  body.is-web-version:not(.is-mobile-app) .login-header-clean .view-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 22px;
    text-align: center;
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .form-group {
    margin-bottom: 16px;
    width: 100%;
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
  }

  /* Inputs estilizados con borde suave y fondo limpio */
  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .input-icon-wrapper input {
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding-left: 42px;
    height: 48px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .input-icon-wrapper input:focus {
    background: #ffffff;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
  }

  body.is-web-version:not(.is-mobile-app) .auth-card.auth-card-web .input-icon-wrapper .input-icon {
    color: #1e3a5f;
    font-size: 14px;
    left: 13px;
  }

  body.is-web-version:not(.is-mobile-app) .field-hint {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 3px;
    margin-bottom: 10px;
    display: block;
  }

  /* Botón con degradado idéntico al modelo de referencia */
  body.is-web-version:not(.is-mobile-app) .btn-login-gradient {
    background: linear-gradient(90deg, #1e3a5f 0%, #2563eb 55%, #1d4ed8 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    height: 44px !important;
    padding: 0 20px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(30, 58, 95, 0.32) !important;
    transition: all 0.25s ease !important;
    margin-top: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  body.is-web-version:not(.is-mobile-app) .btn-login-gradient:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(30, 58, 95, 0.42) !important;
    background: linear-gradient(90deg, #162d4a 0%, #1e40af 55%, #1e3a8a 100%) !important;
  }

  /* Pie social / soporte con divisores elegantes */
  body.is-web-version:not(.is-mobile-app) .auth-social-footer {
    display: block;
    margin-top: 16px;
    text-align: center;
  }

  .auth-divider-line {
    position: relative;
    text-align: center;
    margin-bottom: 10px;
  }

  .auth-divider-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
  }

  .auth-divider-line span {
    position: relative;
    z-index: 2;
    background: #ffffff;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
  }

  .auth-social-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .social-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
  }

  .social-icon-btn.whatsapp {
    background: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #10b981;
  }

  .social-icon-btn.instagram {
    background: #fdf2f8;
    border: 1.5px solid #fbcfe8;
    color: #ec4899;
  }

  .social-icon-btn.email {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    color: var(--primary-navy);
  }

  .social-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  }
}

/* ==========================================================================
   INSIGNIA DE SINCRONIZACIÓN EN LA NUBE (WEB / ANDROID / IOS)
   ========================================================================== */
.cloud-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #86efac;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.cloud-sync-badge i {
  font-size: 12px;
}

.cloud-sync-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.15);
}

.cloud-sync-badge.syncing {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.cloud-sync-badge.syncing i {
  animation: spinCloud 1.2s linear infinite;
}

.cloud-sync-badge.offline {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.cloud-sync-badge.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

@keyframes spinCloud {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   BARRA CORPORATIVA DE CONTROL DE PERÍODO (MES Y AÑO) Y ESTADOS EN BLANCO
   ========================================================================== */
.period-control-bar {
  background: #ffffff;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(11, 25, 44, 0.05);
  border-left: 5px solid var(--accent-gold, #D4AF37);
}

.period-control-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.period-control-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--primary-navy, #0B192C);
  letter-spacing: 0.3px;
}

.period-select-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.period-select {
  padding: 7px 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--primary-navy, #0B192C);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.period-select:hover, .period-select:focus {
  border-color: var(--accent-gold, #D4AF37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  background: #ffffff;
}

.period-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.period-status-badge.has-data {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.period-status-badge.is-blank {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.period-control-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

#btn-topbar-download-excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: #ffffff;
  border: 1.5px solid var(--accent-gold-hover, #d97706);
  color: #b45309;
}

#btn-topbar-download-excel:hover {
  background: var(--accent-gold-hover, #d97706);
  border-color: var(--accent-gold-hover, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transform: translateY(-1px);
}

/* Ocultar botones redundantes inferiores en cabeceras de tablas para dejar la pastilla unificada dentro del recuadro superior */
.tab-content-header .btn-download-template {
  display: none !important;
}

.period-control-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-period-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quick-period-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light, #64748b);
  margin: 0;
}

.quick-select {
  max-width: 210px;
  font-size: 0.82rem;
}

.period-blank-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-left: 4px solid var(--accent-gold, #D4AF37);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(11, 25, 44, 0.04);
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  animation: fadeIn 0.3s ease-out;
}

.blank-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
}

.blank-banner-content i {
  font-size: 1.4rem;
  margin-top: 2px;
  color: var(--accent-gold, #D4AF37);
  flex-shrink: 0;
}

.year-over-year-section {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 2px solid #e2e8f0;
}

.tab-subtitle-bold {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-navy, #0B192C);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .period-control-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }
  .period-control-left, .period-control-right, .period-control-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* ==========================================================================
   MÓDULO: INVENTARIO DE ALIMENTOS Y MEDICAMENTOS (ESTILOS KARDEX)
   ========================================================================== */
.inventory-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.inventory-subnav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.inventory-subnav-btn:hover {
  color: var(--primary-navy);
  background: #eef4fb;
}

.inventory-subnav-btn.active {
  background: #ffffff;
  color: #0b192c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.inventory-subnav-btn .badge-count {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.inventory-subnav-btn.active .badge-count {
  background: #eef4fb;
  color: var(--primary-navy);
}

.inventory-subtab-view.hidden {
  display: none !important;
}

.badge-stock-optimal {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
}

.badge-stock-low {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
}

.badge-stock-exhausted {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
}

/* ==========================================================================
   OPTIMIZACIÓN MÓVIL, ANDROID E IOS: BOTONES Y CUADROS DE EMPRESAS COMPACTOS
   ========================================================================== */

/* 1. Estilos cuando se detecta aplicación móvil / nativa (.is-mobile-app) */
html.is-mobile-app body,
body.is-mobile-app {
  padding: 8px 8px !important;
}

.is-mobile-app .master-companies-card {
  padding: 12px 10px !important;
  margin: 6px auto 16px !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
}

.is-mobile-app .master-companies-header {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
}

.is-mobile-app .master-header-brand {
  gap: 10px !important;
}

.is-mobile-app .brand-logo-circle.mini {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border: none !important;
  filter: drop-shadow(0 2px 6px rgba(11, 25, 44, 0.2)) !important;
}

.is-mobile-app .master-panel-title {
  font-size: 0.98rem !important;
  margin-bottom: 2px !important;
  line-height: 1.25 !important;
}

.is-mobile-app .master-panel-subtitle {
  font-size: 0.74rem !important;
  line-height: 1.35 !important;
}

.is-mobile-app .master-header-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
}

.is-mobile-app .master-header-actions .cloud-sync-badge {
  padding: 4px 8px !important;
  font-size: 10.5px !important;
  height: 28px !important;
  border-radius: 12px !important;
  white-space: nowrap !important;
}

.is-mobile-app .master-header-actions #btn-master-create-company {
  padding: 4px 9px !important;
  font-size: 11px !important;
  height: 28px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  gap: 5px !important;
}

.is-mobile-app .master-header-actions #btn-master-logout {
  padding: 4px 9px !important;
  font-size: 11px !important;
  height: 28px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  gap: 5px !important;
}

.is-mobile-app .master-header-actions .btn-install-pwa {
  padding: 4px 8px !important;
  font-size: 10.5px !important;
  height: 28px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}

/* Toolbar y Filtros en app móvil */
.is-mobile-app .master-companies-toolbar {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.is-mobile-app .master-search-wrap {
  width: 100% !important;
  max-width: 100% !important;
}

.is-mobile-app .master-search-wrap .search-input {
  height: 32px !important;
  font-size: 11.5px !important;
  padding: 5px 10px 5px 30px !important;
  border-radius: 6px !important;
}

.is-mobile-app .master-search-wrap .search-icon {
  left: 10px !important;
  font-size: 12px !important;
}

.is-mobile-app .company-status-filter-pills {
  display: flex !important;
  gap: 4px !important;
  padding: 3px !important;
  border-radius: 8px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  width: 100% !important;
}

.is-mobile-app .company-status-filter-pills::-webkit-scrollbar {
  display: none !important;
}

.is-mobile-app .status-filter-pill {
  padding: 4px 8px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
  gap: 4px !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

.is-mobile-app .status-filter-pill .pill-count {
  font-size: 10px !important;
  padding: 1px 5px !important;
}

.is-mobile-app #master-companies-count-badge {
  font-size: 10.5px !important;
  padding: 3px 8px !important;
  align-self: flex-start !important;
}

/* Cuadros de empresas en app móvil: elegantes, compactos y contenidos */
.is-mobile-app .master-companies-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.is-mobile-app .company-card-master {
  padding: 10px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.is-mobile-app .company-card-master.is-master-company {
  border-left: 3.5px solid var(--accent-gold, #c9a227) !important;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%) !important;
}

.is-mobile-app .company-card-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
}

.is-mobile-app .company-card-icon {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

.is-mobile-app .company-card-title-wrap {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.is-mobile-app .company-card-name {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  margin-bottom: 2px !important;
  line-height: 1.2 !important;
  color: var(--primary-navy, #0B192C) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.is-mobile-app .badge-company-type,
.is-mobile-app .badge-status-contract {
  font-size: 8.5px !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  gap: 3px !important;
  font-weight: 600 !important;
}

.is-mobile-app .company-card-details {
  padding: 5px 0 !important;
  margin-bottom: 6px !important;
  font-size: 10px !important;
  gap: 2.5px !important;
  border-top: 1px solid #f1f5f9 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  min-width: 0 !important;
  width: 100% !important;
}

.is-mobile-app .company-card-details .detail-item {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  line-height: 1.25 !important;
}

.is-mobile-app .company-card-details .detail-item i {
  font-size: 10px !important;
  width: 12px !important;
  flex-shrink: 0 !important;
}

.is-mobile-app .company-card-details .detail-item span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  flex: 1 !important;
  font-size: 10px !important;
}

.is-mobile-app .company-card-footer {
  margin-top: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
}

.is-mobile-app .btn-enter-company {
  padding: 4px 8px !important;
  font-size: 11px !important;
  height: 28px !important;
  border-radius: 6px !important;
  gap: 5px !important;
  font-weight: 600 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  justify-content: center !important;
}

.is-mobile-app .company-card-subactions {
  margin-top: 4px !important;
  padding-top: 4px !important;
  gap: 3px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  border-top: 1px dashed #f1f5f9 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.is-mobile-app .company-card-subactions .btn {
  padding: 2px 6px !important;
  font-size: 9px !important;
  height: 20px !important;
  border-radius: 4px !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
}

/* Botones generales en app móvil */
.is-mobile-app .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  min-height: 32px !important;
  gap: 5px !important;
}

.is-mobile-app .btn-sm {
  padding: 4px 8px !important;
  font-size: 11px !important;
  min-height: 28px !important;
}

.is-mobile-app .btn-xs {
  padding: 3px 6px !important;
  font-size: 10px !important;
  min-height: 22px !important;
}

.is-mobile-app .btn-logout {
  padding: 4px 8px !important;
  font-size: 11px !important;
  height: 28px !important;
}

.is-mobile-app .nav-tab {
  padding: 6px 10px !important;
  font-size: 11.5px !important;
  gap: 5px !important;
}

.is-mobile-app .btn-action-primary,
.is-mobile-app .btn-action-secondary,
.is-mobile-app .btn-filter-action,
.is-mobile-app .module-filter-bar .btn-reset-filter {
  padding: 5px 9px !important;
  font-size: 11.5px !important;
  height: 30px !important;
}

.is-mobile-app .modal-footer .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  height: 32px !important;
}

/* Barra superior de empresa en aplicación móvil (.is-mobile-app): Ocultar App Móvil, formatear rol y botón Cerrar Sesión */
.is-mobile-app .btn-topbar-mobile-app {
  display: none !important;
}

.is-mobile-app .dash-topbar {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
}

.is-mobile-app .topbar-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
}

.is-mobile-app .topbar-actions .cloud-sync-badge {
  font-size: 11px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  margin-right: auto !important;
}

.is-mobile-app .topbar-actions .btn-logout,
.is-mobile-app .topbar-actions #btn-logout {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
  cursor: pointer !important;
  margin-left: auto !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.12) !important;
}

/* Rol de usuario integrado estéticamente en la ficha de la empresa */
.company-profile-card .badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.company-profile-card .badge-role.lite {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
}

.company-profile-card .badge-role.master {
  background: rgba(11, 25, 44, 0.65);
  color: #f5d061;
  border: 1px solid rgba(245, 208, 97, 0.6);
  backdrop-filter: blur(4px);
}

/* 2. Reglas responsivas aplicables a pantallas móviles y tablets (<= 768px) */
@media (max-width: 768px) {
  body {
    padding: 8px 8px;
  }

  .profile-timestamp {
    align-items: flex-start !important;
  }

  .profile-top-badges {
    justify-content: flex-start !important;
  }

  .dash-topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
    overflow: visible !important;
  }

  .topbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .topbar-actions .cloud-sync-badge {
    font-size: 11px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-right: auto !important;
  }

  .topbar-actions .btn-topbar-mobile-app {
    display: none !important;
  }

  .topbar-actions .btn-logout,
  .topbar-actions #btn-logout {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    cursor: pointer !important;
    margin-left: auto !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.12) !important;
  }

  .company-profile-card {
    margin-top: 10px !important;
    clear: both !important;
  }

  .master-companies-card {
    padding: 12px 10px;
    margin: 6px auto 16px;
    border-radius: 10px;
  }

  .master-companies-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .master-header-brand {
    gap: 10px;
  }

  .brand-logo-circle.mini {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    filter: drop-shadow(0 2px 6px rgba(11, 25, 44, 0.2));
  }

  .master-panel-title {
    font-size: 0.98rem;
    margin-bottom: 2px;
    line-height: 1.25;
  }

  .master-panel-subtitle {
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .master-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
  }

  .master-header-actions .cloud-sync-badge {
    padding: 4px 8px;
    font-size: 10.5px;
    height: 28px;
    border-radius: 12px;
    white-space: nowrap;
  }

  .master-header-actions #btn-master-create-company {
    padding: 4px 9px;
    font-size: 11px;
    height: 28px;
    border-radius: 6px;
    white-space: nowrap;
    gap: 5px;
  }

  .master-header-actions #btn-master-logout {
    padding: 4px 9px;
    font-size: 11px;
    height: 28px;
    border-radius: 6px;
    white-space: nowrap;
    gap: 5px;
  }

  .master-header-actions .btn-install-pwa {
    padding: 4px 8px;
    font-size: 10.5px;
    height: 28px;
    border-radius: 6px;
    white-space: nowrap;
  }

  .master-companies-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }

  .master-search-wrap {
    width: 100%;
    max-width: 100%;
  }

  .master-search-wrap .search-input {
    height: 32px;
    font-size: 11.5px;
    padding: 5px 10px 5px 30px;
    border-radius: 6px;
  }

  .master-search-wrap .search-icon {
    left: 10px;
    font-size: 12px;
  }

  .company-status-filter-pills {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .company-status-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .status-filter-pill {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
    gap: 4px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .status-filter-pill .pill-count {
    font-size: 10px;
    padding: 1px 5px;
  }

  #master-companies-count-badge {
    font-size: 10.5px;
    padding: 3px 8px;
    align-self: flex-start;
  }

  .master-companies-card {
    padding: 12px 10px;
    margin: 6px auto 16px;
    border-radius: 10px;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  .master-companies-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .company-card-master {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    margin: 0;
  }

  .company-card-master.is-master-company {
    border-left: 3.5px solid var(--accent-gold, #c9a227);
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
  }

  .company-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    min-width: 0;
    width: 100%;
  }

  .company-card-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 13px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .company-card-title-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .company-card-name {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
    color: var(--primary-navy, #0B192C);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .badge-company-type,
  .badge-status-contract {
    font-size: 8.5px;
    padding: 1px 5px;
    border-radius: 4px;
    gap: 3px;
    font-weight: 600;
  }

  .company-card-details {
    padding: 5px 0;
    margin-bottom: 6px;
    font-size: 10px;
    gap: 2.5px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    min-width: 0;
    width: 100%;
  }

  .company-card-details .detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.25;
  }

  .company-card-details .detail-item i {
    font-size: 10px;
    width: 12px;
    flex-shrink: 0;
  }

  .company-card-details .detail-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    font-size: 10px;
  }

  .company-card-footer {
    margin-top: 0;
    min-width: 0;
    width: 100%;
  }

  .btn-enter-company {
    padding: 4px 8px;
    font-size: 11px;
    height: 28px;
    border-radius: 6px;
    gap: 5px;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .company-card-subactions {
    margin-top: 4px;
    padding-top: 4px;
    gap: 3px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    border-top: 1px dashed #f1f5f9;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .company-card-subactions .btn {
    padding: 2px 6px;
    font-size: 9px;
    height: 20px;
    border-radius: 4px;
    gap: 3px;
    flex-shrink: 0;
  }

  /* Botones en mobile */
  .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
    gap: 5px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
  }

  .btn-xs {
    padding: 3px 6px;
    font-size: 10px;
    min-height: 22px;
  }

  .btn-logout {
    padding: 4px 8px;
    font-size: 11px;
    height: 28px;
  }

  .nav-tab {
    padding: 6px 10px;
    font-size: 11.5px;
    gap: 5px;
  }

  .btn-action-primary,
  .btn-action-secondary,
  .btn-filter-action,
  .module-filter-bar .btn-reset-filter {
    padding: 5px 9px;
    font-size: 11.5px;
    height: 30px;
  }

  .modal-footer .btn {
    padding: 6px 12px;
    font-size: 12px;
    height: 32px;
  }
}

.badge-company-pass {
  font-family: monospace;
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #fde68a;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.btn-copy-company-credentials {
  transition: all 0.2s ease;
}

.btn-copy-company-credentials:hover {
  color: var(--primary-navy) !important;
  transform: scale(1.18);
}

/* Botón App Móvil idéntico al estilo moderno de DC Piscícola */
.btn-topbar-mobile-app {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #ffffff !important;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.28);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-topbar-mobile-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.38);
  filter: brightness(1.05);
}

.btn-topbar-mobile-app i {
  font-size: 14px;
}

@media (max-width: 768px) {
  .btn-topbar-mobile-app {
    padding: 4px 9px !important;
    font-size: 11px !important;
  }
}

/* Modal Móvil y Animación Pulse */
.pulse-dot-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ==========================================================================
   14. CONSOLIDADO ANUAL ACUMULADO
   ========================================================================== */
.annual-subtab-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px 8px 0 0;
}
.annual-subtab-btn:hover {
  background: #e2e8f0;
  color: #0b192c;
}
.annual-subtab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}
.annual-subtab-content.hidden {
  display: none !important;
}
.annual-subtab-content.active {
  display: block;
}
.waterfall-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.waterfall-card .wf-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.waterfall-card .wf-val {
  font-size: 16px;
  font-weight: 800;
  color: #0b192c;
}
.waterfall-card .wf-sub {
  font-size: 11px;
  color: #94a3b8;
}
/* ==========================================================================
   AJUSTE UNIVERSAL: TODAS LAS TABLAS DE MÓDULOS AL ANCHO DEL CONTENIDO
   Elimina scroll horizontal y ajusta columnas al contenido real
   ========================================================================== */

/* 1. Contenedores de tabla */
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto;
}

#tab-10-costos-ventas .table-responsive {
  overflow-x: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 2. Todas las tablas de datos de módulos */
.table-sales-detail,
.table-pm-detail,
.data-table,
.data-table-sales,
#table-cogs,
#table-sales,
#table-payment-methods,
#table-daily-products,
#table-monthly-products,
#table-suppliers,
#table-insumos,
#table-expenses,
#table-payroll,
#table-waste,
#table-staff-lunch,
#table-purchase-costs,
#table-tips,
#table-propinas-colaboradores,
#table-propinas-settlements,
#table-propinas-diario {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  box-sizing: border-box !important;
}

/* 3. Anular restricciones forzadas en los colgroup para que las columnas respiren */
.table-sales-detail colgroup col,
.table-pm-detail colgroup col,
.data-table colgroup col,
#table-cogs colgroup col,
#table-sales colgroup col,
#table-payment-methods colgroup col,
#table-daily-products colgroup col,
#table-monthly-products colgroup col,
#table-suppliers colgroup col,
#table-insumos colgroup col,
#table-expenses colgroup col,
#table-payroll colgroup col,
#table-purchase-costs colgroup col,
#table-tips colgroup col {
  min-width: 0 !important;
  width: auto !important;
}

/* 4. Encabezados compactos y legibles */
.table-sales-detail thead th,
.table-pm-detail thead th,
.data-table thead th,
#table-cogs thead th {
  padding: 6px 5px !important;
  font-size: 0.72rem !important;
  line-height: 1.15 !important;
  box-sizing: border-box !important;
  white-space: normal !important;
}

.table-sales-detail .thead-group-row th,
#table-cogs .thead-group-row th {
  padding: 5px 4px !important;
  font-size: 0.69rem !important;
  letter-spacing: 0.02em !important;
}

/* 5. Celdas de datos: números compactos y textos flexibles */
.table-sales-detail tbody td,
.table-pm-detail tbody td,
.data-table tbody td,
#table-cogs tbody td {
  padding: 5px 8px !important;
  font-size: 0.78rem !important;
  height: 30px !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.01em !important;
}

/* Alineación correcta en columnas numéricas y centradas */
.table-sales-detail td.text-right,
.table-pm-detail td.text-right,
.data-table td.text-right,
#table-cogs td.text-right {
  text-align: right !important;
  white-space: nowrap !important;
}

.table-sales-detail td.text-center,
.table-pm-detail td.text-center,
.data-table td.text-center,
#table-cogs td.text-center {
  text-align: center !important;
  white-space: nowrap !important;
}

.table-sales-detail td.col-highlight,
.table-pm-detail td.col-highlight,
.data-table td.col-highlight {
  font-weight: 500 !important;
}

/* 6. Badges y etiquetas dentro de celdas */
.table-sales-detail .badge-tag,
.table-pm-detail .badge-tag,
.data-table .badge-tag,
#table-cogs .badge-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  padding: 2px 5px !important;
  font-size: 0.69rem !important;
}

/* 7. Totales (tfoot) */
.table-sales-detail tfoot tr td,
.table-pm-detail tfoot tr td,
.data-table tfoot tr td,
#table-cogs tfoot tr td {
  padding: 6px 5px !important;
  font-size: 0.75rem !important;
  line-height: 1.15 !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   MÓDULO: RECETARIO, FICHAS TÉCNICAS Y COTIZADOR (SANDBOX)
   ========================================================================== */

.recipes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.recipe-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.recipe-card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #091728;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.recipe-card-metrics {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid #f1f5f9;
}

.recipe-metric-item {
  display: flex;
  flex-direction: column;
}

.recipe-metric-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.recipe-metric-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
}

.recipe-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Quoter Layout */
.quoter-layout-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 992px) {
  .quoter-layout-grid {
    grid-template-columns: 1fr;
  }
}

.quoter-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.quoter-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.quoter-card-header h5 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #091728;
}

.financial-metric-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.financial-metric-box .label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  display: block;
}

.financial-metric-box .value-huge {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 4px 0;
}

.btn-xs {
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  border-radius: 5px !important;
}


/* ==========================================================================
   MODULOS CULINARIOS EN CABECERA AZUL DE LA EMPRESA (PARTE INFERIOR DERECHA)
   ========================================================================== */
.profile-culinary-actions {
  display: none !important;
}

.profile-culinary-actions.hidden {
  display: none !important;
}

.culinary-actions-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fcd34d;
  margin-right: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-profile-culinary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  font-family: inherit;
}

.btn-profile-culinary:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

.btn-profile-culinary.active {
  background: #0d9488 !important;
  color: #ffffff !important;
  border-color: #5eead4 !important;
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.55) !important;
  font-weight: 700 !important;
}

@media (max-width: 900px) {
  .profile-culinary-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 6px;
  }
}

/* Badges de Contrato y Facturación */
.badge-billing-period {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.badge-contract-fee {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.badge-contract-period {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.badge-service-plan-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

#modal-manage-plan-prices {
  z-index: 99999 !important;
}


/* ==========================================================================
   MÓDULO: INGENIERÍA DEL MENÚ (MATRIZ KASAVANA & SMITH)
   ========================================================================== */
.menu-eng-header-banner {
  background: linear-gradient(135deg, #091728 0%, #1e293b 100%);
  border-radius: 14px;
  padding: 22px 26px;
  color: #ffffff;
  margin-bottom: 22px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-left: 5px solid #f59e0b;
}

.menu-eng-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px 0;
}

.menu-eng-subtitle {
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 0;
  max-width: 680px;
  line-height: 1.45;
}

.menu-eng-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.menu-eng-kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.menu-eng-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.menu-eng-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.menu-eng-kpi-card.kpi-star::before { background: #10b981; }
.menu-eng-kpi-card.kpi-horse::before { background: #3b82f6; }
.menu-eng-kpi-card.kpi-puzzle::before { background: #f59e0b; }
.menu-eng-kpi-card.kpi-dog::before { background: #ef4444; }
.menu-eng-kpi-card.kpi-benchmark::before { background: #6366f1; }

.menu-eng-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.menu-eng-kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.menu-eng-kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 4px;
}

.menu-eng-kpi-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Matriz 4 Cuadrantes */
.menu-eng-matrix-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.menu-eng-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.menu-eng-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-quadrant-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.80rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quadrant-filter:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-quadrant-filter.active[data-filter="all"] {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-quadrant-filter.active[data-filter="star"] {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

.btn-quadrant-filter.active[data-filter="horse"] {
  background: #eff6ff;
  color: #1e40af;
  border-color: #3b82f6;
}

.btn-quadrant-filter.active[data-filter="puzzle"] {
  background: #fffbeb;
  color: #92400e;
  border-color: #f59e0b;
}

.btn-quadrant-filter.active[data-filter="dog"] {
  background: #fef2f2;
  color: #991b1b;
  border-color: #ef4444;
}

/* Badges de Cuadrantes */
.badge-quadrant {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-quadrant.badge-star {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.badge-quadrant.badge-horse {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.badge-quadrant.badge-puzzle {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-quadrant.badge-dog {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Tooltip Interactivo SVG */
.menu-eng-svg-dot {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.menu-eng-svg-dot:hover {
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.35));
}

/* Simulador What-If */
.menu-eng-simulator-box {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.menu-eng-sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 860px) {
  .menu-eng-sim-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   VISTAS MEJORADAS DE INGENIERÍA DEL MENÚ (TABLERO 2x2, SCATTER, RANKING)
   ========================================================================== */
.btn-menu-eng-view {
  background: transparent;
  color: #64748b;
  transition: all 0.2s ease;
}

.btn-menu-eng-view.active {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-menu-eng-view:hover:not(.active) {
  background: #e2e8f0;
  color: #1e293b;
}

/* Tablero 4 Cuadrantes Grid 2x2 */
.menu-eng-board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .menu-eng-board-grid {
    grid-template-columns: 1fr;
  }
}

.menu-eng-quadrant-box {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.menu-eng-quadrant-box.box-star {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.menu-eng-quadrant-box.box-horse {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.menu-eng-quadrant-box.box-puzzle {
  border-color: #fde68a;
  background: #fffbeb;
}

.menu-eng-quadrant-box.box-dog {
  border-color: #fecaca;
  background: #fef2f2;
}

.menu-eng-quadrant-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.menu-eng-quadrant-header.hdr-star { background: #10b981; color: #ffffff; }
.menu-eng-quadrant-header.hdr-horse { background: #3b82f6; color: #ffffff; }
.menu-eng-quadrant-header.hdr-puzzle { background: #f59e0b; color: #ffffff; }
.menu-eng-quadrant-header.hdr-dog { background: #ef4444; color: #ffffff; }

.menu-eng-dish-card-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.menu-eng-dish-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-eng-dish-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.07);
  border-color: #cbd5e1;
}

.menu-eng-dish-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.menu-eng-dish-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.menu-eng-dish-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f8fafc;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  border: 1px solid #f1f5f9;
}

.menu-eng-dish-metric-cell {
  display: flex;
  flex-direction: column;
}

.menu-eng-dish-metric-label {
  color: #64748b;
  font-weight: 600;
}

.menu-eng-dish-metric-val {
  font-weight: 800;
  color: #1e293b;
  font-size: 0.78rem;
}

/* Vista Ranking de Barras */
.menu-eng-ranking-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.menu-eng-ranking-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.menu-eng-ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.menu-eng-ranking-row:hover {
  background: #f1f5f9;
}

.menu-eng-ranking-name {
  width: 240px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-eng-ranking-bar-track {
  flex: 1;
  height: 22px;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.menu-eng-ranking-bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: #ffffff;
  font-size: 0.70rem;
  font-weight: 800;
}

.menu-eng-ranking-val {
  width: 150px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

/* Tabla de Diagnostico Estrategico (Kasavana & Smith) */
#table-menu-engineering {
  table-layout: fixed !important;
  width: 100% !important;
}

#table-menu-engineering th,
#table-menu-engineering td {
  box-sizing: border-box !important;
}

#table-menu-engineering td.text-right,
#table-menu-engineering td.text-center {
  width: auto !important;
}

#table-menu-engineering th:nth-child(9),
#table-menu-engineering td:nth-child(9) {
  text-align: center !important;
  overflow: hidden !important;
  padding: 4px 6px !important;
}

#table-menu-engineering .badge-quadrant {
  white-space: normal !important;
  word-break: normal !important;
  line-height: 1.2 !important;
  font-size: 0.72rem !important;
  padding: 4px 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#table-menu-engineering th:nth-child(10),
#table-menu-engineering td:nth-child(10) {
  white-space: normal !important;
  word-break: normal !important;
  line-height: 1.35 !important;
  font-size: 0.77rem !important;
  color: #334155 !important;
  padding: 6px 12px !important;
}


/* ==========================================================================
   NAVEGACIÓN POR CÁPSULA Y MEGA-MENÚ FLOTANTE (OPCIÓN 2: PRUEBAS SANDBOX)
   ========================================================================== */
.module-capsule-container {
  position: relative;
  margin-bottom: 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  gap: 12px;
  flex-wrap: wrap;
  z-index: 50;
}

.capsule-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.module-capsule-btn {
  background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 12px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 31, 63, 0.2);
  text-align: left;
}

.module-capsule-btn:hover {
  background: linear-gradient(135deg, #002b55 0%, #004080 100%);
  border-color: #ffd700;
  box-shadow: 0 6px 18px rgba(0, 31, 63, 0.32);
  transform: translateY(-1px);
}

.capsule-icon-box {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffd700;
}

.capsule-text-box {
  display: flex;
  flex-direction: column;
}

.capsule-subtext {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-bottom: 2px;
}

.capsule-maintext {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.capsule-caret {
  margin-left: 8px;
  font-size: 0.85rem;
  color: #ffd700;
  transition: transform 0.25s ease;
}

.module-capsule-btn.open .capsule-caret {
  transform: rotate(180deg);
}

/* Botones de salto rápido anterior / siguiente */
.capsule-nav-arrow-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.capsule-nav-arrow-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.capsule-nav-arrow-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Badges derecha */
.capsule-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.capsule-sandbox-pill {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.capsule-toggle-classic-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.capsule-toggle-classic-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* PANEL FLOTANTE MEGA-MENÚ */
.module-mega-menu-overlay {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-width: 1100px;
  background: #ffffff;
  border: 2px solid #002b66;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 31, 63, 0.28);
  z-index: 1050;
  padding: 18px 22px;
  animation: megaMenuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.module-mega-menu-overlay.show {
  display: block;
}

@keyframes megaMenuSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cabecera del mega menú: Buscador */
.mega-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.mega-menu-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.mega-menu-search-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

.mega-menu-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  outline: none;
  transition: border-color 0.2s ease;
  background: #f8fafc;
  box-sizing: border-box;
}

.mega-menu-search-input:focus {
  border-color: #002b66;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 43, 102, 0.12);
}

.mega-menu-close-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.mega-menu-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Grilla de Categorías del Mega Menú */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px;
}

.mega-menu-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mega-menu-column.culinary-premium-col {
  background: #fffdf5;
  border: 1.5px solid #fef08a;
}

.mega-menu-col-title {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.culinary-premium-col .mega-menu-col-title {
  color: #854d0e;
  border-bottom-color: #fef08a;
}

/* Botón individual de módulo dentro del Mega Menú */
.mega-menu-item-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.mega-menu-item-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #002b66;
  transform: translateX(2px);
}

.mega-menu-item-btn.active {
  background: #002b66;
  color: #ffffff;
  border-color: #002b66;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 43, 102, 0.22);
}

.mega-menu-item-btn.active i {
  color: #ffd700;
}

.mega-menu-item-btn.culinary-btn:hover {
  background: #fef9c3;
  border-color: #facc15;
  color: #854d0e;
}

.mega-menu-item-btn.culinary-btn.active {
  background: #854d0e;
  border-color: #854d0e;
  color: #ffffff;
}

.mega-menu-item-icon {
  width: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  flex-shrink: 0;
}

.mega-menu-item-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}

.mega-menu-item-btn.active .mega-menu-item-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}


/* Separador y contenedor unificado en la barra de período */
.unified-capsule-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.unified-bar-separator {
  width: 1.5px;
  height: 42px;
  background: #cbd5e1;
  border-radius: 2px;
  flex-shrink: 0;
}


/* Alineación contigua en la barra unificada */
#main-period-control-bar {
  justify-content: flex-start;
  gap: 18px;
}


/* Prevenir parpadeo de pantalla de login si ya hay sesión activa */
html.has-active-session #auth-section {
  display: none !important;
}


/* ==========================================================================
   TEMA VISUAL MODERNO: SLATE & ROYAL INDIGO (SANDBOX DEMO PRUEBAS)
   Inspirado en la paleta limpia SaaS: fondo slate claro, tipografía carbón,
   acentos Royal Indigo, bordes negros de alta definición y badges semánticos pastel.
   ========================================================================== */

/* Fondo general de la plataforma y dashboard */
body.theme-modern-slate {
  background-color: #f8fafc !important;
  color: #000000 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 15.5px !important;
}

body.theme-modern-slate .app-container {
  background: transparent !important;
}

body.theme-modern-slate #dashboard-section {
  background: #f8fafc !important;
  color: #000000 !important;
}

/* Títulos generales y encabezados nítidos sin desenfoque */
body.theme-modern-slate h1,
body.theme-modern-slate h2,
body.theme-modern-slate h3,
body.theme-modern-slate h4,
body.theme-modern-slate .company-main-name,
body.theme-modern-slate .section-title,
body.theme-modern-slate .module-header-title {
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* 1. BARRA SUPERIOR (TOPBAR) */
body.theme-modern-slate .dash-topbar {
  background: #ffffff !important;
  border-bottom: 1.5px solid #000000 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

body.theme-modern-slate .dash-title {
  color: #000000 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .dash-slogan {
  color: #475569 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .app-version-badge {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

body.theme-modern-slate .topbar-actions .btn {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  transition: all 0.2s ease !important;
}

body.theme-modern-slate .topbar-actions .btn:hover {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  color: #4338ca !important;
}

body.theme-modern-slate .btn-topbar-mobile-app {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1.5px solid #047857 !important;
}

body.theme-modern-slate .cloud-sync-badge {
  background: #f8fafc !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
}

/* 2. FICHA TÉCNICA DE LA EMPRESA (COMPANY PROFILE CARD) */
body.theme-modern-slate .company-profile-card {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  border-top: 4px solid #4f46e5 !important;
  border-radius: 14px !important;
  color: #000000 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
  position: relative !important;
  overflow: hidden !important;
}

body.theme-modern-slate .company-profile-card::after {
  display: none !important;
}

body.theme-modern-slate .profile-header {
  border-bottom: 1px solid #cbd5e1 !important;
}

body.theme-modern-slate .company-avatar-box {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1.5px solid #4338ca !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12) !important;
}

body.theme-modern-slate .tag-registered {
  color: #4f46e5 !important;
  font-weight: 500 !important;
}

body.theme-modern-slate .company-main-name {
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

/* Badges en la cabecera de la ficha */
body.theme-modern-slate #current-date-badge {
  background: #f8fafc !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate #current-date-badge i {
  color: #4f46e5 !important;
}

body.theme-modern-slate #user-role-badge.master,
body.theme-modern-slate .badge-role.master {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1.5px solid #b45309 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate #company-service-plan-badge {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1.5px solid #4338ca !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate #company-contract-period-badge {
  background: #f1f5f9 !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

/* PERÍODO DE AUDITORÍA: LETRAS NEGRAS SÓLIDAS Y ALTO CONTRASTE */
body.theme-modern-slate #system-audit-badge,
body.theme-modern-slate .system-audit-badge {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body.theme-modern-slate #system-audit-badge span,
body.theme-modern-slate #system-audit-badge strong,
body.theme-modern-slate #system-audit-badge #lbl-audit-period-range,
body.theme-modern-slate .system-audit-badge span,
body.theme-modern-slate .system-audit-badge strong,
body.theme-modern-slate .system-audit-badge #lbl-audit-period-range {
  color: #000000 !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

body.theme-modern-slate #system-audit-badge i,
body.theme-modern-slate .system-audit-badge i {
  color: #4f46e5 !important;
  text-shadow: none !important;
}

/* 6 Pastillas de Información de la Empresa */
body.theme-modern-slate .profile-detail-box {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

body.theme-modern-slate .profile-detail-box:hover {
  background: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body.theme-modern-slate .profile-detail-box .detail-label {
  color: #475569 !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .profile-detail-box .detail-label i {
  color: #4f46e5 !important;
}

body.theme-modern-slate .profile-detail-box .detail-val {
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

/* 3. BARRA UNIFICADA DE CONTROL DE PERÍODO */
body.theme-modern-slate .period-control-bar {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  border-left: 5px solid #4f46e5 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

body.theme-modern-slate .period-control-label {
  color: #000000 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .period-control-label i {
  color: #4f46e5 !important;
}

body.theme-modern-slate .period-select {
  background: #f8fafc !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  font-weight: 500 !important;
}

body.theme-modern-slate .period-select:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
  background: #ffffff !important;
}

body.theme-modern-slate .period-status-badge.has-data {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1.5px solid #047857 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .period-status-badge.is-blank {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1.5px solid #b91c1c !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .unified-bar-separator {
  background: #000000 !important;
}

/* 4. CÁPSULA SELECTORA DE MÓDULOS (ROYAL INDIGO DEL SCREENSHOT) */
body.theme-modern-slate .module-capsule-btn {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  border: 1.5px solid #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

body.theme-modern-slate .module-capsule-btn:hover {
  background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%) !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
}

body.theme-modern-slate .capsule-icon-box {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}

body.theme-modern-slate .capsule-subtext {
  color: #c7d2fe !important;
  text-shadow: none !important;
}

body.theme-modern-slate .capsule-maintext {
  color: #ffffff !important;
  text-shadow: none !important;
}

body.theme-modern-slate .capsule-caret {
  color: #ffffff !important;
}

/* 5. MEGA-MENÚ FLOTANTE */
body.theme-modern-slate .module-mega-menu-overlay {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18) !important;
}

body.theme-modern-slate .mega-menu-search-input {
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
}

body.theme-modern-slate .mega-menu-search-input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

body.theme-modern-slate .mega-menu-column {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.theme-modern-slate .mega-category-title {
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .mega-category-title i {
  color: #4f46e5 !important;
}

body.theme-modern-slate .mega-menu-item {
  color: #000000 !important;
}

body.theme-modern-slate .mega-menu-item:hover {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  color: #4338ca !important;
}

body.theme-modern-slate .mega-menu-item.active {
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

body.theme-modern-slate .mega-menu-item.active .mega-item-icon {
  color: #ffffff !important;
}


/* ==========================================================================
   TIPOGRAFÍA LIGERA Y ELEGANTE (SIN FUENTES GRUESAS / REGULAR WEIGHT)
   ========================================================================== */
body.theme-modern-slate strong,
body.theme-modern-slate b {
  font-weight: 500 !important;
}

body.theme-modern-slate table strong,
body.theme-modern-slate table b,
body.theme-modern-slate .table-sales-detail tbody td strong,
body.theme-modern-slate .table-sales-detail tbody td b,
body.theme-modern-slate .data-table tbody td strong,
body.theme-modern-slate .data-table tbody td b,
body.theme-modern-slate #table-cogs tbody td strong,
body.theme-modern-slate #table-cogs tbody td b {
  font-weight: 500 !important;
}

body.theme-modern-slate table td,
body.theme-modern-slate .data-table td,
body.theme-modern-slate .table-sales-detail tbody td,
body.theme-modern-slate .table-pm-detail tbody td,
body.theme-modern-slate #table-cogs tbody td,
body.theme-modern-slate .tower-table td {
  font-weight: 400 !important;
}

body.theme-modern-slate .table-sales-detail tbody td.col-highlight,
body.theme-modern-slate .table-pm-detail tbody td.col-highlight,
body.theme-modern-slate .data-table tbody td.col-highlight {
  font-weight: 500 !important;
}

body.theme-modern-slate .table-sales-detail .badge-day,
body.theme-modern-slate .badge-day {
  font-weight: 400 !important;
}

/* ==========================================================================
   6. TABLAS Y REPORTES: BORDES NEGROS SÓLIDOS EN TODAS LAS CELDAS
   Y ENCABEZADOS DE ALTA DEFINICIÓN (CERO DESENFOQUE / SIN SOMBRAS BORROSAS)
   ========================================================================== */

/* Bordes negros en todas las tablas */
body.theme-modern-slate table,
body.theme-modern-slate .data-table,
body.theme-modern-slate .table-sales-detail,
body.theme-modern-slate .table-pm-detail,
body.theme-modern-slate #table-cogs,
body.theme-modern-slate .tower-table,
body.theme-modern-slate .table-responsive table {
  border: 1.5px solid #000000 !important;
  border-collapse: collapse !important;
}

/* Bordes negros en cada celda (th y td) de todos los reportes */
body.theme-modern-slate table th,
body.theme-modern-slate table td,
body.theme-modern-slate .data-table th,
body.theme-modern-slate .data-table td,
body.theme-modern-slate .table-sales-detail th,
body.theme-modern-slate .table-sales-detail td,
body.theme-modern-slate .table-pm-detail th,
body.theme-modern-slate .table-pm-detail td,
body.theme-modern-slate #table-cogs th,
body.theme-modern-slate #table-cogs td,
body.theme-modern-slate .tower-table th,
body.theme-modern-slate .tower-table td {
  border: 1px solid #000000 !important;
  font-family: 'Inter', sans-serif !important;
}

/* Encabezados compactos y legibles para todas las tablas en theme-modern-slate */
body.theme-modern-slate table th,
body.theme-modern-slate .data-table th,
body.theme-modern-slate .table-sales-detail th,
body.theme-modern-slate .table-pm-detail th,
body.theme-modern-slate #table-cogs th,
body.theme-modern-slate .thead-group-row th,
body.theme-modern-slate .thead-detail-row th {
  padding: 5px 6px !important;
  font-size: 0.74rem !important;
  height: 30px !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  text-shadow: none !important;
}

/* Eliminar sombras borrosas en TODOS los encabezados de tabla */
body.theme-modern-slate table th,
body.theme-modern-slate table th *,
body.theme-modern-slate .data-table th,
body.theme-modern-slate .table-sales-detail thead th,
body.theme-modern-slate .table-pm-detail thead th,
body.theme-modern-slate #table-cogs thead th,
body.theme-modern-slate .thead-group-row th,
body.theme-modern-slate .thead-detail-row th,
body.theme-modern-slate .th-group-date,
body.theme-modern-slate .th-group-sales,
body.theme-modern-slate .th-group-totals,
body.theme-modern-slate .th-group-service,
body.theme-modern-slate .th-group-discounts {
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Fila de Grupos de Encabezado (Nivel 1): texto negro nítido, fondo claro, borde negro */
body.theme-modern-slate .table-sales-detail .thead-group-row th,
body.theme-modern-slate .table-pm-detail .thead-group-row th,
body.theme-modern-slate #table-cogs .thead-group-row th,
body.theme-modern-slate .th-group-date,
body.theme-modern-slate .th-group-sales,
body.theme-modern-slate .th-group-totals,
body.theme-modern-slate .th-group-service,
body.theme-modern-slate .th-group-discounts {
  background: #e2e8f0 !important;
  color: #000000 !important;
  font-weight: 500 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.02em !important;
  border: 1px solid #000000 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .thead-group-row th i,
body.theme-modern-slate .th-group-date i,
body.theme-modern-slate .th-group-sales i,
body.theme-modern-slate .th-group-totals i,
body.theme-modern-slate .th-group-service i,
body.theme-modern-slate .th-group-discounts i {
  color: #000000 !important;
  text-shadow: none !important;
}

/* Fila de Detalle de Columnas (Nivel 2): texto negro nítido, fondo blanco/slate, borde negro */
body.theme-modern-slate .table-sales-detail .thead-detail-row th,
body.theme-modern-slate .table-pm-detail .thead-detail-row th,
body.theme-modern-slate .data-table th,
body.theme-modern-slate #table-cogs thead th {
  background: #f1f5f9 !important;
  color: #000000 !important;
  font-weight: 400 !important;
  text-shadow: none !important;
  border: 1px solid #000000 !important;
  font-size: 0.75rem !important;
}

/* Columnas que antes tenían texto claro sobre fondo claro (Fecha, Día, Vta. Bruta, Impoconsumo, Propina) */
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-fecha,
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-dia,
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-subtot,
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-impo,
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-propina {
  background: #f1f5f9 !important;
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
  border: 1px solid #000000 !important;
}

/* Columnas con fondo destacado: texto blanco sólido de alto contraste SIN sombra */
body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-neg {
  background: #dc2626 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  border: 1px solid #000000 !important;
}

body.theme-modern-slate .table-sales-detail .thead-detail-row th.col-total {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  border: 1px solid #000000 !important;
}

/* Celdas de datos (td): altura compacta de 30px, texto negro de máxima legibilidad y borde negro */
body.theme-modern-slate table td,
body.theme-modern-slate .data-table td,
body.theme-modern-slate .table-sales-detail tbody td,
body.theme-modern-slate .table-pm-detail tbody td,
body.theme-modern-slate #table-cogs tbody td {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  font-weight: 400 !important;
  font-size: 0.78rem !important;
  padding: 5px 8px !important;
  height: 30px !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.01em !important;
}

body.theme-modern-slate table tfoot td,
body.theme-modern-slate .data-table tfoot td,
body.theme-modern-slate .table-sales-detail tfoot td,
body.theme-modern-slate .table-pm-detail tfoot td,
body.theme-modern-slate #table-cogs tfoot td {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  font-weight: 700 !important;
  font-size: 0.80rem !important;
  padding: 6px 8px !important;
  height: 32px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

body.theme-modern-slate .data-table tbody tr:hover,
body.theme-modern-slate .table-sales-detail tbody tr:hover,
body.theme-modern-slate .table-pm-detail tbody tr:hover,
body.theme-modern-slate #table-cogs tbody tr:hover {
  background: #f1f5f9 !important;
}

/* 7. TARJETAS KPI Y CONTENEDORES DE REPORTES */
body.theme-modern-slate .stat-card,
body.theme-modern-slate .kpi-card,
body.theme-modern-slate .chart-card {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

body.theme-modern-slate .stat-card .stat-value,
body.theme-modern-slate .kpi-card .kpi-value,
body.theme-modern-slate .metric-val {
  color: #000000 !important;
  font-weight: 500 !important;
}

body.theme-modern-slate .stat-card .stat-label,
body.theme-modern-slate .kpi-card .kpi-label {
  color: #475569 !important;
}

/* Nitidez y alto contraste en valores comparativos y subtítulos de KPIs */
body.theme-modern-slate .kpi-comparatives {
  border-top: 1px solid #e2e8f0 !important;
}

body.theme-modern-slate .kpi-comp-row {
  color: #334155 !important;
  font-size: 0.82rem !important;
}

body.theme-modern-slate .kpi-comp-row i {
  color: #4f46e5 !important;
  font-size: 0.85rem !important;
}

body.theme-modern-slate .kpi-comp-label {
  color: #334155 !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
}

body.theme-modern-slate .kpi-comp-val {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased !important;
}

body.theme-modern-slate .kpi-sub {
  color: #475569 !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
}

body.theme-modern-slate .kpi-comp-delta.positive {
  color: #15803d !important;
  background: #dcfce7 !important;
  border: 1px solid #bbf7d0 !important;
  font-weight: 600 !important;
}

body.theme-modern-slate .kpi-comp-delta.negative {
  color: #b91c1c !important;
  background: #fee2e2 !important;
  border: 1px solid #fecaca !important;
  font-weight: 600 !important;
}


/* 8. BOTONES PRINCIPALES */
body.theme-modern-slate .btn-primary {
  background: #4f46e5 !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25) !important;
}

body.theme-modern-slate .btn-primary:hover {
  background: #4338ca !important;
  border-color: #3730a3 !important;
}

/* 9. PESTAÑAS CLÁSICAS (SI SE ALTERNA A VISTA CLÁSICA) */
body.theme-modern-slate .business-tabs .tab-btn {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  border-radius: 9999px !important;
}

body.theme-modern-slate .business-tabs .tab-btn:hover {
  background: #f8fafc !important;
  border-color: #4f46e5 !important;
  color: #4f46e5 !important;
}

body.theme-modern-slate .business-tabs .tab-btn.active {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}


/* ==========================================================================
   10. TARJETA MASTER Y PASTILLA DE INGRESO A LA EMPRESA ("Trabajar en esta Empresa →")
   BLANCA CON BORDE AZUL Y TEXTO AZUL (IGUAL QUE EL CUADRO GRANDE DE DATOS)
   ========================================================================== */
/* Cuadro grande de la empresa (Tarjeta Master): blanca con borde superior azul corporativo */
body.theme-modern-slate .company-card-master {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-top: 4px solid #2563eb !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.25s ease !important;
}

body.theme-modern-slate .company-card-master:hover {
  border-color: #2563eb !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15) !important;
  transform: translateY(-3px) !important;
}

body.theme-modern-slate .company-card-master .company-card-icon {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1.5px solid #bfdbfe !important;
  border-radius: 10px !important;
}

/* Pastilla de Ingreso: "Trabajar en esta Empresa →"
   Fondo Blanco, Borde Azul y Texto Azul Visible para TODAS las empresas */
body.theme-modern-slate .company-card-master .btn-enter-company,
.company-card-master .btn-enter-company,
body.theme-modern-slate .company-card-master.is-sandbox-company .btn-enter-company,
.company-card-master.is-sandbox-company .btn-enter-company {
  background: #ffffff !important;
  border: 2px solid #2563eb !important;
  color: #1d4ed8 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Hover de la pastilla: suave fondo celeste con texto y borde azul más profundos */
body.theme-modern-slate .company-card-master .btn-enter-company:hover,
.company-card-master .btn-enter-company:hover,
body.theme-modern-slate .company-card-master.is-sandbox-company .btn-enter-company:hover,
.company-card-master.is-sandbox-company .btn-enter-company:hover {
  background: #eff6ff !important;
  border-color: #1e40af !important;
  color: #1e3a8a !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* Estado activo / presionado */
body.theme-modern-slate .company-card-master .btn-enter-company:active,
.company-card-master .btn-enter-company:active {
  background: #dbeafe !important;
  border-color: #1e40af !important;
  color: #1e3a8a !important;
  transform: translateY(0) !important;
}

/* ==========================================================================
   11. PASTILLA / ENCABEZADO DE INGENIERÍA DEL MENÚ (MODO PRUEBAS)
   ========================================================================== */
body.theme-modern-slate .menu-eng-header-banner {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  border-top: 4px solid #4f46e5 !important;
  border-left: 1.5px solid #000000 !important;
  border-radius: 14px !important;
  color: #000000 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.theme-modern-slate .menu-eng-title {
  color: #000000 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .menu-eng-title i {
  color: #4f46e5 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .menu-eng-subtitle {
  color: #475569 !important;
  text-shadow: none !important;
}

/* Badges del encabezado de Ingeniería del Menú */
body.theme-modern-slate .menu-eng-header-banner .badge-tag {
  text-shadow: none !important;
}

body.theme-modern-slate .menu-eng-header-banner span[style*="#f59e0b"],
body.theme-modern-slate .menu-eng-header-banner span[style*="rgb(245, 158, 11)"] {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1.5px solid #c7d2fe !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .menu-eng-header-banner span[style*="#f59e0b"] i,
body.theme-modern-slate .menu-eng-header-banner span[style*="rgb(245, 158, 11)"] i {
  color: #4f46e5 !important;
}

body.theme-modern-slate .menu-eng-header-banner .status-info {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

body.theme-modern-slate .menu-eng-header-banner .status-info i {
  color: #4f46e5 !important;
}

/* Botones de acción del banner */
body.theme-modern-slate #btn-sync-sales-menu-eng {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

body.theme-modern-slate #btn-sync-sales-menu-eng:hover {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  color: #4338ca !important;
}

body.theme-modern-slate #btn-print-menu-eng {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

body.theme-modern-slate #btn-print-menu-eng:hover {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  color: #4338ca !important;
}

body.theme-modern-slate #btn-jump-simulator {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  border: 1.5px solid #4338ca !important;
  color: #ffffff !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

body.theme-modern-slate #btn-jump-simulator:hover {
  background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%) !important;
  border-color: #3730a3 !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
}

/* Tarjetas KPI y Matriz de Ingeniería del Menú */
body.theme-modern-slate .menu-eng-kpi-card {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

body.theme-modern-slate .menu-eng-matrix-container {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

body.theme-modern-slate .btn-quadrant-filter {
  background: #ffffff !important;
  border: 1.5px solid #000000 !important;
  color: #000000 !important;
}

body.theme-modern-slate .btn-quadrant-filter:hover {
  background: #eef2ff !important;
  color: #4338ca !important;
}

body.theme-modern-slate .btn-quadrant-filter.active {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}


/* ==========================================================================
   DESPLIEGUE A TODA LA PLATAFORMA:
   1. Pastillas de ficha técnica en 1 sola fila con anchos inteligentes.
   2. Tabla de ventas 100% responsive sin desplazamiento horizontal y sin superposición.
   1. Pastillas de ficha técnica en 1 sola fila con anchos inteligentes
      (NIT compacto, Dirección con más del doble de ancho para no truncar).
   2. Reestructuración de columnas de tabla de ventas: 100% responsive,
      sin necesidad de mover la barra de desplazamiento horizontal.
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────────
   OPTIMIZACIONES EXCLUSIVAS PARA MONITORES Y ESCRITORIO (>= 992px)
   Ajusta ficha técnica y tabla de ventas a 100% ancho sin barra de desplazamiento en PC
──────────────────────────────────────────────────────────────────────────────── */
@media (min-width: 992px) {
  /* 1. FICHA TÉCNICA: Anchos inteligentes en 1 sola fila en monitores de escritorio */
  body.theme-modern-slate:not(.is-mobile-app) .profile-details-grid {
    display: grid !important;
    grid-template-columns: 1.15fr 0.65fr 1.35fr 0.85fr 1fr 2.2fr !important;
    gap: 8px 8px !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) .profile-detail-box {
    min-width: 0 !important;
    padding: 6px 8px !important;
    box-sizing: border-box !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) .profile-detail-box .detail-label {
    font-size: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) .profile-detail-box .detail-val {
    font-size: 13.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* 2. TABLA DE VENTAS DIARIAS: 100% ancho sin scroll horizontal en monitores de escritorio */
  body.theme-modern-slate:not(.is-mobile-app) .sales-table-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  /* Desactivar sticky/top forzado que empujaba la fila de títulos sobre el día 1 */
  body.theme-modern-slate:not(.is-mobile-app) #table-sales thead th,
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-group-row th,
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th {
    position: static !important;
    top: auto !important;
    z-index: 1 !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-group-row th {
    padding: 7px 3px !important;
    font-size: 0.74rem !important;
    letter-spacing: 0.01em !important;
    height: 32px !important;
    vertical-align: middle !important;
    border-bottom: 1.5px solid #000000 !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th {
    padding: 7px 3px !important;
    font-size: 0.74rem !important;
    height: 32px !important;
    vertical-align: middle !important;
    border-bottom: 2px solid #000000 !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody tr:first-child td {
    border-top: 1.5px solid #000000 !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales th,
  body.theme-modern-slate:not(.is-mobile-app) #table-sales td {
    padding: 6px 3px !important;
    font-size: 0.74rem !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.015em !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: 30px !important;
    vertical-align: middle !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales .badge-day {
    padding: 1px 4px !important;
    font-size: 0.70rem !important;
  }

  /* Anchos porcentuales balanceados para las 15 columnas de la tabla de ventas en escritorio */
  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(1),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(1),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(1) {
    width: 5.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(2),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(2),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(2) {
    width: 5.5% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(3),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(3),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(3) {
    width: 7.2% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(4),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(4),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(4) {
    width: 6.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(5),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(5),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(5) {
    width: 5.4% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(6),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(6),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(6) {
    width: 5.4% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(7),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(7),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(7) {
    width: 6.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(8),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(8),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(8) {
    width: 7.5% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(9),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(9),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(9) {
    width: 6.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(10),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(10),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(10) {
    width: 8.2% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(11),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(11),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(11) {
    width: 6.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(12),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(12),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(12) {
    width: 4.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(13),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(13),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(13) {
    width: 4.8% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(14),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(14),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(14) {
    width: 7.5% !important;
  }

  body.theme-modern-slate:not(.is-mobile-app) #table-sales colgroup col:nth-child(15),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales .thead-detail-row th:nth-child(15),
  body.theme-modern-slate:not(.is-mobile-app) #table-sales tbody td:nth-child(15) {
    width: 7.5% !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   SOLUCIÓN EXCLUSIVA PARA CELULARES Y DISPOSITIVOS MÓVILES (NO RECORTAR CIFRAS NI TEXTO)
   Garantiza que en teléfonos celulares y tablets la tabla de ventas sea 100%
   legible, con números completos visibles y desplazamiento táctil fluido.
──────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 991px), (hover: none) and (pointer: coarse) {
  body.theme-modern-slate .profile-details-grid,
  .is-mobile-app .profile-details-grid,
  body.is-mobile-app .profile-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  body.theme-modern-slate .sales-table-wrapper,
  .is-mobile-app .sales-table-wrapper,
  body.is-mobile-app .sales-table-wrapper,
  .sales-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  body.theme-modern-slate #table-sales,
  .is-mobile-app #table-sales,
  body.is-mobile-app #table-sales,
  #table-sales {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 1250px !important;
    max-width: none !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  body.theme-modern-slate #table-sales colgroup col,
  .is-mobile-app #table-sales colgroup col,
  body.is-mobile-app #table-sales colgroup col,
  #table-sales colgroup col {
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
  }

  body.theme-modern-slate #table-sales th,
  body.theme-modern-slate #table-sales td,
  .is-mobile-app #table-sales th,
  .is-mobile-app #table-sales td,
  body.is-mobile-app #table-sales th,
  body.is-mobile-app #table-sales td,
  #table-sales th,
  #table-sales td {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  body.theme-modern-slate #table-sales colgroup col:nth-child(n),
  body.theme-modern-slate #table-sales .thead-detail-row th:nth-child(n),
  body.theme-modern-slate #table-sales tbody td:nth-child(n),
  .is-mobile-app #table-sales colgroup col:nth-child(n),
  .is-mobile-app #table-sales .thead-detail-row th:nth-child(n),
  .is-mobile-app #table-sales tbody td:nth-child(n),
  body.is-mobile-app #table-sales colgroup col:nth-child(n),
  body.is-mobile-app #table-sales .thead-detail-row th:nth-child(n),
  body.is-mobile-app #table-sales tbody td:nth-child(n) {
    width: auto !important;
    max-width: none !important;
    min-width: unset !important;
  }

  body.theme-modern-slate #table-sales .badge-day,
  .is-mobile-app #table-sales .badge-day,
  body.is-mobile-app #table-sales .badge-day {
    padding: 2px 7px !important;
    font-size: 0.74rem !important;
    display: inline-block !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 540px) {
  body.theme-modern-slate .profile-details-grid,
  .is-mobile-app .profile-details-grid,
  body.is-mobile-app .profile-details-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

/* Reglas por clase explícita is-mobile-app (para cualquier orientación de pantalla móvil) */
.is-mobile-app .sales-table-wrapper,
body.is-mobile-app .sales-table-wrapper {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.is-mobile-app #table-sales,
body.is-mobile-app #table-sales {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 1250px !important;
  max-width: none !important;
}

.is-mobile-app #table-sales colgroup col,
body.is-mobile-app #table-sales colgroup col {
  width: auto !important;
  min-width: unset !important;
  max-width: none !important;
}

.is-mobile-app #table-sales th,
.is-mobile-app #table-sales td,
body.is-mobile-app #table-sales th,
body.is-mobile-app #table-sales td {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  padding: 8px 10px !important;
  font-size: 0.82rem !important;
  width: auto !important;
  max-width: none !important;
}

.is-mobile-app #table-sales colgroup col:nth-child(n),
.is-mobile-app #table-sales .thead-detail-row th:nth-child(n),
.is-mobile-app #table-sales tbody td:nth-child(n),
body.is-mobile-app #table-sales colgroup col:nth-child(n),
body.is-mobile-app #table-sales .thead-detail-row th:nth-child(n),
body.is-mobile-app #table-sales tbody td:nth-child(n) {
  width: auto !important;
  max-width: none !important;
  min-width: unset !important;
}


/* ==========================================================================
   CORRECCIÓN GLOBAL: TOTAL VENTA Y TOTALES EN TODOS LOS REPORTES
   Elimina fondos oscuros (#1a2a3a, negro o azul oscuro) donde los números no se veían.
   Aplica fondo azul claro suave (#dbeafe) con texto azul marino (#1e3a8a) de máximo contraste.
   ========================================================================== */
table tfoot td.col-highlight,
table tfoot td.total-gold,
table tfoot td.col-total-vta,
.table-sales-detail tfoot td.col-highlight,
.table-sales-detail tfoot td.total-gold,
.table-sales-detail tfoot td.col-total-vta,
.table-pm-detail tfoot td.col-highlight,
.data-table tfoot td.col-highlight,
.data-table tfoot td.total-gold,
body.theme-modern-slate table tfoot td.col-highlight,
body.theme-modern-slate table tfoot td.total-gold,
body.theme-modern-slate table tfoot td.col-total-vta,
body.theme-modern-slate .total-gold,
body.theme-modern-slate table tfoot td.positive,
body.theme-modern-slate table tfoot td.negative {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  border: 1px solid #000000 !important;
}

/* En tbody (filas de datos): Total Venta por fila */
body.theme-modern-slate table tbody td.col-highlight,
body.theme-modern-slate .table-sales-detail tbody td.col-highlight,
body.theme-modern-slate .table-pm-detail tbody td.col-highlight,
body.theme-modern-slate .data-table tbody td.col-highlight,
table tbody td.col-highlight {
  background: #eff6ff !important;
  color: #1e40af !important;
  font-weight: 700 !important;
}

/* Encabezados th de Total Venta */
body.theme-modern-slate table thead th.col-highlight,
body.theme-modern-slate .table-sales-detail thead th.col-highlight,
body.theme-modern-slate .table-pm-detail thead th.col-highlight,
body.theme-modern-slate .data-table thead th.col-highlight {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   REORGANIZACIÓN Y BALANCE DE ANCHO DE COLUMNAS EN TODOS LOS REPORTES
   Evita que las columnas y filas queden infladas, desproporcionadas o con espacios vacíos
   ========================================================================== */

/* ==========================================================================
   REORGANIZACIÓN Y BALANCE DE ANCHO DE COLUMNAS EN TODOS LOS REPORTES
   100% ANCHO DE PANTALLA (SIN HUECOS EN BLANCO A LA DERECHA)
   ========================================================================== */

/* 1. PRODUCTOS DIARIOS VENDIDOS (#table-daily-products) */
#table-daily-products {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-daily-products colgroup col:nth-child(1),
#table-daily-products .thead-detail-row th:nth-child(1),
#table-daily-products tbody td:nth-child(1) {
  width: 8.0% !important;
  text-align: center !important;
  white-space: nowrap !important;
}
#table-daily-products colgroup col:nth-child(2),
#table-daily-products .thead-detail-row th:nth-child(2),
#table-daily-products tbody td:nth-child(2) {
  width: 6.5% !important;
  text-align: center !important;
  white-space: nowrap !important;
}
/* Columna Producto (32.0%): amplia para nombres completos */
#table-daily-products colgroup col:nth-child(3),
#table-daily-products .thead-detail-row th:nth-child(3),
#table-daily-products tbody td:nth-child(3) {
  width: 32.0% !important;
  text-align: left !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* Columna Grupo (18.0%): balanceada para categorías y nombres largos sin desbordes */
#table-daily-products colgroup col:nth-child(4),
#table-daily-products .thead-detail-row th:nth-child(4),
#table-daily-products tbody td:nth-child(4),
#table-daily-products tbody td.col-grupo {
  width: 18.0% !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 4px 6px !important;
  box-sizing: border-box !important;
}
#table-daily-products colgroup col:nth-child(5),
#table-daily-products .thead-detail-row th:nth-child(5),
#table-daily-products tbody td:nth-child(5) {
  width: 11.0% !important;
  text-align: right !important;
  white-space: nowrap !important;
}
/* Columna Cantidad (6.5%): angosta, solo números */
#table-daily-products colgroup col:nth-child(6),
#table-daily-products .thead-detail-row th:nth-child(6),
#table-daily-products tbody td:nth-child(6),
#table-daily-products th.th-col-cant {
  width: 6.5% !important;
  text-align: center !important;
  white-space: nowrap !important;
  padding: 5px 2px !important;
  box-sizing: border-box !important;
}
#table-daily-products colgroup col:nth-child(7),
#table-daily-products .thead-detail-row th:nth-child(7),
#table-daily-products tbody td:nth-child(7) {
  width: 18.0% !important;
  text-align: right !important;
  white-space: nowrap !important;
}
#table-daily-products tfoot td {
  width: auto !important;
  min-width: unset !important;
  max-width: none !important;
}

/* 2. PRODUCTOS MENSUALES VENDIDOS (#table-monthly-products) */
#table-monthly-products {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
/* Columna Producto (30.0%): amplia */
#table-monthly-products colgroup col:nth-child(1),
#table-monthly-products .thead-detail-row th:nth-child(1),
#table-monthly-products tbody td:nth-child(1) {
  width: 30.0% !important;
  text-align: left !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* Columna Grupo (18.0%): balanceada para categorías y nombres largos */
#table-monthly-products colgroup col:nth-child(2),
#table-monthly-products .thead-detail-row th:nth-child(2),
#table-monthly-products tbody td:nth-child(2),
#table-monthly-products tbody td.col-grupo {
  width: 18.0% !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 4px 6px !important;
  box-sizing: border-box !important;
}
#table-monthly-products colgroup col:nth-child(3),
#table-monthly-products .thead-detail-row th:nth-child(3),
#table-monthly-products tbody td:nth-child(3) {
  width: 11.0% !important;
  text-align: right !important;
  white-space: nowrap !important;
}
/* Columna Cantidad (7.0%): angosta */
#table-monthly-products colgroup col:nth-child(4),
#table-monthly-products .thead-detail-row th:nth-child(4),
#table-monthly-products tbody td:nth-child(4) {
  width: 7.0% !important;
  text-align: center !important;
  white-space: nowrap !important;
  padding: 5px 2px !important;
  box-sizing: border-box !important;
}
#table-monthly-products colgroup col:nth-child(5),
#table-monthly-products .thead-detail-row th:nth-child(5),
#table-monthly-products tbody td:nth-child(5) {
  width: 18.0% !important;
  text-align: right !important;
  white-space: nowrap !important;
}
/* Columna % Participación (16.0%): barra completa y número alineado sin cortes */
#table-monthly-products colgroup col:nth-child(6),
#table-monthly-products .thead-detail-row th:nth-child(6),
#table-monthly-products tbody td:nth-child(6) {
  width: 16.0% !important;
  text-align: center !important;
  white-space: nowrap !important;
  padding: 5px 8px !important;
  box-sizing: border-box !important;
}
#table-monthly-products tfoot td {
  width: auto !important;
  min-width: unset !important;
  max-width: none !important;
}

/* Pastillas de Grupo en tablas: contención estricta para evitar salidas de celda */
#table-daily-products tbody td .status-pill,
#table-monthly-products tbody td .status-pill,
.table-sales-detail tbody td .status-pill,
.data-table tbody td .status-pill {
  max-width: 100% !important;
  display: inline-block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
}

/* 3. MEDIOS DE PAGO (#table-payment-methods) */
#table-payment-methods {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-payment-methods colgroup col:nth-child(1),
#table-payment-methods th:nth-child(1),
#table-payment-methods td:nth-child(1) { width: 8.5% !important; text-align: center !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(2),
#table-payment-methods th:nth-child(2),
#table-payment-methods td:nth-child(2) { width: 8.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(3),
#table-payment-methods th:nth-child(3),
#table-payment-methods td:nth-child(3) { width: 11.5% !important; text-align: right !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(4),
#table-payment-methods th:nth-child(4),
#table-payment-methods td:nth-child(4) { width: 7.5% !important; text-align: center !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(5),
#table-payment-methods th:nth-child(5),
#table-payment-methods td:nth-child(5) { width: 7.5% !important; text-align: center !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(6),
#table-payment-methods th:nth-child(6),
#table-payment-methods td:nth-child(6) { width: 7.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(7),
#table-payment-methods th:nth-child(7),
#table-payment-methods td:nth-child(7) { width: 10.5% !important; text-align: right !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(8),
#table-payment-methods th:nth-child(8),
#table-payment-methods td:nth-child(8) { width: 10.5% !important; text-align: right !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(9),
#table-payment-methods th:nth-child(9),
#table-payment-methods td:nth-child(9) { width: 10.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(10),
#table-payment-methods th:nth-child(10),
#table-payment-methods td:nth-child(10) { width: 10.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-payment-methods colgroup col:nth-child(11),
#table-payment-methods th:nth-child(11),
#table-payment-methods td:nth-child(11) { width: 9.0% !important; text-align: right !important; white-space: nowrap !important; }

/* 4. COMPRAS X PROVEEDOR (#table-suppliers) */
#table-suppliers {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-suppliers colgroup col:nth-child(1),
#table-suppliers .thead-detail-row th:nth-child(1),
#table-suppliers tbody td:nth-child(1) { width: 10.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-suppliers colgroup col:nth-child(2),
#table-suppliers .thead-detail-row th:nth-child(2),
#table-suppliers tbody td:nth-child(2) { width: 12.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-suppliers colgroup col:nth-child(3),
#table-suppliers .thead-detail-row th:nth-child(3),
#table-suppliers tbody td:nth-child(3) { width: 10.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-suppliers colgroup col:nth-child(4),
#table-suppliers .thead-detail-row th:nth-child(4),
#table-suppliers tbody td:nth-child(4) { width: 48.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-suppliers colgroup col:nth-child(5),
#table-suppliers .thead-detail-row th:nth-child(5),
#table-suppliers tbody td:nth-child(5) { width: 20.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-suppliers tfoot td { width: auto !important; min-width: unset !important; }

/* 5. INSUMOS Y MATERIA PRIMA (#table-insumos) */
#table-insumos {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-insumos colgroup col:nth-child(1),
#table-insumos .thead-detail-row th:nth-child(1),
#table-insumos tbody td:nth-child(1) { width: 8.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(2),
#table-insumos .thead-detail-row th:nth-child(2),
#table-insumos tbody td:nth-child(2) { width: 20.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(3),
#table-insumos .thead-detail-row th:nth-child(3),
#table-insumos tbody td:nth-child(3) { width: 30.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(4),
#table-insumos .thead-detail-row th:nth-child(4),
#table-insumos tbody td:nth-child(4) { width: 12.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(5),
#table-insumos .thead-detail-row th:nth-child(5),
#table-insumos tbody td:nth-child(5) { width: 11.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(6),
#table-insumos .thead-detail-row th:nth-child(6),
#table-insumos tbody td:nth-child(6) { width: 5.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-insumos colgroup col:nth-child(7),
#table-insumos .thead-detail-row th:nth-child(7),
#table-insumos tbody td:nth-child(7) { width: 14.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-insumos tfoot td { width: auto !important; min-width: unset !important; }

/* 6. GASTOS OPERATIVOS (#table-expenses) */
#table-expenses {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-expenses colgroup col:nth-child(1),
#table-expenses .thead-detail-row th:nth-child(1),
#table-expenses tbody td:nth-child(1) { width: 11.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-expenses colgroup col:nth-child(2),
#table-expenses .thead-detail-row th:nth-child(2),
#table-expenses tbody td:nth-child(2) { width: 11.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-expenses colgroup col:nth-child(3),
#table-expenses .thead-detail-row th:nth-child(3),
#table-expenses tbody td:nth-child(3) { width: 58.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-expenses colgroup col:nth-child(4),
#table-expenses .thead-detail-row th:nth-child(4),
#table-expenses tbody td:nth-child(4) { width: 20.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-expenses tfoot td { width: auto !important; min-width: unset !important; }

/* 7. NÓMINA (#table-payroll) */
#table-payroll {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-payroll colgroup col:nth-child(1),
#table-payroll .thead-detail-row th:nth-child(1),
#table-payroll tbody td:nth-child(1) { width: 11.0% !important; text-align: center !important; white-space: nowrap !important; }
#table-payroll colgroup col:nth-child(2),
#table-payroll .thead-detail-row th:nth-child(2),
#table-payroll tbody td:nth-child(2) { width: 33.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-payroll colgroup col:nth-child(3),
#table-payroll .thead-detail-row th:nth-child(3),
#table-payroll tbody td:nth-child(3) { width: 36.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-payroll colgroup col:nth-child(4),
#table-payroll .thead-detail-row th:nth-child(4),
#table-payroll tbody td:nth-child(4) { width: 20.0% !important; text-align: right !important; white-space: nowrap !important; }
#table-payroll tfoot td { width: auto !important; min-width: unset !important; }

/* 8. COSTO RECETA / COGS (#table-cogs) */
#table-cogs {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-cogs colgroup col:nth-child(1),
#table-cogs th:nth-child(1),
#table-cogs td:nth-child(1) { width: 20% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(2),
#table-cogs th:nth-child(2),
#table-cogs td:nth-child(2) { width: 13% !important; text-align: center !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(3),
#table-cogs th:nth-child(3),
#table-cogs td:nth-child(3) { width: 10% !important; text-align: right !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(4),
#table-cogs th:nth-child(4),
#table-cogs td:nth-child(4) { width: 7% !important; text-align: center !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(5),
#table-cogs th:nth-child(5),
#table-cogs td:nth-child(5) { width: 12% !important; text-align: right !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(6),
#table-cogs th:nth-child(6),
#table-cogs td:nth-child(6) { width: 12% !important; text-align: right !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(7),
#table-cogs th:nth-child(7),
#table-cogs td:nth-child(7) { width: 12% !important; text-align: right !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(8),
#table-cogs th:nth-child(8),
#table-cogs td:nth-child(8) { width: 7% !important; text-align: center !important; white-space: nowrap !important; }
#table-cogs colgroup col:nth-child(9),
#table-cogs th:nth-child(9),
#table-cogs td:nth-child(9) { width: 7% !important; text-align: center !important; white-space: nowrap !important; }
#table-cogs tfoot td { width: auto !important; min-width: unset !important; }

/* 9. ALMUERZO PERSONAL Y MERMAS/BAJAS (#table-staff-lunch, #table-waste) */
#table-staff-lunch, #table-waste {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
#table-waste colgroup col:nth-child(1),
#table-waste th:nth-child(1),
#table-waste td:nth-child(1),
#table-staff-lunch colgroup col:nth-child(1),
#table-staff-lunch th:nth-child(1),
#table-staff-lunch td:nth-child(1) { width: 13.0% !important; text-align: center !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(2),
#table-waste th:nth-child(2),
#table-waste td:nth-child(2),
#table-staff-lunch colgroup col:nth-child(2),
#table-staff-lunch th:nth-child(2),
#table-staff-lunch td:nth-child(2) { width: 36.0% !important; text-align: left !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(3),
#table-waste th:nth-child(3),
#table-waste td:nth-child(3),
#table-staff-lunch colgroup col:nth-child(3),
#table-staff-lunch th:nth-child(3),
#table-staff-lunch td:nth-child(3) { width: 6.0% !important; text-align: center !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(4),
#table-waste th:nth-child(4),
#table-waste td:nth-child(4),
#table-staff-lunch colgroup col:nth-child(4),
#table-staff-lunch th:nth-child(4),
#table-staff-lunch td:nth-child(4) { width: 9.0% !important; text-align: right !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(5),
#table-waste th:nth-child(5),
#table-waste td:nth-child(5),
#table-staff-lunch colgroup col:nth-child(5),
#table-staff-lunch th:nth-child(5),
#table-staff-lunch td:nth-child(5) { width: 12.0% !important; text-align: right !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(6),
#table-waste th:nth-child(6),
#table-waste td:nth-child(6),
#table-staff-lunch colgroup col:nth-child(6),
#table-staff-lunch th:nth-child(6),
#table-staff-lunch td:nth-child(6) { width: 14.0% !important; text-align: right !important; white-space: nowrap !important; }

#table-waste colgroup col:nth-child(7),
#table-waste th:nth-child(7),
#table-waste td:nth-child(7),
#table-staff-lunch colgroup col:nth-child(7),
#table-staff-lunch th:nth-child(7),
#table-staff-lunch td:nth-child(7) { width: 10.0% !important; text-align: center !important; white-space: nowrap !important; }

#table-tips, #table-propinas-colaboradores, #table-propinas-settlements, #table-propinas-diario {
  width: 100% !important;
  table-layout: auto !important;
}

/* En dispositivos móviles (pantallas <= 991px o .is-mobile-app): las tablas usan desplazamiento fluido */
@media (max-width: 991px), (hover: none) and (pointer: coarse) {
  #table-daily-products,
  #table-monthly-products,
  #table-suppliers,
  #table-insumos,
  #table-expenses,
  #table-payroll,
  #table-cogs,
  #table-payment-methods,
  #table-staff-lunch,
  #table-waste,
  #table-tips,
  #table-propinas-colaboradores,
  #table-propinas-settlements,
  #table-propinas-diario {
    width: max-content !important;
    min-width: 1000px !important;
    max-width: none !important;
    table-layout: auto !important;
  }
}

/* Desactivar sticky/top en cabeceras de todas las tablas en theme-modern-slate para evitar superposición */
body.theme-modern-slate .table-sales-detail thead th,
body.theme-modern-slate .table-pm-detail thead th,
body.theme-modern-slate .data-table thead th,
body.theme-modern-slate #table-cogs thead th {
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
}

/* ==========================================================================
   ACTUALIZACIÓN OFICIAL EN TODA LA PLATAFORMA:
   PASTILLAS KPI VENTAS DIARIAS: 100% ANCHO DE PANTALLA, MENOR ALTURA (COMPACTAS)
   ========================================================================== */
body.theme-modern-slate .kpi-grid-sales,
.kpi-grid-sales {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: 2fr 1fr 1fr 1fr !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  align-items: stretch !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-card,
.kpi-grid-sales .kpi-card {
  padding: 8px 14px !important;
  min-height: auto !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  box-sizing: border-box !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-label,
.kpi-grid-sales .kpi-label {
  font-size: 10px !important;
  letter-spacing: 0.3px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-val,
.kpi-grid-sales .kpi-val {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  margin: 1px 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-comparatives,
.kpi-grid-sales .kpi-comparatives {
  margin-top: 4px !important;
  padding-top: 4px !important;
  border-top: 1px solid #e2e8f0 !important;
  gap: 2px !important;
  display: flex !important;
  flex-direction: column !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-comp-row,
.kpi-grid-sales .kpi-comp-row {
  font-size: 0.76rem !important;
  line-height: 1.2 !important;
  gap: 5px !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-comp-row i,
.kpi-grid-sales .kpi-comp-row i {
  font-size: 0.78rem !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-comp-val,
.kpi-grid-sales .kpi-comp-val {
  font-size: 0.8rem !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-comp-delta,
.kpi-grid-sales .kpi-comp-delta {
  font-size: 0.72rem !important;
  padding: 0 4px !important;
}

body.theme-modern-slate .kpi-grid-sales .kpi-sub,
.kpi-grid-sales .kpi-sub {
  font-size: 0.78rem !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

@media (max-width: 1100px) {
  body.theme-modern-slate .kpi-grid-sales,
  .kpi-grid-sales {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 600px) {
  body.theme-modern-slate .kpi-grid-sales,
  .kpi-grid-sales {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   TORRE DE CONTROL MULTI-EMPRESA: 100% ANCHO SIN DESPLAZAMIENTO HORIZONTAL
   ========================================================================== */
body.theme-modern-slate .tower-table-card,
.tower-table-card {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

body.theme-modern-slate .tower-table-wrapper,
.tower-table-wrapper {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.theme-modern-slate .tower-table,
.tower-table {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

body.theme-modern-slate .tower-table th,
body.theme-modern-slate .tower-table td,
.tower-table th,
.tower-table td {
  min-width: 0 !important;
  padding: 6px 4px !important;
  font-size: 12.5px !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  word-break: normal !important;
}

body.theme-modern-slate .tower-table thead th,
.tower-table thead th {
  padding: 8px 3px !important;
  font-size: 11px !important;
  letter-spacing: 0.1px !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
  word-break: break-word !important;
}

body.theme-modern-slate .table-company-cell,
.table-company-cell {
  gap: 1px !important;
}

body.theme-modern-slate .table-company-name,
.table-company-name {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
}

body.theme-modern-slate .table-company-sub,
.table-company-sub {
  font-size: 10px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.theme-modern-slate .tower-table .metric-pill,
.tower-table .metric-pill {
  font-size: 10px !important;
  padding: 1px 4px !important;
  line-height: 1.1 !important;
}

body.theme-modern-slate .tower-table .badge-health-pill,
.tower-table .badge-health-pill {
  font-size: 9.5px !important;
  padding: 2px 4px !important;
  white-space: nowrap !important;
}

body.theme-modern-slate .tower-table .btn-tower-enter,
.tower-table .btn-tower-enter {
  padding: 3px 6px !important;
  font-size: 10.5px !important;
}

body.theme-modern-slate .tower-table colgroup col:nth-child(1),
body.theme-modern-slate .tower-table thead th:nth-child(1),
body.theme-modern-slate .tower-table tbody td:nth-child(1),
body.theme-modern-slate .tower-table tfoot td:nth-child(1) { width: 15% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(2),
body.theme-modern-slate .tower-table thead th:nth-child(2),
body.theme-modern-slate .tower-table tbody td:nth-child(2),
body.theme-modern-slate .tower-table tfoot td:nth-child(2) { width: 6.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(3),
body.theme-modern-slate .tower-table thead th:nth-child(3),
body.theme-modern-slate .tower-table tbody td:nth-child(3),
body.theme-modern-slate .tower-table tfoot td:nth-child(3) { width: 9.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(4),
body.theme-modern-slate .tower-table thead th:nth-child(4),
body.theme-modern-slate .tower-table tbody td:nth-child(4),
body.theme-modern-slate .tower-table tfoot td:nth-child(4) { width: 9.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(5),
body.theme-modern-slate .tower-table thead th:nth-child(5),
body.theme-modern-slate .tower-table tbody td:nth-child(5),
body.theme-modern-slate .tower-table tfoot td:nth-child(5) { width: 8.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(6),
body.theme-modern-slate .tower-table thead th:nth-child(6),
body.theme-modern-slate .tower-table tbody td:nth-child(6),
body.theme-modern-slate .tower-table tfoot td:nth-child(6) { width: 8.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(7),
body.theme-modern-slate .tower-table thead th:nth-child(7),
body.theme-modern-slate .tower-table tbody td:nth-child(7),
body.theme-modern-slate .tower-table tfoot td:nth-child(7) { width: 9.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(8),
body.theme-modern-slate .tower-table thead th:nth-child(8),
body.theme-modern-slate .tower-table tbody td:nth-child(8),
body.theme-modern-slate .tower-table tfoot td:nth-child(8) { width: 5.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(9),
body.theme-modern-slate .tower-table thead th:nth-child(9),
body.theme-modern-slate .tower-table tbody td:nth-child(9),
body.theme-modern-slate .tower-table tfoot td:nth-child(9) { width: 8.5% !important; }

body.theme-modern-slate .tower-table colgroup col:nth-child(10),
body.theme-modern-slate .tower-table thead th:nth-child(10),
body.theme-modern-slate .tower-table tbody td:nth-child(10),
body.theme-modern-slate .tower-table tfoot td:nth-child(10) {
  width: 11.5% !important;
  text-align: center !important;
  overflow: hidden !important;
  padding: 4px 2px !important;
}

body.theme-modern-slate .tower-table colgroup col:nth-child(11),
body.theme-modern-slate .tower-table thead th:nth-child(11),
body.theme-modern-slate .tower-table tbody td:nth-child(11),
body.theme-modern-slate .tower-table tfoot td:nth-child(11) { width: 7.5% !important; }

body.theme-modern-slate .tower-table .badge-health-pill,
.tower-table .badge-health-pill {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  text-align: center !important;
}


/* ==========================================================================
   CORRECCIÓN OFICIAL v10.114: VISIBILIDAD DE BOTÓN CREAR EMPRESA Y BOTÓN DE INGRESO
   Garantiza contraste nítido, texto blanco y degradado corporativo en PC y Celular
   ========================================================================== */
#btn-master-create-company,
.master-header-actions #btn-master-create-company,
.is-mobile-app .master-header-actions #btn-master-create-company {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
  color: #ffffff !important;
  border: 1px solid #0f766e !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3) !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  cursor: pointer !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#btn-master-create-company:hover,
.master-header-actions #btn-master-create-company:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

#btn-master-create-company *,
.master-header-actions #btn-master-create-company * {
  color: #ffffff !important;
  visibility: visible !important;
}

/* Botón de Iniciar Sesión ("INGRESAR AL SISTEMA") en Web y Celulares */
.btn-login-gradient,
body.is-web-version .btn-login-gradient,
body.is-mobile-app .btn-login-gradient,
.is-mobile-app .btn.btn-login-gradient,
#login-form button[type="submit"] {
  background: linear-gradient(90deg, #1e3a5f 0%, #2563eb 55%, #1d4ed8 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 20px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(30, 58, 95, 0.32) !important;
  transition: all 0.25s ease !important;
  margin-top: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  cursor: pointer !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.btn-login-gradient:hover,
body.is-web-version .btn-login-gradient:hover,
body.is-mobile-app .btn-login-gradient:hover,
#login-form button[type="submit"]:hover {
  background: linear-gradient(90deg, #162d4a 0%, #1e40af 55%, #1e3a8a 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 22px rgba(30, 58, 95, 0.42) !important;
}

.btn-login-gradient *,
body.is-web-version .btn-login-gradient *,
body.is-mobile-app .btn-login-gradient *,
.is-mobile-app .btn.btn-login-gradient *,
#login-form button[type="submit"] * {
  color: #ffffff !important;
  visibility: visible !important;
}

/* ==========================================================================
   GOOGLE RECAPTCHA v3 STYLES
   ========================================================================== */
.recaptcha-legal-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.recaptcha-legal-badge a {
  color: #0284c7 !important;
  transition: color 0.15s ease;
}

.recaptcha-legal-badge a:hover {
  color: #0369a1 !important;
}

.grecaptcha-badge {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  position: fixed !important;
  bottom: 14px !important;
  right: 0px !important;
  z-index: 999999 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22) !important;
  border-radius: 4px 0 0 4px !important;
  transition: all 0.25s ease-in-out !important;
}

/* Ocultar la insignia flotante cuando el usuario ya ha iniciado sesión en el sistema */
body.dashboard-screen-active .grecaptcha-badge,
.has-active-session .grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Botones de Gestión de Tarifas de Planes (Panel Master y Móvil) */
#btn-master-edit-plans,
.master-header-actions #btn-master-edit-plans,
.is-mobile-app .master-header-actions #btn-master-edit-plans {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #0b192c !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 11.5px !important;
  height: 28px !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#btn-master-edit-plans:hover,
.master-header-actions #btn-master-edit-plans:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

#btn-master-edit-plans:hover i,
#btn-master-edit-plans:hover span {
  color: #ffffff !important;
}

#btn-master-edit-plans-toolbar {
  transition: all 0.2s ease !important;
}

#btn-master-edit-plans-toolbar:hover {
  background: rgba(245, 158, 11, 0.25) !important;
  transform: translateY(-1px) !important;
}


/* ==========================================================================
   PASTILLA EJECUTIVA DE LA EMPRESA & TABLERO EJECUTIVO (DASHBOARD GENERAL)
   ========================================================================== */

/* Pastilla Ejecutiva Horizontal de la Empresa */
.company-executive-pill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.exec-pill-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.company-avatar-box.mini {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  border: 1.5px solid #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.exec-pill-company-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exec-pill-company-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exec-tag-reg {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

.exec-company-title {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  margin: 0;
  white-space: nowrap;
}

.exec-nit-badge {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.exec-btn-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.exec-btn-info-pill:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

.exec-pill-divider {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
  margin: 0 2px;
}

.exec-pill-contract {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exec-contract-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.exec-contract-badge.plan {
  background: #fffbeb;
  color: #92400e;
  border: 1.5px solid #f59e0b;
}

.exec-contract-badge.period {
  background: #f8fafc;
  color: #0f172a;
  border: 1.5px solid #000000;
}

.exec-contract-badge.audit {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.exec-pill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.exec-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.exec-action-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.exec-action-pill.backup {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.exec-action-pill.backup:hover {
  background: #dbeafe;
}

.exec-action-pill.mobile {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.exec-action-pill.mobile:hover {
  background: #dcfce7;
}

.exec-action-pill.switch {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.exec-action-pill.switch:hover {
  background: #f3e8ff;
}

.exec-action-pill.modules {
  background: #fefce8;
  color: #854d0e;
  border-color: #fef08a;
}
.exec-action-pill.modules:hover {
  background: #fef9c3;
}

.exec-action-pill.logout {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.exec-action-pill.logout:hover {
  background: #fee2e2;
}

/* Modal de Ficha Corporativa */
.company-info-modal-card {
  max-width: 650px;
  width: 95%;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #000000;
}

.profile-details-grid.modal-version {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

/* ==========================================================================
   TABLERO EJECUTIVO (DASHBOARD GENERAL - TAB-0-DASHBOARD)
   ========================================================================== */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.executive-kpi-card {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.2s ease;
}

.executive-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.kpi-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sales-gradient {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.profit-gradient {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.cogs-gradient {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.expenses-gradient {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.ticket-gradient {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.health-gradient {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 3px;
  display: block;
}

.kpi-value {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 5px 0;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.3px;
}

.kpi-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-badge.days {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.kpi-badge.profit-badge {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.kpi-badge.cogs-badge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.kpi-badge.expenses-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.kpi-badge.ticket-badge {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

.kpi-badge.health-badge {
  background: #cffafe;
  color: #0e7490;
  border: 1px solid #67e8f9;
}

.kpi-subtext {
  font-size: 11px;
  color: #64748b;
}

/* Grillas de Widgets de Visualización */
.dashboard-visuals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dash-widget-card {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.widget-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title-area h5 {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.widget-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

/* Barra Apilada de P&L */
.pnl-stacked-bar-container {
  margin-bottom: 16px;
}

.pnl-stacked-bar {
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  background: #f1f5f9;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pnl-segment {
  height: 100%;
  transition: width 0.6s ease;
}

.segment-cogs {
  background: #f59e0b;
}
.segment-payroll {
  background: #3b82f6;
}
.segment-expenses {
  background: #ef4444;
}
.segment-net {
  background: #10b981;
}

.pnl-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.pnl-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-cogs {
  background: #f59e0b;
}
.dot-payroll {
  background: #3b82f6;
}
.dot-expenses {
  background: #ef4444;
}
.dot-net {
  background: #10b981;
}

.legend-name {
  display: block;
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}

.legend-val {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

/* Formas de Pago */
.payment-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.payment-bar-label {
  width: 120px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.payment-bar-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}

.payment-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

.payment-bar-val {
  width: 140px;
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  flex-shrink: 0;
}

/* Kasavana 4 Cuadrantes Resumen */
.kasavana-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kasavana-quad-mini {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid;
  text-align: center;
  transition: all 0.2s;
}

.kasavana-quad-mini:hover {
  transform: translateY(-1px);
}

.kasavana-quad-mini.stars {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}
.kasavana-quad-mini.plowhorses {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}
.kasavana-quad-mini.puzzles {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.kasavana-quad-mini.dogs {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.quad-mini-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
}

.quad-count {
  font-size: 22px;
  font-weight: 800;
  display: block;
  margin: 3px 0 1px 0;
  font-family: 'Inter', sans-serif;
}

.quad-desc {
  font-size: 10px;
  opacity: 0.85;
  display: block;
}

/* Top Platos */
.top-products-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  gap: 10px;
}

.top-prod-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.top-prod-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-prod-rank.rank-1 {
  background: #fef08a;
  color: #854d0e;
}
.top-prod-rank.rank-2 {
  background: #e2e8f0;
  color: #334155;
}
.top-prod-rank.rank-3 {
  background: #fed7aa;
  color: #9a3412;
}

.top-prod-name {
  font-weight: 600;
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-prod-stats {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
  text-align: right;
}

/* Centro de Accesos Directos */
.dashboard-quick-links-card {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.quick-links-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid #000000;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quick-link-btn:hover {
  background: #eef2ff;
  border-color: #4f46e5;
  color: #4338ca;
  transform: translateY(-1px);
}

.quick-link-btn i {
  font-size: 14px;
  color: #4f46e5;
}

/* Responsividad */
@media (max-width: 768px) {
  .company-executive-pill-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .exec-pill-identity {
    justify-content: space-between;
  }
  .exec-pill-contract,
  .exec-pill-actions {
    justify-content: flex-start;
  }
  .exec-pill-divider {
    display: none;
  }
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-visuals-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   PASTILLA DE CUENTA Y MODAL DE CUENTA (EMPRESA, CONTRATO Y USUARIOS)
   ========================================================================== */

/* Botón Pastilla Cuenta en la Barra Superior */
.btn-topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 8px;
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.btn-topbar-account:hover {
  background: #f8fafc;
  border-color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.account-pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
}

.account-pill-texts {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.account-pill-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4f46e5;
}

.account-pill-company {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-pill-chevron {
  font-size: 10px;
  color: #64748b;
  margin-left: 2px;
}

/* Modal de Cuenta */
.account-modal-card {
  max-width: 820px;
  width: 95%;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid #000000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.account-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4338ca;
  border: 1.5px solid #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.account-header-company-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  display: block;
}

/* Pestañas de Navegación del Modal (Empresa | Contrato | Usuarios) */
.account-tabs-nav {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
}

.account-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-tab-btn:hover {
  color: #0f172a;
}

.account-tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: #ffffff;
}

/* Paneles de Contenido */
.account-modal-body {
  padding: 20px;
  max-height: 68vh;
  overflow-y: auto;
}

.account-tab-pane {
  display: none;
}

.account-tab-pane.active {
  display: block;
}

.account-section-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #4f46e5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
}

.account-section-intro strong {
  color: #0f172a;
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
}

.account-section-intro p {
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

/* Cartas de Contrato */
.contract-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.contract-card-item {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.contract-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.contract-card-icon.plan-icon {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.contract-card-icon.billing-icon {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.contract-card-icon.audit-icon {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.contract-card-icon.role-icon {
  background: #faf5ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.contract-card-details {
  flex: 1;
  min-width: 0;
}

.contract-card-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  display: block;
  margin-bottom: 3px;
}

.contract-card-val {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
}

.contract-card-desc {
  font-size: 11px;
  color: #64748b;
  display: block;
  line-height: 1.3;
}

.badge-role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.contract-status-active-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Gestión de Usuarios */
.account-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.users-pane-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-pane-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin: 2px 0 0 0;
}

/* Formulario Crear Usuario */
.create-user-box {
  background: #f8fafc;
  border: 1.5px solid #4f46e5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.create-user-box-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #4f46e5;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.create-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.form-group-sm label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.form-input-sm,
.form-select-sm {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid #000000;
  border-radius: 6px;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
}

.form-input-sm:focus,
.form-select-sm:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.create-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Tabla de Usuarios */
.account-users-table-wrapper {
  overflow-x: auto;
  border: 1.5px solid #000000;
  border-radius: 10px;
}

.account-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.account-users-table thead th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 1.5px solid #000000;
}

.account-users-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.account-users-table tbody tr:last-child td {
  border-bottom: none;
}

.account-users-table tbody tr:hover {
  background: #f8fafc;
}

.user-badge-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.user-badge-role.master {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.user-badge-role.lite {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.user-badge-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}


/* Modo Lista para Gestión de Cuenta */
.account-modal-card {
  max-width: 580px !important;
  width: 92% !important;
}

.account-data-list {
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.account-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  gap: 14px;
  transition: background 0.15s ease;
}

.account-data-row:last-child {
  border-bottom: none;
}

.account-data-row:hover {
  background: #f8fafc;
}

.data-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

.data-row-label i {
  width: 16px;
  text-align: center;
  font-size: 13px;
  color: #4f46e5;
}

.data-row-value {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}

@media (max-width: 560px) {
  .account-data-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .data-row-value {
    text-align: left;
    padding-left: 26px;
  }
}
