/* ─── Paleta institucional El Shah (carmesí extraído del logo, 2026-11-12) ─── */
:root {
  --brand-primary:   #BA1631;   /* carmesí del logo */
  --brand-secondary: #8A0F24;   /* carmesí oscuro (hover, texto sobre claro) */
  --brand-accent:    #D33A52;   /* carmesí claro */
  --sidebar-bg:      #5C0A18;   /* carmesí profundo (inicio del degradado del menú) */
  --sidebar-text:    rgba(255,255,255,.92);
  --sidebar-active:  rgba(255,255,255,.20);
  --topbar-bg:       #FFFFFF;
  --topbar-border:   #E2E8F0;
  --body-bg:         #F8FAFC;

  /* Bootstrap: sin esto text-primary, links, btn-outline-primary, bg-primary
     y el foco de los campos siguen con el azul por defecto (#0d6efd). */
  --bs-primary: #BA1631;
  --bs-primary-rgb: 186, 22, 49;
  --bs-primary-text-emphasis: #8A0F24;
  --bs-primary-bg-subtle: #FBEAED;
  --bs-primary-border-subtle: #F2B8C2;
  --bs-link-color: #BA1631;
  --bs-link-color-rgb: 186, 22, 49;
  --bs-link-hover-color: #8A0F24;
  --bs-link-hover-color-rgb: 138, 15, 36;
  --bs-focus-ring-color: rgba(186, 22, 49, .25);
}

.btn-primary {
  --bs-btn-active-bg: #8A0F24;
  --bs-btn-active-border-color: #8A0F24;
  --bs-btn-disabled-bg: #BA1631;
  --bs-btn-disabled-border-color: #BA1631;
  --bs-btn-focus-shadow-rgb: 186, 22, 49;
}
.btn-outline-primary {
  --bs-btn-color: #BA1631;
  --bs-btn-border-color: #BA1631;
  --bs-btn-hover-bg: #BA1631;
  --bs-btn-hover-border-color: #BA1631;
  --bs-btn-active-bg: #8A0F24;
  --bs-btn-active-border-color: #8A0F24;
  --bs-btn-disabled-color: #BA1631;
  --bs-btn-disabled-border-color: #BA1631;
  --bs-btn-focus-shadow-rgb: 186, 22, 49;
}
.form-control:focus, .form-select:focus { border-color: #F0A3AF; box-shadow: 0 0 0 .25rem rgba(186, 22, 49, .25); }
.form-check-input:checked { background-color: #BA1631; border-color: #BA1631; }
.form-check-input:focus { border-color: #F0A3AF; box-shadow: 0 0 0 .25rem rgba(186, 22, 49, .25); }
.nav-pills { --bs-nav-pills-link-active-bg: #BA1631; }
.nav-link { --bs-nav-link-color: #BA1631; --bs-nav-link-hover-color: #8A0F24; }
.pagination { --bs-pagination-color: #BA1631; --bs-pagination-active-bg: #BA1631; --bs-pagination-active-border-color: #BA1631; --bs-pagination-hover-color: #8A0F24; }
.dropdown-menu { --bs-dropdown-link-active-bg: #BA1631; }

.cursor-pointer { cursor: pointer; }

body {
  background-color: var(--body-bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Sidebar ─── */
#sidebar {
  width: 240px;
  min-height: 100vh;
  background-color: var(--sidebar-bg);
  /* Variante R1 (2026-11-12): mismo degradado y trama que el login. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.2'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 36h8M64 36h8M36 0v8M36 64v8'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(170deg, #5C0A18 0%, #BA1631 100%);
  background-size: 72px 72px, 100% 100%;
  background-attachment: local;
  color: var(--sidebar-text);
  transition: width 0.25s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;             /* Firefox */
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.15);
  border-radius: 3px;
}

.sidebar-brand {
  color: #FFFFFF;
  text-decoration: none;
}

.sidebar-brand:hover { color: #FFFFFF; opacity: .85; }

.sidebar-divider {
  border-color: rgba(255,255,255,0.1);
}

/* Separador entre la marca y el buscador: más pegado (2026-11-13). */
.sidebar-divider-marca { margin: .5rem 0 .75rem; }

#sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}

/* Mismo tamaño de fuente para TODOS los ítems del sidebar (principales y
   sub-items) — Bootstrap .small en sub-items quedaba visualmente más chico */
#sidebar .nav-link,
#sidebar .nav-link.small,
#sidebar .nav-link .small {
  font-size: 0.9rem !important;
}

#sidebar .nav-link:hover {
  background-color: rgba(255,255,255,0.12);
  color: #FFFFFF;
}

#sidebar .nav-link.active {
  background-color: var(--sidebar-active);
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 #FFFFFF;
}

/* ─── Buscador de opciones en el sidebar ─── */
.sidebar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-icon {
  position: absolute;
  left: .65rem;
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  background-color: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: #fff;
  font-size: .85rem;
  padding: .45rem .65rem .45rem 2rem;
  transition: background-color .15s, border-color .15s;
}

.sidebar-search-input::placeholder {
  color: rgba(255,255,255,.7);
}

.sidebar-search-input:focus {
  outline: none;
  background-color: rgba(255,255,255,0.2);
  border-color: #FFFFFF;
}

.sidebar-search-clear {
  position: absolute;
  right: .5rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  line-height: 1;
  padding: 0;
  display: flex;
}

.sidebar-search-clear:hover {
  color: #e2e8f0;
}

.sidebar-search-empty {
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  padding: .4rem .75rem;
}

/* Resalte del texto coincidente */
#sidebar .nav-link-text mark {
  background-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 3px;
  padding: 0 1px;
}

/* Modo ícono: el buscador no aplica (sin espacio para texto) */
#app-wrapper.sidebar-collapsed .sidebar-search,
#app-wrapper.sidebar-collapsed .sidebar-search-empty {
  display: none !important;
}

/* label de sección de administración en sidebar */
.sidebar-section-label {
  color: rgba(255,255,255,.72);
  font-size: .78rem;
  letter-spacing: .04em;
}

/* título de sección colapsable (Dte, Cobranzas, Stock, Administración) */
.sidebar-section-toggle {
  cursor: pointer;
}

.sidebar-section-toggle:hover .sidebar-section-label {
  color: #FFFFFF;
}

.sidebar-section-chevron {
  color: rgba(255,255,255,.72);
  transition: transform 0.2s ease;
}

.sidebar-section-chevron.rotated {
  transform: rotate(-90deg);
}

/* sub-items (Timbrados, Clasificación) — override Bootstrap .text-muted */
#sidebar .nav-link.text-muted {
  color: rgba(255,255,255,.78) !important;   /* legible sobre el carmesí */
}

#sidebar .nav-link.text-muted:hover {
  color: #FFFFFF !important;
  background-color: rgba(255,255,255,0.12);
}

#sidebar .nav-link.text-muted.active {
  color: #FFFFFF !important;
  background-color: var(--sidebar-active);
  box-shadow: inset 3px 0 0 #FFFFFF;
}

.sidebar-footer {
  color: var(--sidebar-text);
  font-size: 0.8rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--brand-primary);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.sidebar-footer-info {
  line-height: 1.2;
}

.sidebar-footer-name {
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
}

.sidebar-footer-role {
  color: var(--sidebar-text);
  font-size: .72rem;
  opacity: .75;
}

.sidebar-footer-action {
  color: var(--sidebar-text);
  font-size: 1.35rem;
  opacity: .7;
  transition: opacity .15s, color .15s;
  text-decoration: none;
  padding: .25rem;
}

.sidebar-footer-action:hover {
  opacity: 1;
  color: #f87171;
}

/* ─── Botón colapsar/expandir junto al logo ─── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--sidebar-text-muted, #94a3b8);
  border-radius: 6px;
  font-size: .85rem;
  transition: background-color .15s, color .15s;
}
.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
@media (max-width: 767.98px) {
  .sidebar-collapse-btn { display: none; }
}

/* ─── Sidebar collapsed ─── */
#app-wrapper.sidebar-collapsed #sidebar {
  width: 80px;
}

/* Ocultar todos los textos de nav */
#app-wrapper.sidebar-collapsed #sidebar .nav-link-text,
#app-wrapper.sidebar-collapsed .sidebar-brand-text,
#app-wrapper.sidebar-collapsed .sidebar-footer-info,
#app-wrapper.sidebar-collapsed .sidebar-footer-action {
  display: none !important;
}

/* Brand: centrar logo, fila pasa a columna para acomodar el botón debajo */
#app-wrapper.sidebar-collapsed .sidebar-brand-row {
  flex-direction: column;
  gap: .35rem;
}

#app-wrapper.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
  flex-grow: 0;
}

#app-wrapper.sidebar-collapsed .sidebar-collapse-btn i::before {
  content: "\f285"; /* bi-chevron-right */
}

#app-wrapper.sidebar-collapsed .sidebar-logo {
  width: 48px;
  height: 48px;
  padding: 3px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 4px 12px rgba(0, 0, 0, .30);
  margin: 0 !important;
}

/* Nav links: centrar íconos */
#app-wrapper.sidebar-collapsed #sidebar .nav-link {
  justify-content: center;
  padding: 0.6rem;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link i {
  margin: 0 !important;
  font-size: 1.2rem;
}

/* Títulos de sección colapsables (Dte, Cobranzas, Mantenimientos,
   Administración): en modo ícono solo queda visible el ícono, centrado
   igual que los .nav-link — se oculta el texto, el chevron, y el badge
   "Próx." de los ítems placeholder. Los grupos quedan siempre expandidos
   (mostrando sus íconos) para no combinar dos estados de colapso distintos
   — el modo ícono ya es la vista "compacta", no hace falta plegar de más. */
#app-wrapper.sidebar-collapsed .sidebar-section-toggle {
  justify-content: center;
  padding: 0.6rem !important;
  margin-top: .5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* El primer grupo (Dte) no necesita separador arriba — no hay nada antes */
#app-wrapper.sidebar-collapsed #sidebar > ul:first-of-type > li:first-child .sidebar-section-toggle {
  margin-top: 0;
  border-top: none;
}

#app-wrapper.sidebar-collapsed .sidebar-section-label {
  display: flex;
  align-items: center;
}

#app-wrapper.sidebar-collapsed .sidebar-section-label i {
  margin: 0 !important;
  font-size: 1.1rem;
}

#app-wrapper.sidebar-collapsed .sidebar-section-label {
  font-size: 0 !important;
}

#app-wrapper.sidebar-collapsed .sidebar-section-chevron,
#app-wrapper.sidebar-collapsed .badge.nav-link-text {
  display: none !important;
}

#app-wrapper.sidebar-collapsed .sidebar-section-group {
  display: block !important;
  height: auto !important;
}

/* Anular el sangrado de sub-items (Clasificación, Depósitos, Cotizaciones)
   para que sus íconos queden centrados igual que el resto */
#app-wrapper.sidebar-collapsed #sidebar .nav-item {
  padding-left: 0 !important;
}

/* Footer: solo avatar */
#app-wrapper.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding: 0;
}

#app-wrapper.sidebar-collapsed .sidebar-avatar {
  width: 34px;
  height: 34px;
}

/* ─── Modo kiosco (pantallas táctiles dedicadas):
   oculta sidebar y topbar por completo para aprovechar todo el ancho del
   monitor. Body-level (no #app-wrapper) porque también oculta la topbar,
   que está fuera del wrapper del sidebar. ─── */
body.kiosk-mode #sidebar,
body.kiosk-mode .topbar {
  display: none !important;
}

/* El botón flotante ocupa la esquina superior izquierda a la altura del
   título de la pantalla (no arriba de todo) — el título le deja el hueco
   con padding-left en vez de que el botón quede flotando por encima. */
body.kiosk-mode main {
  padding-top: .75rem;
}

.kiosk-exit-btn {
  position: fixed;
  top: .9rem;
  left: 1.5rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(186,22,49, 0.9);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.kiosk-title-spacer {
  padding-left: 3.25rem;
}

.kiosk-logo {
  position: fixed;
  top: .6rem;
  right: 1.5rem;
  z-index: 200;
  height: 68px;
  width: auto;
}

body.kiosk-mode .kiosk-exit-btn {
  display: flex !important;
}

/* ─── Topbar ─── */
.topbar {
  background-color: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ─── Cards ─── */
.card {
  border-radius: 12px;
}

/* ─── Teclado virtual QWERTY (identidad El Shah: carmesí institucional #BA1631,
   ver .claude/memory/feedback_ux_ui.md) ─── */
#s-keyboard-modal .modal-dialog {
  max-width: 1400px;
}
.s-keyboard-header {
  background: #BA1631;
  color: #fff;
  align-items: center;
}
.s-keyboard-header .input-group-text {
  background: #fff;
  color: #BA1631;
  border: none;
}
.s-keyboard-header #s-keyboard-preview {
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
}
.s-keyboard-header .btn-close {
  filter: brightness(0) invert(1);
  width: 1.6rem;
  height: 1.6rem;
  padding: .6rem;
  background-color: rgba(255, 255, 255, .18);
  border-radius: 50%;
  opacity: 1;
}
.s-keyboard-header .btn-close:hover,
.s-keyboard-header .btn-close:active {
  background-color: rgba(255, 255, 255, .3);
}

.s-keyboard-body {
  background: #eef2f7;
  padding: 1.5rem;
}

.s-kb-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
}

.s-kb-letters {
  flex: 1 1 auto;
}

.s-kb-numpad {
  flex: 0 0 auto;
  padding-left: 1rem;
  border-left: 1px solid #d7dee6;
}

.s-kb-row {
  display: flex;
  justify-content: center;
  gap: .55rem;
  margin-bottom: .55rem;
}
.s-kb-numpad .s-kb-row {
  justify-content: stretch;
}

.s-kb-key {
  flex: 1 1 0;
  max-width: 5.4rem;
  height: 4.2rem;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #30353a;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.s-kb-key:active {
  background: #BA1631;
  color: #fff;
}
.s-kb-key.active {
  background: #BA1631;
  color: #fff;
}

.s-kb-key-wide {
  flex: 1.6 1 0;
  max-width: 8rem;
}

.s-kb-key-space {
  flex: 6 1 0;
  max-width: none;
}

.s-kb-key-borrar {
  color: #dc3545;
}

.s-kb-key-num {
  flex: 1 1 0;
  width: 4.6rem;
  max-width: 4.6rem;
}

.s-kb-key-num-zero {
  flex: 3 1 0;
  max-width: none;
}

@media (max-width: 767.98px) {
  .s-kb-layout { flex-direction: column; align-items: stretch; }
  .s-kb-numpad {
    border-left: none;
    border-top: 1px solid #d7dee6;
    padding-left: 0;
    padding-top: .6rem;
  }
}

/* ─── Spinner animación ─── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .7s linear infinite; }

/* ─── Modal de éxito animado (ver showSuccess() en main.js) ─── */
@keyframes sSuccessPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.s-success-icon {
  width: 7rem; height: 7rem; margin: 0 auto;
  border-radius: 50%;
  background: #2e9e5b; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  animation: sSuccessPop .45s cubic-bezier(.34, 1.56, .64, 1);
}

/* ─── Toast notifications ─── */
#s-toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  min-width: 320px;
  max-width: 480px;
  width: max-content;
}

.s-toast {
  background: #fff;
  border-radius: .6rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto;
  width: 100%;
}

/* ─── Mobile (< 768px) ─── */
@media (max-width: 767.98px) {

  /* Sidebar: overlay deslizante en mobile */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 240px !important;
  }

  #sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Backdrop semitransparente al abrir sidebar */
  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
  }
  #sidebar-backdrop.show { display: block; }

  /* El contenido principal ocupa todo el ancho */
  #app-wrapper {
    flex-direction: column;
  }
  .flex-grow-1 { width: 100%; }

  /* Topbar: más compacta */
  .topbar { height: 48px; padding: 0 .75rem !important; }
  .topbar-center { display: none !important; }

  /* Contenido: menos padding lateral */
  .main-content, main { padding: .75rem !important; }
}

.s-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.s-toast-body {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1rem;
}

.s-toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.s-toast-msg {
  flex: 1;
  font-size: .875rem;
  line-height: 1.4;
  color: #1e293b;
}

.s-toast-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  line-height: 1;
}

.s-toast-close:hover { color: #475569; }

.s-toast-progress {
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: .35;
  transform-origin: left;
  animation: s-toast-shrink linear forwards;
}

@keyframes s-toast-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* colores por tipo */
.s-toast--success .s-toast-icon { color: #16a34a; }
.s-toast--success .s-toast-progress { color: #16a34a; }
.s-toast--danger  .s-toast-icon { color: #dc2626; }
.s-toast--danger  .s-toast-progress { color: #dc2626; }
.s-toast--warning .s-toast-icon { color: #d97706; }
.s-toast--warning .s-toast-progress { color: #d97706; }
.s-toast--info    .s-toast-icon { color: #BA1631; }
.s-toast--info    .s-toast-progress { color: #BA1631; }

/* ─── Login (variante B elegida 2026-11-12: carmesí con patrón geométrico) ─── */
.login-bg {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #5C0A18 0%, #BA1631 100%);
}
/* Trama de estrellas de 8 puntas, muy tenue (combina con la cúpula del logo). */
.login-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 36h8M64 36h8M36 0v8M36 64v8'/%3E%3C/g%3E%3C/svg%3E");
}
/* Luz suave detrás de la marca. */
.login-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 65% at 30% 45%, rgba(255, 255, 255, .10), transparent 60%);
}
/* El contenido (también en olvidé/restablecer contraseña) va sobre la trama. */
.login-bg > * { position: relative; z-index: 1; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6rem;
  padding: 2rem 1rem 4rem;
}
.login-marca { color: #fff; text-align: center; }
.login-marca h1 { font-size: 2.6rem; letter-spacing: -.02em; }
.login-sep { width: 56px; height: 3px; margin: 1rem auto; border-radius: 3px; background: rgba(255, 255, 255, .5); }
.login-disco {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .12), 0 16px 48px rgba(0, 0, 0, .35);
}
.login-disco img { width: 150px; height: 150px; border-radius: 50%; }
.login-card {
  width: 100%;
  max-width: 420px;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(40, 0, 10, .45);
}
.login-card .form-control { height: 48px; font-size: 1rem; }
.login-card .input-group-text,
.login-card #togglePassword { background: #fff; }
.login-card .btn-primary { height: 50px; font-size: 1.05rem; font-weight: 700; border-radius: .6rem; }
.login-pie {
  position: fixed;
  z-index: 1;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255, 255, 255, .6);
}
@media (max-width: 991.98px) {
  .login-wrap { flex-direction: column; gap: 1.5rem; padding-bottom: 1rem; }
  .login-disco { width: 112px; height: 112px; }
  .login-disco img { width: 96px; height: 96px; }
  .login-marca h1 { font-size: 1.6rem; }
  .login-marca p, .login-sep { display: none; }
  .login-pie { position: static; }
}

.sidebar-logo {
  /* Disco blanco con halo, como .login-disco del login (2026-11-13, pedido
     del usuario). El relleno blanco es el contorno; el box-shadow, el halo. */
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  padding: 4px;
  background: #FFFFFF;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .14), 0 6px 16px rgba(0, 0, 0, .30);
  flex-shrink: 0;
}

/* Input groups sin borde doble */
.input-group .form-control:focus {
  box-shadow: none;
  border-color: var(--brand-primary);
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control,
.input-group:focus-within .btn {
  border-color: var(--brand-primary);
}

/* Input-group unificado: contenedor con borde único */
.input-group {
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  overflow: hidden;
}

.input-group .input-group-text,
.input-group .form-control,
.input-group .btn {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Foco: contorno azul en el contenedor */
.input-group:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(186, 22, 49, .15);
}

/* Error: contorno rojo en el contenedor */
.input-group:has(.is-invalid) {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .15);
}

/* ─── Alerts estilizados ─── */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
}

/* ─── Botones ─── */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

/* ─── Tab content wrapper ─── */
.tab-content-wrapper {
  border: 1px solid #dee2e6;
}

/* ─── Breadcrumb en topbar ─── */
.topbar .breadcrumb-item a {
  color: var(--bs-secondary-color);
}
.topbar .breadcrumb-item a:hover {
  color: var(--brand-primary);
}
.topbar .breadcrumb-item + .breadcrumb-item::before {
  color: var(--bs-secondary-color);
}
.topbar .breadcrumb-item.active {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ─── Topbar: centro empresa ─── */
.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* ─── Topbar: avatar con dropdown ─── */
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s;
}
.topbar-avatar:hover { opacity: .85; }
.topbar-avatar::after { display: none; }

/* ─── Tabla: header gris oscuro suavizado ─── */
.table-header-dark th {
  background-color: #3a3f4b;
  color: #e9ecef;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: none;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

/* ─── Tabla productos: filas ─── */
.prod-row td { vertical-align: middle; }
.prod-row-inactive td { opacity: .55; }

/* Código badge suave */
.badge-codigo {
  display: inline-block;
  background: #FBEAED;
  color: #8A0F24;
  font-size: .72rem;
  font-weight: 700;
  padding: .2em .55em;
  border-radius: 4px;
  letter-spacing: .02em;
}

/* Impuesto badge atenuado */
.badge-impuesto {
  display: inline-block;
  background: #e9f5fb;
  color: #0077a8;
  font-size: .72rem;
  font-weight: 600;
  padding: .2em .55em;
  border-radius: 4px;
}

/* Estado badge pill pequeño */
.badge-estado {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .25em .65em;
  border-radius: 20px;
  letter-spacing: .03em;
}
.badge-estado-activo  { background: #d1fae5; color: #065f46; }
.badge-estado-inactivo { background: #f1f5f9; color: #64748b; }

.btn-badge-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.btn-badge-toggle .badge-estado { transition: filter .15s; }
.btn-badge-toggle:hover .badge-estado { filter: brightness(.95); }

/* Íconos de acción sin caja */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.row-action-btn {
  background: none;
  border: none;
  padding: .25rem .3rem;
  font-size: 1rem;
  border-radius: 5px;
  opacity: .45;
  transition: opacity .15s, background .15s;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}
.prod-row:hover .row-action-btn { opacity: 1; }
.row-action-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,.06);
}

/* ─── Personas: badges de roles ─── */
.persona-row td { vertical-align: middle; }
.persona-row-inactive td { opacity: .55; }

.badge-rol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 0;
}
.badge-rol-cliente   { background: #dbeafe; color: #1d4ed8; }
.badge-rol-proveedor { background: #d1fae5; color: #065f46; }
.badge-rol-vendedor  { background: #ede9fe; color: #5b21b6; }
.badge-rol-cobrador  { background: #fef3c7; color: #92400e; }

/* ─── Pill de carga entre pantallas ───
   Indicador flotante chico en vez de overlay de pantalla completa — no
   tapa la pantalla vieja, solo avisa que hay una navegación en curso.
   Como es MPA (recarga completa), no hace falta ocultarlo manualmente:
   desaparece junto con el documento viejo al llegar la página nueva. */
#appLoadingBar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  width: min(340px, calc(100vw - 32px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.07);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#appLoadingBar.alb-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.alb-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 10px;
}
.alb-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.alb-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #BA1631;
  display: inline-block;
  animation: albBounce 1.1s ease-in-out infinite;
}
.alb-dots span:nth-child(2) { animation-delay: .18s; background: #D33A52; }
.alb-dots span:nth-child(3) { animation-delay: .36s; background: #F0A3AF; }
@keyframes albBounce {
  0%, 80%, 100% { transform: scale(.75); opacity: .5; }
  40%            { transform: scale(1.15); opacity: 1; }
}
.alb-texts { flex: 1; min-width: 0; }
.alb-title {
  font-size: 13px; font-weight: 800;
  color: #BA1631; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alb-msg {
  font-size: 11.5px; font-weight: 600;
  color: #6b7280; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alb-progress {
  height: 3px;
  background: rgba(186, 22, 49,.10);
}
.alb-progress-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #BA1631, #F0A3AF, #BA1631);
  animation: albSlide 1.4s ease-in-out infinite;
}
@keyframes albSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Oculta las flechitas de incremento/decremento en <input type="number">
   usados como campos de conteo rápido (ej. Cierre de Caja) — el usuario
   tipea la cantidad directamente, las flechas solo estorban. */
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spin {
  appearance: textfield;
  -moz-appearance: textfield;
}
.badge-rol-empleado  { background: #f1f5f9; color: #475569; }

/* ─── Franja de bienvenida del inicio (2026-11-12): carmesí liso + trama del login ─── */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  color: #FFFFFF;
  background-color: #BA1631;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='1.2'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 36h8M64 36h8M36 0v8M36 64v8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
  box-shadow: 0 8px 24px rgba(92, 10, 24, .18);
}
.dash-hero h4 { color: #FFFFFF; font-size: 1.55rem; margin: 0 !important; }
.dash-hero-sub { margin: .25rem 0 0; font-size: .9rem; opacity: .8; }

/* ─── Inicio: selector de grupos (main/dashboard.html, 2026-11-13, como Araí) ───
   La franja es la .dash-hero de arriba, con aire abajo para que las tarjetas
   de grupo se monten encima. */
.inicio-hero { padding: 1.75rem 1.75rem 4.5rem; }
.inicio-hero-titulo { color: #FFFFFF; font-size: 1.6rem; font-weight: 700; margin: 0; }
.inicio-cuerpo {
  position: relative;
  margin-top: -3rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.inicio-grupos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.inicio-grupo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  min-height: 128px;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #1E293B;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.inicio-grupo:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(15, 23, 42, .1); }
.inicio-grupo:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.inicio-grupo-icono {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #FBEAED;
  color: var(--brand-primary);
  font-size: 1.35rem;
}
.inicio-grupo-nombre { font-size: 1rem; font-weight: 700; }
.inicio-grupo-cuenta { font-size: .82rem; color: #475569; }
.inicio-grupo.activo {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(92, 10, 24, .25);
}
.inicio-grupo.activo .inicio-grupo-icono { background: rgba(255, 255, 255, .18); color: #FFFFFF; }
.inicio-grupo.activo .inicio-grupo-cuenta { color: #F8D7DD; }
.inicio-panel { border-radius: 16px; }
.inicio-pantallas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .625rem;
}
.inicio-pantalla {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .625rem;
  min-height: 54px;
  padding: 0 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  background: #F8FAFC;
  color: var(--brand-secondary);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.inicio-pantalla:hover { background: #FBEAED; border-color: #F2B8C2; color: var(--brand-secondary); }
.inicio-pantalla .bi-arrow-right { color: var(--brand-primary); }
@media (max-width: 575.98px) {
  .inicio-hero { padding: 1.5rem 1.25rem 4rem; }
  .inicio-cuerpo { padding: 0; }
  .inicio-grupos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
