/*
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║  FacturaPoint Layout System  v1.0                                ║
 * ║  Sidebar · Topbar · Footer — independiente de Gentelella         ║
 * ║  Sidebar themes: light (#fff) · dark (#111c43)                   ║
 * ╚══════════════════════════════════════════════════════════════════╝
 */

/* ══════════════════════════════════════════════════════════════
   TOKENS
   ══════════════════════════════════════════════════════════════ */
:root {
  --fp-sb-w:      260px;
  --fp-sb-w-sm:    72px;
  --fp-tb-h:       60px;
  --fp-tr:        .22s cubic-bezier(.4,0,.2,1);
  --fp-r:          8px;
  --fp-r-sm:       6px;

  /* Topbar */
  --fp-tb-bg:      #ffffff;
  --fp-tb-bdr:     #e8eaee;
  --fp-tb-shadow:  0 1px 0 #e8eaee, 0 4px 16px rgba(0,0,0,.04);
  --fp-tb-t:       #3d4350;
  --fp-tb-t-dim:   #9ea6b4;

  /* Sidebar light */
  --fp-sb-bg:        #ffffff;
  --fp-sb-bdr:       #e8eaee;
  --fp-sb-logo-bdr:  #f0f2f5;
  --fp-sb-section-t: #9ea6b4;
  --fp-sb-t:         #6b7385;
  --fp-sb-t-hi:      #1a1d23;
  --fp-sb-icon:      #9ea6b4;
  --fp-sb-icon-act:  #F77F00;
  --fp-sb-hover:     #fff6ee;
  --fp-sb-active:    #fff0e6;
  --fp-sb-accent:    #F77F00;
  --fp-sb-sub-bg:    #f8f9fb;
  --fp-sb-sub-t:     #6b7385;
  --fp-sb-foot-bg:   #f8f9fb;

  /* Footer */
  --fp-ft-bg:  #ffffff;
  --fp-ft-bdr: #e8eaee;
  --fp-ft-t:   #9ea6b4;
}

/* ── Dark sidebar overrides (aplicados vía data-theme="dark") ── */
#fp-sidebar[data-theme="dark"] {
  --fp-sb-bg:        #111c43;
  --fp-sb-bdr:       rgba(255,255,255,.08);
  --fp-sb-logo-bdr:  rgba(255,255,255,.06);
  --fp-sb-section-t: rgba(255,255,255,.3);
  --fp-sb-t:         rgba(255,255,255,.55);
  --fp-sb-t-hi:      rgba(255,255,255,.92);
  --fp-sb-icon:      rgba(255,255,255,.35);
  --fp-sb-icon-act:  #F77F00;
  --fp-sb-hover:     rgba(255,255,255,.06);
  --fp-sb-active:    rgba(247,127,0,.18);
  --fp-sb-accent:    #F77F00;
  --fp-sb-sub-bg:    rgba(0,0,0,.15);
  --fp-sb-sub-t:     rgba(255,255,255,.45);
  --fp-sb-foot-bg:   rgba(0,0,0,.15);
}

/* ══════════════════════════════════════════════════════════════
   RESET GENTELELLA LAYOUT
   ══════════════════════════════════════════════════════════════ */
body.fp-layout,
body.fp-layout .container.body,
body.fp-layout .main_container {
  display: block !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  position: static !important;
  min-height: 100vh !important;
}

/* Quitar la col-md-3 que gentelella pone en el sidebar */
body.fp-layout .col-md-3.left_col {
  display: none !important;
}

/* El right_col ya no necesita margin-left de Gentelella */
body.fp-layout .right_col {
  margin-left: 0 !important;
  padding: 20px 24px 24px !important;
  min-height: 0 !important;
  background: var(--bg, #f0f2f5) !important;
  width: 100% !important;
  float: none !important;
}

/* Quitar estilos de container heredados de Gentelella */
body.fp-layout .container.body {
  padding: 0 !important;
  width: 100% !important;
  min-height: auto !important;
}
body.fp-layout .main_container {
  min-height: auto !important;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
#fp-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--fp-sb-w);
  background: var(--fp-sb-bg);
  border-right: 1px solid var(--fp-sb-bdr);
  box-shadow: 2px 0 12px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width var(--fp-tr), background var(--fp-tr), border-color var(--fp-tr);
  overflow: hidden;
}

/* Collapsed */
body.fp-sb-collapsed #fp-sidebar {
  width: var(--fp-sb-w-sm);
  overflow: visible; /* permite que los flyouts de submenú salgan del sidebar */
}

/* Mobile: oculto por defecto */
@media (max-width: 767px) {
  #fp-sidebar {
    transform: translateX(-100%);
    width: var(--fp-sb-w);
    transition: transform var(--fp-tr), background var(--fp-tr);
    z-index: 1060;
  }
  body.fp-sb-mobile-open #fp-sidebar {
    transform: translateX(0);
  }
}

/* ── Logo ── */
.fp-sb-logo {
  flex-shrink: 0;
  height: var(--fp-tb-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--fp-sb-logo-bdr);
  transition: padding var(--fp-tr);
  text-decoration: none;
  overflow: hidden;
}
.fp-sb-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
  width: 100%;
}
.fp-sb-logo .logo-expanded {
  height: 36px;
  display: block;
  transition: opacity var(--fp-tr), width var(--fp-tr);
  opacity: 1;
  max-width: 160px;
  object-fit: contain;
}
.fp-sb-logo .logo-collapsed {
  height: 32px;
  display: none;
  flex-shrink: 0;
}
body.fp-sb-collapsed .fp-sb-logo {
  padding: 0;
  justify-content: center;
  overflow: visible;
}
body.fp-sb-collapsed .fp-sb-logo a {
  justify-content: center;
  overflow: visible;
  width: 100%;
}
body.fp-sb-collapsed .fp-sb-logo .logo-expanded { display: none; }
body.fp-sb-collapsed .fp-sb-logo .logo-collapsed { display: block; }

/* ── Scroll area ── */
.fp-sb-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--fp-sb-bdr) transparent;
}
.fp-sb-scroll::-webkit-scrollbar { width: 3px; }
.fp-sb-scroll::-webkit-scrollbar-track { background: transparent; }
.fp-sb-scroll::-webkit-scrollbar-thumb { background: var(--fp-sb-bdr); border-radius: 3px; }
/* Collapsed: scroll normal (submenú inline ya no necesita overflow visible) */
body.fp-sb-collapsed .fp-sb-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── CFDI Quick ── */
.fp-sb-quick-wrap {
  margin: 8px 10px 4px;
  position: relative;
}
body.fp-sb-collapsed .fp-sb-quick-wrap { display: none; }

/* ── Nav section label ── */
.fp-sb-section {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fp-sb-section-t);
  padding: 14px 18px 5px;
  transition: all var(--fp-tr);
  white-space: nowrap;
}
body.fp-sb-collapsed .fp-sb-section {
  text-align: center;
  padding: 14px 0 5px;
  font-size: 0;
  letter-spacing: 0;
}
body.fp-sb-collapsed .fp-sb-section::before {
  content: '';
  display: block;
  height: 1px;
  width: 32px;
  margin: 6px auto 0;
  background: var(--fp-sb-bdr);
  font-size: 0;
}

/* ── Nav item ── */
.fp-nav-item { list-style: none; }

.fp-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 14px;
  margin: 1px 8px;
  border-radius: var(--fp-r-sm);
  color: var(--fp-sb-t);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--fp-tr), color var(--fp-tr);
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: none;
  width: calc(100% - 16px);
  box-sizing: border-box;
  position: relative;
}
.fp-nav-link:hover {
  background: var(--fp-sb-hover);
  color: var(--fp-sb-t-hi);
  text-decoration: none !important;
}
.fp-nav-link.active,
.fp-nav-item.open > .fp-nav-link {
  background: var(--fp-sb-active);
  color: var(--fp-sb-accent);
  font-weight: 600;
}
.fp-nav-link.active .fp-nav-icon { color: var(--fp-sb-icon-act) !important; }
.fp-nav-link:hover .fp-nav-icon   { color: var(--fp-sb-icon-act) !important; }
.fp-nav-item.open > .fp-nav-link .fp-nav-icon { color: var(--fp-sb-icon-act) !important; }

/* ── Icon ── */
.fp-nav-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 22px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
  color: var(--fp-sb-icon);
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24;
  transition: color var(--fp-tr);
}

/* ── Label ── */
.fp-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--fp-tr), width var(--fp-tr);
}

/* ── Arrow for submenus ── */
.fp-nav-arrow {
  font-family: 'Material Symbols Rounded';
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  flex-shrink: 0;
  color: var(--fp-sb-icon);
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 20;
  transition: transform var(--fp-tr), opacity var(--fp-tr);
  margin-left: auto;
}
.fp-nav-item.open > .fp-nav-link .fp-nav-arrow { transform: rotate(180deg); }

/* ── Collapsed: hide labels and arrows ── */
body.fp-sb-collapsed .fp-nav-label,
body.fp-sb-collapsed .fp-nav-arrow { display: none !important; }
body.fp-sb-collapsed .fp-nav-link {
  justify-content: center !important;
  align-items: center !important;
  padding: 10px 0 !important;
  margin: 2px 0 !important;
  width: 100% !important;
  gap: 0 !important;
  overflow: visible;
}
body.fp-sb-collapsed .fp-nav-icon {
  width: 24px !important;
  font-size: 24px !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.fp-sb-collapsed .fp-sb-section { display: none; }
body.fp-sb-collapsed .fp-nav-list { padding: 0 !important; }

/* ── Tooltip en collapsed ── */
body.fp-sb-collapsed .fp-nav-item { position: relative; }
body.fp-sb-collapsed .fp-nav-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--fp-sb-w-sm) + 4px);
  top: 50%; transform: translateY(-50%);
  background: #1a1d23;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 1080;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
body.fp-sb-collapsed .fp-nav-link[data-tooltip]:hover::after { opacity: 1; }

/* ── Submenu ── */
.fp-nav-sub {
  list-style: none;
  padding: 2px 0 4px 0;
  margin: 0;
  display: none;
  background: var(--fp-sb-sub-bg);
  border-radius: 0 0 var(--fp-r-sm) var(--fp-r-sm);
  overflow: hidden;
}
.fp-nav-item.open > .fp-nav-sub { display: block; }

/* ══ Collapsed: submenu INLINE (no flyout, no overlay) ══
   Sub-ítems se apilan debajo del padre dentro del sidebar de 72px.
   El toggle es solo por clic (.open), no por hover. */
body.fp-sb-collapsed .fp-nav-sub {
  display: none;
  position: static !important;  /* cancela absolute flyout */
  left: auto !important;
  top: auto !important;
  min-width: auto !important;
  width: auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: auto !important;
  padding: 2px 0 4px !important;
}
/* Solo clic activa el submenu — sin hover flyout */
body.fp-sb-collapsed .fp-nav-item.open > .fp-nav-sub { display: block !important; }

/* Sub-link en collapsed: centrado, solo ícono */
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link {
  justify-content: center !important;
  padding: 7px 0 !important;
  margin: 1px 6px !important;
  gap: 0 !important;
}
/* Ícono algo más grande al mostrar solo él */
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-icon {
  font-size: 19px !important;
  width: 22px !important;
}
/* Ocultar etiqueta de texto — solo ícono en collapsed */
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link > span:not(.fp-nav-sub-icon) {
  display: none !important;
}
/* Sub-ítem activo en collapsed: discreto — solo ícono filled naranja + tinte muy suave */
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link.active {
  background: transparent !important;   /* sin pill — el padre ya tiene el estilo activo */
  color: var(--fp-sb-accent) !important;
}
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link.active .fp-nav-sub-icon {
  color: var(--fp-sb-accent) !important;
  font-variation-settings: 'FILL' 1,'wght' 500,'GRAD' 0,'opsz' 20 !important;
  /* pequeño indicador: fondo tinte muy suave alrededor del ícono */
  background: rgba(247,127,0,.13);
  border-radius: 6px;
  padding: 3px;
  width: 26px !important;
}
/* Sub-ítem hover en collapsed */
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link:hover:not(.active) {
  background: var(--fp-sb-hover) !important;
}
body.fp-sb-collapsed .fp-nav-sub .fp-nav-sub-link:hover:not(.active) .fp-nav-sub-icon {
  color: var(--fp-sb-accent) !important;
}
/* Padre con submenu abierto en collapsed: usa el mismo estilo activo que los items normales.
   No se sobreescribe nada — el .fp-nav-link.active ya aplica el pill tenue correcto. */

.fp-nav-sub-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 12px;
  color: var(--fp-sb-sub-t);
  font-size: 12.5px;
  font-weight: 400;
  text-decoration: none !important;
  transition: all var(--fp-tr);
  white-space: nowrap;
  border-radius: var(--fp-r-sm);
  margin: 1px 6px;
  border-left: none;
}
.fp-nav-sub-link:hover {
  background: var(--fp-sb-hover);
  color: var(--fp-sb-accent);
  text-decoration: none !important;
}
.fp-nav-sub-link.active {
  color: var(--fp-sb-accent);
  font-weight: 600;
  background: var(--fp-sb-active);
}
/* ── Icono en sub-ítem ── */
.fp-nav-sub-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 20;
  color: var(--fp-sb-icon);
  flex-shrink: 0;
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fp-nav-sub-link:hover .fp-nav-sub-icon {
  color: var(--fp-sb-accent);
}
.fp-nav-sub-link.active .fp-nav-sub-icon {
  color: var(--fp-sb-accent);
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 20;
}
/* Collapsed sub-link: ajuste base (los !important de arriba toman precedencia) */
body.fp-sb-collapsed .fp-nav-sub-link {
  white-space: nowrap;
}

/* ── Sidebar footer ── */
.fp-sb-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--fp-sb-bdr);
  background: var(--fp-sb-foot-bg);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: padding var(--fp-tr), background var(--fp-tr);
  min-height: 48px;
}
body.fp-sb-collapsed .fp-sb-footer {
  padding: 6px 0;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}
body.fp-sb-collapsed .fp-sb-footer-btn-label { display: none !important; }
body.fp-sb-collapsed #fp-sb-theme-btn { display: flex; }
body.fp-sb-collapsed #fp-sb-collapse-btn { margin-left: 0; }

.fp-sb-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--fp-r-sm);
  border: none;
  background: transparent;
  color: var(--fp-sb-t);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fp-tr);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.fp-sb-footer-btn:hover { background: var(--fp-sb-hover); color: var(--fp-sb-t-hi); }
body.fp-sb-collapsed .fp-sb-footer-btn { padding: 7px; width: 36px; height: 36px; }
.fp-sb-footer-btn .ms {
  font-size: 20px;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 20;
}
.fp-sb-footer-btn-label { transition: opacity var(--fp-tr), width var(--fp-tr); }
body.fp-sb-collapsed .fp-sb-footer-btn-label { display: none; }
body.fp-sb-collapsed .fp-sb-footer-btn { padding: 9px; justify-content: center; }

/* Collapse toggle button */
#fp-sb-collapse-btn { margin-left: auto; }
body.fp-sb-collapsed #fp-sb-collapse-btn { margin-left: 0; }
body.fp-sb-collapsed #fp-sb-collapse-btn .ms { transform: rotate(180deg); }

/* ══════════════════════════════════════════════════════════════
   BACKDROP MOBILE
   ══════════════════════════════════════════════════════════════ */
#fp-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1050;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fp-backdrop-in .2s ease;
}
@keyframes fp-backdrop-in { from { opacity:0; } to { opacity:1; } }
body.fp-sb-mobile-open #fp-sidebar-backdrop { display: block; }

/* ══════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════ */
#fp-topbar {
  position: fixed;
  top: 0;
  left: var(--fp-sb-w);
  right: 0;
  width: auto !important;        /* neutraliza header{width:100%} de Gentelella */
  height: var(--fp-tb-h);
  background: var(--fp-tb-bg);
  border-bottom: 1px solid var(--fp-tb-bdr);
  box-shadow: var(--fp-tb-shadow);
  display: flex;
  align-items: center;
  z-index: 1030;
  transition: left var(--fp-tr);
  padding: 0 16px 0 8px;
  box-sizing: border-box;
  overflow: visible;
}
body.fp-sb-collapsed #fp-topbar { left: var(--fp-sb-w-sm); }
@media (max-width: 767px) {
  #fp-topbar { left: 0 !important; padding: 0 12px 0 4px; }
}

/* ── Left section ── */
.fp-tb-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Right section ── */
.fp-tb-right {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* ── Toggle button ── */
.fp-tb-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--fp-r-sm);
  color: var(--fp-tb-t-dim);
  cursor: pointer;
  transition: all var(--fp-tr);
  flex-shrink: 0;
}
.fp-tb-toggle:hover { background: #fff6ee; color: #F77F00; }
.fp-tb-toggle .ms { font-size: 24px; font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 24; }

/* ── Company name ── */
.fp-tb-company {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fp-tb-t);
  min-width: 0;
  max-width: 220px;
}
.fp-tb-company .fp-tb-company-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) { .fp-tb-company { display: none; } }

/* ── Sys customer selector (en fp-tb-right, cerca de notificaciones) ── */
.fp-tb-tenant {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  border-right: 1px solid var(--fp-tb-bdr);
  margin-right: 4px;
}
.fp-tb-tenant select.form-control {
  width: 200px !important;
  height: 34px !important;
  font-size: 12.5px !important;
  border-radius: var(--fp-r-sm) !important;
  border-color: var(--fp-tb-bdr) !important;
}
@media (max-width: 1024px) { .fp-tb-tenant select.form-control { width: 150px !important; } }
@media (max-width: 768px) { .fp-tb-tenant { display: none; } }

/* ── Action button (icon in topbar) ── */
.fp-tb-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: var(--fp-r-sm);
  color: var(--fp-tb-t-dim);
  text-decoration: none !important;
  transition: background var(--fp-tr), color var(--fp-tr);
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;  /* evita que padding de Gentelella reduzca el área */
  line-height: 1;
  vertical-align: middle;
}
.fp-tb-action:hover { background: #fff6ee !important; color: #F77F00 !important; text-decoration: none !important; }
.fp-tb-action .ms {
  font-size: 24px !important;
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24;
  display: block;
  pointer-events: none; /* el ícono no intercepta el clic, lo hace el contenedor */
}

/* ── Badge en topbar ── */
.fp-tb-badge {
  position: absolute;
  top: 4px; right: 3px;
  min-width: 17px; height: 17px;
  background: #F77F00;
  border: 2px solid var(--fp-tb-bg);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
  pointer-events: none; /* no intercepta clics para que lleguen al botón padre */
}

/* ── Updates widget target ── */
#fp-updates-target {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
}
/* Normaliza cualquier botón/enlace que el widget CMS inyecte */
#fp-updates-target button,
#fp-updates-target a,
#fp-updates-target [role="button"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: var(--fp-r-sm) !important;
  background: transparent !important;
  color: var(--fp-tb-t-dim) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  transition: background var(--fp-tr), color var(--fp-tr) !important;
  line-height: 1 !important;
  font-size: 0 !important;          /* oculta texto inline del botón si lo hay */
  box-shadow: none !important;
}
#fp-updates-target button:hover,
#fp-updates-target a:hover,
#fp-updates-target [role="button"]:hover {
  background: #fff6ee !important;
  color: #F77F00 !important;
}
/* Iconos SVG inyectados por el widget */
#fp-updates-target svg {
  width: 24px !important;
  height: 24px !important;
  font-size: 24px !important;
  flex-shrink: 0 !important;
  pointer-events: none !important;
  fill: currentColor !important;
}
/* Iconos de fuente (Material Icons, Font Awesome, etc.) */
#fp-updates-target i,
#fp-updates-target .material-icons,
#fp-updates-target .material-symbols-rounded,
#fp-updates-target .ms {
  font-size: 24px !important;
  line-height: 1 !important;
  pointer-events: none !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
}
/* Imágenes como icono */
#fp-updates-target img {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
  pointer-events: none !important;
}
/* Badge de contador del widget */
#fp-updates-target [class*="badge"],
#fp-updates-target [class*="count"],
#fp-updates-target [class*="dot"] {
  position: absolute !important;
  top: 4px !important;
  right: 3px !important;
  min-width: 17px !important;
  height: 17px !important;
  background: #F77F00 !important;
  border: 2px solid var(--fp-tb-bg) !important;
  border-radius: 10px !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 3px !important;
  pointer-events: none !important;
}
/* Dark mode */
body.dark-mode #fp-updates-target button:hover,
body.dark-mode #fp-updates-target a:hover,
body.dark-mode #fp-updates-target [role="button"]:hover {
  background: rgba(247,127,0,.15) !important;
  color: #F77F00 !important;
}

/* ── User menu ── */
.fp-tb-user {
  position: relative;
  flex-shrink: 0;
}
.fp-tb-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: none;
  background: transparent;
  border-radius: var(--fp-r-sm);
  cursor: pointer;
  color: var(--fp-tb-t);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--fp-tr);
  height: 40px;
  white-space: nowrap;
  flex-shrink: 0;
}
.fp-tb-user-btn:hover { background: #fff6ee; }
.fp-tb-user-btn img {
  width: 30px; height: 30px;
  min-width: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #e8eaee;
  display: block !important;
}
.fp-tb-user-btn .fp-tb-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fp-tb-t) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.2;
  display: inline-block !important;
}
@media (max-width: 640px) { .fp-tb-user-btn .fp-tb-user-name { display: none !important; } }
.fp-tb-user-btn .fp-tb-user-chevron {
  font-family: 'Material Symbols Rounded';
  font-size: 18px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 20;
  color: var(--fp-tb-t-dim);
  transition: transform var(--fp-tr);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.fp-tb-user.open .fp-tb-user-chevron { transform: rotate(180deg); }

/* ── User dropdown ── */
.fp-tb-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e8eaee;
  border-radius: var(--fp-r);
  box-shadow: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
  z-index: 1060;
  padding: 6px;
  animation: fp-dropdown-in .14s ease;
}
@keyframes fp-dropdown-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.fp-tb-user.open .fp-tb-user-menu { display: block; }

.fp-tb-user-info {
  padding: 8px 10px 10px;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 4px;
}
.fp-tb-user-info .fp-tb-user-full { font-size: 13px; font-weight: 600; color: #1a1d23; }
.fp-tb-user-info .fp-tb-user-email { font-size: 11.5px; color: #9ea6b4; margin-top: 1px; }

.fp-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--fp-r-sm);
  color: #3d4350;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--fp-tr);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.fp-dd-item:hover { background: #fff6ee; color: #F77F00; text-decoration: none !important; }
.fp-dd-item .ms {
  font-size: 18px;
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 20;
  color: #9ea6b4;
  flex-shrink: 0;
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: normal;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}
.fp-dd-item:hover .ms { color: #F77F00; }
.fp-dd-divider { height: 1px; background: #f0f2f5; margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
#fp-main {
  margin-left: var(--fp-sb-w);
  padding-top: var(--fp-tb-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--fp-tr);
  background: var(--bg, #f0f2f5);
}
/* El wrapper de contenido crece para que el footer quede pegado al fondo */
#fp-main > .container.body {
  flex: 1 0 auto;
}
body.fp-sb-collapsed #fp-main { margin-left: var(--fp-sb-w-sm); }
@media (max-width: 767px) {
  #fp-main { margin-left: 0 !important; }
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
#fp-footer {
  margin-top: auto;
  margin-left: 0 !important;    /* neutraliza cualquier margen heredado */
  margin-right: 0 !important;
  width: 100% !important;       /* siempre ocupa el 100% de #fp-main */
  box-sizing: border-box;
  background: var(--fp-ft-bg);
  border-top: 1px solid var(--fp-ft-bdr);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.fp-footer-copy {
  font-size: 11.5px;
  color: var(--fp-ft-t);
  font-weight: 400;
}
.fp-footer-copy a { color: #F77F00; text-decoration: none; font-weight: 500; }
.fp-footer-copy a:hover { text-decoration: underline; }
.fp-footer-version {
  font-size: 11px;
  color: #c5c9d4;
  font-weight: 500;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE overrides para fp-layout
   ══════════════════════════════════════════════════════════════ */
body.dark-mode #fp-topbar {
  background: #1e2433;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 16px rgba(0,0,0,.3);
  --fp-tb-bg: #1e2433;
  --fp-tb-t: rgba(255,255,255,.85);
  --fp-tb-t-dim: rgba(255,255,255,.4);
}
body.dark-mode .fp-tb-action:hover,
body.dark-mode .fp-tb-toggle:hover { background: rgba(247,127,0,.15); }
body.dark-mode .fp-tb-user-btn:hover { background: rgba(247,127,0,.12); }
body.dark-mode .fp-tb-user-menu {
  background: #252d3d;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
body.dark-mode .fp-dd-item { color: rgba(255,255,255,.75); }
body.dark-mode .fp-dd-item:hover { background: rgba(247,127,0,.12); }
body.dark-mode .fp-tb-user-info { border-color: rgba(255,255,255,.08); }
body.dark-mode .fp-tb-user-info .fp-tb-user-full { color: rgba(255,255,255,.9); }
body.dark-mode .fp-dd-divider { background: rgba(255,255,255,.08); }
body.dark-mode #fp-sidebar[data-theme="light"] {
  background: #1a2235;
  border-color: rgba(255,255,255,.07);
  --fp-sb-bg: #1a2235;
  --fp-sb-t: rgba(255,255,255,.55);
  --fp-sb-t-hi: rgba(255,255,255,.9);
  --fp-sb-icon: rgba(255,255,255,.35);
  --fp-sb-hover: rgba(255,255,255,.05);
  --fp-sb-active: rgba(247,127,0,.15);
  --fp-sb-section-t: rgba(255,255,255,.25);
  --fp-sb-bdr: rgba(255,255,255,.07);
  --fp-sb-sub-bg: rgba(0,0,0,.12);
  --fp-sb-foot-bg: rgba(0,0,0,.12);
  --fp-sb-logo-bdr: rgba(255,255,255,.06);
}
body.dark-mode #fp-footer {
  background: #1e2433;
  border-color: rgba(255,255,255,.08);
}
body.dark-mode .fp-footer-copy { color: rgba(255,255,255,.35); }

/* ══════════════════════════════════════════════════════════════
   CFDI-QUICK — Botón naranja llamativo
   ══════════════════════════════════════════════════════════════ */
.fp-sb-quick-wrap {
  margin: 10px 10px 6px;
}
.fp-sb-quick-wrap .cfdi-quick-btn {
  width: 100% !important;
  background: linear-gradient(135deg, #E85D04 0%, #F77F00 100%) !important;
  border: none !important;
  border-radius: var(--fp-r) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 10px 14px !important;
  box-shadow: 0 4px 14px rgba(232, 93, 4, .40) !important;
  transition: all .18s cubic-bezier(.4,0,.2,1) !important;
  letter-spacing: .01em;
}
.fp-sb-quick-wrap .cfdi-quick-btn:hover,
.fp-sb-quick-wrap .cfdi-quick-btn:focus {
  background: linear-gradient(135deg, #C94F02 0%, #E85D04 100%) !important;
  box-shadow: 0 6px 20px rgba(232, 93, 4, .55) !important;
  transform: translateY(-1px);
  color: #ffffff !important;
}
.fp-sb-quick-wrap .cfdi-quick-btn .cfdi-quick-icon { color: #ffffff !important; }
.fp-sb-quick-wrap .cfdi-quick-btn .cfdi-quick-label { color: #ffffff !important; }
.fp-sb-quick-wrap .cfdi-quick-btn .cfdi-quick-chevron { color: rgba(255,255,255,.75) !important; }

.fp-sb-quick-wrap .cfdi-quick-menu {
  left: 0;
  right: 0;
  min-width: auto;
  width: 100%;
  border-radius: var(--fp-r);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 1070;
  border: 1px solid rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.fp-ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  display: inline-block;
  font-variation-settings: 'FILL' 0,'wght' 300,'GRAD' 0,'opsz' 24;
}
