@import url("forms_shared.css");
/* ==========================================================================
   basecuentas.css (JefeCredito)
   - Estilos globales del proyecto (Bootstrap 5.3 + UI mobile-first)
   - Regla de oro: NO inline styles en templates.
   - Patrones:
     * LISTA    : .container.py-3 + toolbar + .responsive-table + table-striped
     * FORM     : .container.py-4/py-md-5 + card.card-app + .form-section-soft / alt
     * HISTORIAL: tabla con class "historial-table" dentro de .responsive-table
   ========================================================================== */


/* ==========================================================================
   1) Tipografía (Inter)
   - Usar Inter si la tienes en /static/fonts/inter/
   ========================================================================== */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter/Inter-VariableFont_opsz,wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   2) Variables de tema (branding)
   ========================================================================== */
:root{
  --naranja-principal: #006a10ff;  /* color principal botones */
  --naranja-claro:     #ffcc80;    /* resaltados */
  --naranja-oscuro:    #ae3d01ff;  /* títulos / navbar */

  --texto-oscuro:      #212121;
  --texto-claro:       #ffffff;

  --fondo-claro:       #fdfdfd;
  --fondo-gris:        #f5f5f5;

  --soft-bg:   var(--fondo-gris);
  --soft-bg-2: #ffffff;


  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-right: env(safe-area-inset-right, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-left: env(safe-area-inset-left, 0px);
}


/* ==========================================================================
   3) Base (Aqui lo llevo más compacto para móvil)
   - OBJETIVO: Para mostrarlo más info por pantalla (celular) sin romper desktop.
   ========================================================================== */
body{
  background-color: var(--fondo-claro);
  font-family: "Inter","Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto-oscuro);
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Encabezados (compactos) */
h1, h2, h3{
  color: var(--naranja-oscuro);
  font-weight: 700;
  line-height: 1.2;
}
h1{ font-size: 1.6rem; }
h2{ font-size: 1.35rem; }
h3{ font-size: 1.15rem; }
h4{ font-size: 1.05rem; }
h5{ font-size: 1rem; }

@media (min-width: 768px){
  body{
    font-size: 15.5px;
  }

  h1{ font-size: 1.8rem; }
  h2{ font-size: 1.5rem; }
  h3{ font-size: 1.2rem; }
}


/* ==========================================================================
   4) Botones (override Bootstrap)
   - Usar: class="btn btn-primary" / "btn btn-success"
   ========================================================================== */
/* ==========================================================================
   5) Utilidades simples
   ========================================================================== */
.resaltado{
  background-color: var(--naranja-claro);
  padding: 1rem;
  border-radius: 5px;
  font-weight: 600;
}


/* ==========================================================================
   6) Navbar (tu base.html usa navbar-dark)
   ========================================================================== */
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link{
  color: var(--texto-claro) !important;
}
.navbar-dark{
  background-color: var(--naranja-oscuro) !important;
}
.navbar{
  z-index: 1030;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.navbar-app-compact{
  padding-top: calc(0.3rem + var(--app-safe-top));
  padding-bottom: 0.3rem;
}
.navbar-main-row{
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding-right: max(calc(var(--bs-gutter-x) * 0.5), var(--app-safe-right));
  padding-left: max(calc(var(--bs-gutter-x) * 0.5), var(--app-safe-left));
}
.navbar-brand{
  line-height: 1.2;
}
.navbar-business-brand{
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.navbar-business-name{
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  font-size: 0.76rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0;
  max-height: 1.6rem;
}
.navbar-business-meta{
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.1;
}
.navbar-actions{
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}
.navbar-quick-actions{
  flex-wrap: nowrap;
  min-width: 0;
}
.navbar-actions .btn{
  flex: 0 0 auto;
  padding: 0.38rem 0.58rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
}
.navbar-toggler{
  flex: 0 0 auto;
}
.navbar-dark .navbar-nav .nav-link{
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Menú hamburguesa: navegación agrupada y scroll contenido. */
#topNavMenu.top-nav-menu{
  width: 100%;
  max-height: calc(100vh - 3.75rem);
  max-height: calc(100dvh - 3.75rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0.35rem 0.75rem 0.8rem;
}
.top-nav-mobile-header{
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  padding: 0.35rem 0.25rem 0.35rem 0.75rem;
  background: var(--naranja-oscuro);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.top-nav-mobile-title{
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
}
.top-nav-close{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0.75rem;
  background-size: 0.85rem;
  border-radius: 0.55rem;
}
.top-nav-close:focus-visible{
  outline: 3px solid var(--naranja-claro);
  outline-offset: 2px;
  box-shadow: none;
}
.top-nav-sections,
.top-nav-list{
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-nav-section{
  width: 100%;
  padding: 0.65rem 0 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.top-nav-section:first-child{
  border-top: 0;
}
.top-nav-section-label,
.top-nav-group-label{
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.top-nav-section-label{
  padding: 0.2rem 0.75rem 0.4rem;
}
.top-nav-group-label{
  margin-top: 0.55rem;
  padding: 0.55rem 1rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.top-nav-link.nav-link{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  width: 100%;
  margin: 0.08rem 0;
  padding: 0.58rem 0.75rem 0.58rem 1rem;
  border-left: 3px solid transparent;
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.9) !important;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}
.top-nav-link.nav-link:hover{
  background: rgba(255, 255, 255, 0.09);
  color: #fff !important;
}
.top-nav-link.nav-link.active,
.top-nav-link.nav-link.top-nav-link--active{
  border-left-color: var(--naranja-claro);
  background: rgba(255, 255, 255, 0.15);
  color: #fff !important;
  font-weight: 750;
}
.top-nav-link.nav-link:focus-visible,
.top-nav-collapsible:focus-visible{
  outline: 3px solid var(--naranja-claro);
  outline-offset: 2px;
  box-shadow: none;
}
.top-nav-badges{
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.top-nav-link .badge{
  flex: 0 0 auto;
  margin-left: auto;
}
.top-nav-link--with-description{
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 0.15rem !important;
}
.top-nav-link--with-description small{
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.25;
}
.top-nav-collapsible{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-align: left;
  text-transform: uppercase;
}
.top-nav-collapsible:hover,
.top-nav-collapsible.active{
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.top-nav-collapsible-indicator{
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg);
  transition: transform 160ms ease;
}
.top-nav-collapsible.collapsed .top-nav-collapsible-indicator{
  transform: rotate(45deg);
}
.top-nav-collapsible-body .top-nav-list{
  padding: 0.15rem 0 0.25rem 0.35rem;
}
.top-nav-account{
  margin-top: 0.35rem;
  padding-top: 0.7rem;
}
.top-nav-logout{
  cursor: pointer;
  font: inherit;
}

@media (max-width: 767.98px){
  body.top-nav-open{
    overflow: hidden;
  }

  #topNavMenu.top-nav-menu{
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1080;
    width: min(88vw, 22rem);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding:
      var(--app-safe-top)
      max(0.75rem, var(--app-safe-right))
      max(1rem, var(--app-safe-bottom))
      max(0.75rem, var(--app-safe-left));
    background: var(--naranja-oscuro);
    box-shadow: -1rem 0 2rem rgba(15, 23, 42, 0.28);
    overflow-y: auto;
    overflow-x: hidden;
  }

  #topNavMenu.top-nav-menu.collapsing{
    height: 100vh !important;
    height: 100dvh !important;
    transition: none;
  }

  .top-nav-mobile-header{
    display: flex;
  }
}

/* El contenedor conserva su gutter Bootstrap y solo lo amplía ante un borde físico. */
#contenido-principal.container{
  padding-right: max(calc(var(--bs-gutter-x) * 0.5), var(--app-safe-right));
  padding-left: max(calc(var(--bs-gutter-x) * 0.5), var(--app-safe-left));
}

body > footer{
  padding-right: var(--app-safe-right);
  padding-bottom: var(--app-safe-bottom);
  padding-left: var(--app-safe-left);
}

/* Documento público offline: protege los cuatro bordes sin heredar la app autenticada. */
.app-offline-page{
  min-height: 100vh;
  min-height: 100dvh;
}
.app-offline-main{
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: max(1.5rem, var(--app-safe-top)) !important;
  padding-right: max(0.75rem, var(--app-safe-right)) !important;
  padding-bottom: max(1.5rem, var(--app-safe-bottom)) !important;
  padding-left: max(0.75rem, var(--app-safe-left)) !important;
}

@media (display-mode: standalone){
  html,
  body{
    min-height: 100%;
    min-height: 100dvh;
  }
}

@media (min-width: 768px){
  #topNavMenu.top-nav-menu{
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }
  .top-nav-sections{
    max-width: 42rem;
    margin-left: auto;
  }
}

@media (orientation: landscape) and (max-height: 520px){
  #topNavMenu.top-nav-menu{
    max-height: calc(100vh - 3.25rem);
    max-height: calc(100dvh - 3.25rem);
  }
}

@media (prefers-reduced-motion: reduce){
  .top-nav-collapsible-indicator{
    transition: none;
  }

  .btn-cta-pulse,
  .btn-cta-pulse::after,
  .registro-negocio-processing.is-visible,
  .registro-negocio-processing .spinner-border,
  .registro-negocio-submit .spinner-border{
    animation: none !important;
  }
}

@media (min-width: 576px){
  .navbar-business-name{
    font-size: 0.86rem;
    line-height: 1.08;
    max-height: 1.9rem;
  }
}

@media (min-width: 768px){
  .navbar-business-name{
    font-size: 1rem;
    line-height: 1.08;
    max-height: 2.15rem;
  }
}

@media (min-width: 1200px){
  .navbar-business-name{
    font-size: 1.08rem;
    line-height: 1.08;
    max-height: 2.35rem;
  }
}


/* ==========================================================================
   7) Cards y Formularios (UI estándar del proyecto)
   - Usar en forms: <form class="card card-app shadow-sm p-3 p-md-4">
   - Secciones: <div class="form-section-soft"> ... </div>
   ========================================================================== */
.permission-selector{
  margin-top: 1.5rem;
}

.permission-group[hidden],
.permission-option[hidden]{
  display: none !important;
}

.permission-option{
  padding: 1rem;
  border: 1px solid #dfe4ea;
  border-radius: 0.75rem;
  background: #fff;
}

.permission-option:focus-within{
  border-color: rgba(0, 106, 16, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(0, 106, 16, 0.1);
}

.permission-option summary{
  cursor: pointer;
  color: var(--bs-primary);
  font-weight: 600;
}

.gestor-context-banner{
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  color: #ffffff;
  background: #0b5ed7;
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.24);
}

.gestor-context-banner__icon{
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.15rem;
}

.gestor-context-banner__body{
  min-width: 0;
}

.gestor-context-banner__title{
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
}

.gestor-context-banner__subtitle{
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (min-width: 768px){
  .gestor-context-banner{
    align-items: center;
    padding: 1rem 1.2rem;
  }
}

.gestion-mobile-card{
  border-radius: 1.1rem;
}

.gestion-mobile-shell{
  max-width: 100%;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.gestion-mobile-col{
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.gestion-mobile-card-body{
  padding-top: 0.55rem !important;
}

.gestion-mobile-header{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.gestion-special-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.gestion-mobile-top{
  display: grid;
  gap: 0.55rem;
}

.gestion-section-compact{
  padding: 0.6rem;
  margin-bottom: 0;
}

.mini-oper-grid-wrap{
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.mini-oper-grid{
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.64rem;
  line-height: 1.05;
}

.mini-oper-grid th,
.mini-oper-grid td{
  overflow: hidden;
  padding: 0.12rem 0.16rem;
  border: 1px solid #e5e7eb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-oper-grid--tight{
  font-size: 0.56rem;
  line-height: 1;
}

.mini-oper-grid--tight th,
.mini-oper-grid--tight td{
  padding: 0.08rem 0.08rem;
}

.mini-oper-grid th{
  color: var(--bs-secondary-color, #6c757d);
  font-weight: 700;
  background-color: #f8fafc;
}

.mini-oper-grid td:nth-child(2),
.mini-oper-grid td:nth-child(4){
  font-weight: 700;
  text-align: right;
}

@media (max-width: 380px){
  .mini-oper-grid{
    font-size: 0.56rem;
  }

  .mini-oper-grid th,
  .mini-oper-grid td{
    padding: 0.1rem 0.1rem;
  }
}

.quick-grid{
  display: grid;
  gap: 0.55rem;
}

.quick-grid--channels{
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-grid--results{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-grid--sources{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-choice--compact{
  min-height: 2.35rem;
  padding: 0.35rem 0.3rem;
  font-size: 0.76rem;
}

.quick-choice--iconic{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.15rem;
}

.quick-choice-icon{
  font-size: 1rem;
  line-height: 1;
}

.quick-choice-text{
  font-size: 0.58rem;
  line-height: 1.05;
  white-space: nowrap;
}

.quick-date-box{
  display: grid;
  gap: 0.5rem;
}

.quick-panel-stack{
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.quick-date-scroller{
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-date-scroller::-webkit-scrollbar{
  display: none;
}

.quick-date-btn{
  flex: 0 0 auto;
  min-height: 2.2rem;
  min-width: 2.2rem;
  padding: 0.28rem 0.5rem;
  font-size: 0.74rem;
  border-radius: 999px;
}

.quick-date-btn.active,
.quick-choice.active{
  color: #fff !important;
  background-color: var(--naranja-principal) !important;
  border-color: var(--naranja-principal) !important;
}

.compromiso-trigger-btn.compromiso-seleccionado{
  color: #fff !important;
  background-color: #198754 !important;
  border-color: #146c43 !important;
  box-shadow: 0 0 0 0.16rem rgba(25, 135, 84, 0.2);
  font-weight: 700;
}

.resultado-positivo{
  color: #198754;
  border-color: #198754;
  font-weight: 700;
}

.resultado-positivo.active,
.resultado-positivo.compromiso-seleccionado{
  color: #fff !important;
  background-color: #198754 !important;
  border-color: #146c43 !important;
}

.resultado-negativo{
  color: #dc3545;
  border-color: #dc3545;
  font-weight: 700;
}

.resultado-negativo.active{
  color: #fff !important;
  background-color: #dc3545 !important;
  border-color: #b02a37 !important;
}

.time-picker-hours{
  display: grid;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 0.5rem;
}

.time-picker-minutes-period{
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(96px, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.time-picker-minute-buttons,
.time-picker-period-buttons{
  display: grid;
  gap: 0.5rem;
}

.time-picker-minute-buttons{
  grid-template-columns: repeat(4, minmax(44px, 1fr));
}

.time-picker-period-buttons{
  grid-template-columns: repeat(2, minmax(44px, 1fr));
}

.time-picker-hours .quick-date-btn,
.time-picker-minute-buttons .quick-date-btn,
.time-picker-period-buttons .quick-date-btn{
  width: 100%;
}

.gestion-programada-note{
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  border-left: 3px solid var(--naranja-principal);
  border-radius: 0.35rem;
  background: rgba(255, 143, 31, 0.08);
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
}

.gestion-programada-note__label{
  color: #7a470d;
  font-weight: 600;
}

.gestion-programada-note__value{
  color: #3f2a14;
  font-weight: 600;
}

.quick-date-input-wrap{
  max-width: 18rem;
}

.gestion-compromisos-card{
  border-radius: 1rem;
}

.gestion-add-btn{
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem 0.55rem;
  font-size: 1rem;
  line-height: 1;
}

.gestion-compromisos-list{
  display: grid;
  gap: 0.55rem;
}

.gestion-compromisos-list .compromiso-row{
  margin-bottom: 0;
  padding: 0.75rem;
}

.gestion-compromisos-list .compromiso-row:last-child{
  margin-bottom: 0;
}

.gestion-proyeccion-mock{
  display: grid;
  gap: 0.6rem;
}

.gestion-proyeccion-mock-list{
  display: grid;
  gap: 0.75rem;
}

.gestion-proyeccion-panel{
  margin-bottom: 0;
  padding: 0.85rem;
}

.gestion-proyeccion-cuotas{
  display: grid;
  gap: 0.5rem;
}

.gestion-proyeccion-cuota-card{
  border: 1px solid #e7ebf0;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.55rem 0.6rem;
}

.gestion-proyeccion-cuota-card--selectable{
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.gestion-proyeccion-cuota-card--selectable:focus-visible{
  outline: 2px solid rgba(13, 110, 253, 0.45);
  outline-offset: 2px;
}

.gestion-proyeccion-cuota-card--sugerida{
  border-color: rgba(13, 110, 253, 0.35);
  background: #f7fbff;
}

.gestion-proyeccion-cuota-card--seleccionada{
  border-color: rgba(25, 135, 84, 0.45);
  background: #f3fbf7;
}

.gestion-proyeccion-cuota-card--limite{
  box-shadow: inset 3px 0 0 #198754;
}

.gestion-proyeccion-cuota-header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.gestion-proyeccion-cuota-title{
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}

.gestion-proyeccion-cuota-title strong{
  font-size: 0.88rem;
  line-height: 1.1;
}

.gestion-proyeccion-cuota-fecha{
  color: #6c757d;
  font-size: 0.74rem;
  white-space: nowrap;
}

.gestion-proyeccion-badge{
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.42rem;
  white-space: nowrap;
}

.gestion-proyeccion-badge--vencida{
  background: #f8d7da;
  color: #842029;
}

.gestion-proyeccion-badge--proxima{
  background: #cfe2ff;
  color: #084298;
}

.gestion-proyeccion-metrics-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.7rem;
  row-gap: 0.18rem;
}

.gestion-proyeccion-metric{
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.76rem;
  padding: 0.08rem 0;
  min-width: 0;
}

.gestion-proyeccion-metric span{
  color: #6c757d;
}

.gestion-proyeccion-metric strong{
  overflow-wrap: anywhere;
  text-align: right;
}

.gestion-proyeccion-metric--total strong{
  color: #0f5132;
  font-weight: 800;
}

.gestion-proyeccion-resumen{
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.gestion-proyeccion-resumen-item{
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.84rem;
}

.gestion-proyeccion-resumen-item strong{
  color: #9a3412;
}

.floating-hint-field{
  position: relative;
}

.floating-hint-field > .form-control,
.floating-hint-field > textarea{
  padding-top: 1.05rem;
  padding-bottom: 0.45rem;
}

.floating-hint-field--textarea > textarea{
  min-height: 5rem;
}

.floating-hint-field--compact > .form-control{
  min-height: 2.4rem;
}

.floating-hint-label{
  position: absolute;
  top: 0.78rem;
  left: 0.8rem;
  font-size: 0.82rem;
  line-height: 1;
  color: #6c757d;
  pointer-events: none;
  transition: all 0.15s ease;
  background: transparent;
}

.floating-hint-field:focus-within .floating-hint-label,
.floating-hint-field.has-value .floating-hint-label{
  top: 0.28rem;
  font-size: 0.68rem;
  color: var(--naranja-principal);
}

@media (min-width: 576px){
  .gestion-mobile-shell{
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .quick-grid--results{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px){
  .gestion-mobile-top{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gestion-proyeccion-cuotas{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

	  .quick-date-scroller{
	    flex-wrap: wrap;
	    overflow-x: visible;
	    scrollbar-width: auto;
	  }
	}

@media (max-width: 575.98px){
  .time-picker-minutes-period{
    grid-template-columns: 1fr;
  }
}

.comprobante-card{
  position: relative;
  overflow: hidden;
}

.comprobante-card--anulado{
  border-color: #f1aeb5;
}

.comprobante-alert{
  border-width: 2px;
}

.comprobante-badge-anulado{
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f1aeb5;
}

.comprobante-watermark{
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.4rem;
  color: rgba(132, 32, 41, 0.12);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.comprobante-card .card-body{
  position: relative;
  z-index: 1;
}

.comprobante-meta-anulado{
  border-color: #f1aeb5;
  background-color: #fff5f5;
}

.movimiento-card{
  position: relative;
  border: 1px solid #dee2e6;
  border-left: 4px solid transparent;
  background: #fff;
}

.movimiento-card--anulado{
  border-left-color: #dc3545;
  border-color: #f1aeb5;
  background: #fff5f5;
}

.movimiento-badge-estado{
  font-weight: 700;
  border-width: 1px;
}

.movimiento-badge-estado--aplicado{
  background-color: #198754;
  color: #fff;
  border-color: #198754;
}

.movimiento-badge-estado--anulado{
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.movimiento-badge-alerta{
  display: inline-block;
  background-color: #fff3cd;
  color: var(--bs-warning-text-emphasis, #664d03);
  border: 1px solid #ffe69c;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}


/* ==========================================================================
   8) Tablas (estándar del proyecto)
   - Estándar: envolver tablas en <div class="responsive-table"> ... </div>
   ========================================================================== */
.responsive-table{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.responsive-table:focus-visible{
  outline: 3px solid var(--app-focus-color);
  outline-offset: 2px;
}

.app-list-toolbar,
.app-dashboard-actions{
  min-width: 0;
}

.app-mobile-entity-card,
.app-mobile-entity-card button,
.app-mobile-entity-card a{
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px){
  .app-list-toolbar .form-control,
  .app-list-toolbar .btn,
  .app-dashboard-actions .btn,
  .pagination .page-link,
  .app-mobile-entity-card .btn{
    min-height: var(--app-touch-target-min);
  }

  .app-dashboard-actions .btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pagination{
    gap: 0.25rem;
  }
}

/* Tabla compacta (global) */
.table{
  font-size: 0.9rem;
}
.table th,
.table td{
  padding: 0.7rem 0.75rem;
}
.table th{
  font-weight: 600;
  line-height: 1.2;
}

/* Tema alterno opcional (si alguna vista lo usa explícitamente)
   Usar: <table class="table-orange"> ... </table>
*/
.table-orange{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-family: "Inter","Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
}
.table-orange thead{
  background-color: #ff6f00;
  color: #fff;
}
.table-orange th,
.table-orange td{
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
.table-orange tbody tr:nth-child(even){
  background-color: #fff3e0;
}
.table-orange tbody tr:hover{
  background-color: #ffe0b2;
}
.table-orange th{
  font-weight: 600;
}


/* ==========================================================================
   9) Autocomplete Barrios
   - Usar en templates: .autocomplete-wrapper + .autocomplete-results
   ========================================================================== */
.autocomplete-wrapper{ position: relative; }

.autocomplete-results{
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 2px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.autocomplete-item{
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.autocomplete-item small{ color: #6b7280; }
.autocomplete-item:hover{ background: #f3f4f6; }

.barrio-autocomplete-input{ text-align: left !important; }

.cliente-perfil-preview{
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 1rem;
}


/* ==========================================================================
   10) Textareas auto-ajustables
   - Usar: class="autosize-textarea" (tú ya tienes JS global)
   ========================================================================== */
.autosize-textarea{
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}


/* ==========================================================================
   11) Avatares (miniatura + zoom)
   - Usar:
     * <a class="avatar-link">...</a>
     * <img class="avatar-img avatar-32">
   ========================================================================== */
.avatar-link{
  cursor: zoom-in;
  display: inline-block;
  line-height: 0;
}

.avatar-img{
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.avatar-28{ width: 28px; height: 28px; }
.avatar-32{ width: 32px; height: 32px; }
.avatar-96{ width: 96px; height: 96px; }

.avatar-btn{
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
}

.avatar-fallback{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-light);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
}
.avatar-fallback.avatar-28{ width: 28px; height: 28px; font-size: 14px; }
.avatar-fallback.avatar-32{ width: 32px; height: 32px; font-size: 15px; }

/* Overlay zoom */
.avatar-zoom{ position: fixed; inset: 0; display: none; z-index: 1080; }
.avatar-zoom.is-open{ display: block; }
.avatar-zoom-backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.avatar-zoom-card{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: min(
    calc(100vw - var(--app-safe-left) - var(--app-safe-right) - 1rem),
    520px
  );
  max-height: calc(
    100dvh - var(--app-safe-top) - var(--app-safe-bottom) - 1rem
  );
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.avatar-zoom-close{
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 6px 10px;
}
.avatar-zoom-name{
  font-weight: 600;
  margin-bottom: 10px;
  padding-right: 44px;
}
.avatar-zoom-img{
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0,0,0,.03);
}


/* ==========================================================================
   12) TABLAS "fixed" (solo si necesito forzar que NO crezcan por contenido)
   - Usar en templates SOLO si es necesario:
     <table class="table ... table-fixed">
   ========================================================================== */
.responsive-table table.table-fixed{
  width: 100% !important;
  table-layout: fixed;
}

.responsive-table table.table-fixed th,
.responsive-table table.table-fixed td{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* ==========================================================================
   13) HISTORIAL (clientes / colaboradores / perfil / unidad) - AUTO ✅
   - Objetivo: NO cortar ningún valor. Si toca, que haga wrap.
   - Usar SIEMPRE:
     <div class="responsive-table">
       <table class="table table-striped align-middle mb-0 w-100 historial-table">...</table>
     </div>
   ========================================================================== */
.responsive-table table.historial-table{
  width: 100%;
  table-layout: auto; /* ✅ no fixed */
}

.responsive-table table.historial-table th,
.responsive-table table.historial-table td{
  vertical-align: top;
}

/* Encabezados en una línea */
.responsive-table table.historial-table th{
  white-space: nowrap;
}

/* Celdas: nunca cortar; permitir wrap */
.responsive-table table.historial-table td{
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Fecha en una línea (PC) */
@media (min-width: 768px){
  .responsive-table table.historial-table td[data-label="Fecha / hora"]{
    white-space: nowrap;
  }
}

@media print{
  .comprobante-watermark{
    color: rgba(132, 32, 41, 0.18) !important;
  }

  .comprobante-alert{
    display: block !important;
    border: 2px solid #842029 !important;
    color: #842029 !important;
    background: #fff !important;
  }
}


/* ==========================================================================
   14) Utilidad opcional
   - Usar: class="col-min-140" en <th> o <td>
   ========================================================================== */
.col-min-140{
  min-width: 140px;
}

/* =========================
   Tablas – alineación contable (FINAL)
   ========================= */

table th,
table td {
  vertical-align: middle;
}

td.col-money,
th.col-money,
td.col-num,
th.col-num {
  text-align: right !important;
  white-space: nowrap;
}

td.col-center,
th.col-center {
  text-align: center !important;
}

table tfoot th,
table tfoot td {
  text-align: right !important;
  font-weight: 700;
}


/* =========================
   CTA Proyección – Micro interacción
   ========================= */

.btn-cta-pulse {
  position: relative;
  animation: ctaPulse 2.2s ease-in-out infinite;
}

/* Paso 2 siempre preview */
.step2-preview .tab-amort {
  pointer-events: none;
  opacity: 0.65;
}

.step2-preview .tab-amort.active {
  opacity: 1;
}

/* mostrar SOLO el tab activo en Paso 2 */
.step2-preview #cotizacionTabs .nav-item:not(.is-active-amort) {
  display: none;
}

/* Halo suave */
.btn-cta-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: rgba(255, 111, 0, 0.35);
  opacity: 0;
  z-index: -1;
  animation: ctaGlow 2.2s ease-in-out infinite;
}

/* Animación principal */
@keyframes ctaPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* Glow */
@keyframes ctaGlow {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  45% {
    opacity: 0.7;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Hover: se detiene la animación y responde normal */
.btn-cta-pulse:hover,
.btn-cta-pulse:focus {
  animation: none;
}

.btn-cta-pulse:hover::after,
.btn-cta-pulse:focus::after {
  animation: none;
  opacity: 0.9;
}


/

/* Tabs no seleccionadas */
#cotizacionTabs .nav-link.tab-disabled {
  background: #f1f3f5 !important;
  color: #6c757d !important;
  border-color: #dee2e6 !important;
  opacity: 0.9;
}

/* Tab seleccionada */
#cotizacionTabs .nav-link.tab-selected,
#cotizacionTabs .nav-link.active {
  background: #c65a00 !important; /* naranja oscuro */
  color: #ffffff !important;
  border-color: #c65a00 !important;
  font-weight: 700;
}


/* --- Tabs amortización: modo locked (solo mostrar seleccionada) --- */
#cotizacionTabs.amort-locked .nav-link {
  display: none;
}

#cotizacionTabs.amort-locked .nav-link.tab-selected {
  display: inline-flex; /* o inline-block */
}

/* --- Estilos visuales (ajústalos a tu naranja) --- */
#cotizacionTabs .nav-link.tab-selected {
  background: var(--orange-700, #c2410c); /* naranja oscuro */
  color: #fff !important;
  border-color: var(--orange-700, #c2410c);
}

#cotizacionTabs .nav-link.tab-disabled {
  background: #f3f4f6;
  color: #6b7280 !important;
  border-color: #e5e7eb;
  opacity: 0.9;
}


/* 🔵 Texto informativo (text-muted) */
.text-amort-muted {
  color: #0d6efd !important; /* azul Bootstrap primary */
}

/* 🔴 Sistema seleccionado */
.text-amort-selected {
  color: #dc3545 !important; /* rojo Bootstrap danger */
}


/* Modo RESUMEN: solo se muestra la pestaña seleccionada */
#cotizacionTabs.amort-locked .nav-item {
  display: none;
}
#cotizacionTabs.amort-locked .nav-item.is-active-amort {
  display: list-item;
}

/* Estilos tabs: seleccionada vs no seleccionada */
#cotizacionTabs .tab-amort.tab-disabled {
  opacity: 0.55;
  filter: grayscale(1);
}

#cotizacionTabs .tab-amort.tab-selected {
  background: var(--orange-800, #c2410c); /* ajusta a tu naranja oscuro real */
  color: #fff;
  border-color: var(--orange-800, #c2410c);
}
#cotizacionTabs .tab-amort.tab-selected small,
#cotizacionTabs .tab-amort.tab-selected span {
  color: #fff !important;
}

/* Oculta SIEMPRE acciones cuando estás editando */
body[data-editando="1"] #wrap-actions-resultado{
  display: none !important;
}


/* ===============================
   Inputs con fondo naranja suave
   =============================== */

/* Tabs amortización: modo PREVIEW bloqueado */
.amort-locked .tab-amort {
  pointer-events: none;
  opacity: .65;
}

/* La activa sí se ve “normal” */
.amort-locked .tab-amort.active,
.amort-locked .tab-amort.tab-selected {
  opacity: 1;
}

.text-nowrap-currency {
  white-space: nowrap;
}

.table-report th,
.table-report td {
  vertical-align: middle;
}

.table-report .col-text {
  text-align: left !important;
}

.table-report .col-num {
  text-align: right !important;
  white-space: nowrap;
}

.table-report tfoot th,
.table-report tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--bs-border-color);
  background: var(--bs-light);
}

.table-report-wide {
  min-width: 980px;
}

.dashboard-status-green {
  background: #f0fdf4;
  border-color: #bbf7d0 !important;
}

.dashboard-status-yellow {
  background: #fffbeb;
  border-color: #fde68a !important;
}

.dashboard-status-red {
  background: #fef2f2;
  border-color: #fecaca !important;
}

.dashboard-status-neutral {
  background: #f8f9fa;
  border-color: var(--bs-border-color) !important;
}

.dashboard-range-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dashboard-range-link:hover,
.dashboard-range-link:focus {
  color: inherit;
  text-decoration: none;
  filter: brightness(0.98);
}

.cliente-fotos-grid {
  --cliente-foto-gap: 0.5rem;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--cliente-foto-gap);
  width: 100%;
}

.cliente-foto-card {
  display: flex;
  flex: 0 1 calc((100% - var(--cliente-foto-gap)) / 2);
  flex-direction: column;
  max-width: calc((100% - var(--cliente-foto-gap)) / 2);
  min-width: 0;
}

.cliente-foto-card--anterior {
  order: 1;
}

.cliente-foto-card--actual {
  order: 2;
}

.cliente-foto-card--actual:only-child {
  margin-left: auto;
}

.cliente-foto-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bs-light);
}

.cliente-foto-meta {
  font-size: 0.75rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .cliente-fotos-grid {
    --cliente-foto-gap: 0.75rem;
    max-width: 720px;
  }

  .cliente-foto-img {
    aspect-ratio: 4 / 3;
  }
}

/* Estado de procesamiento del registro de negocio. */
.registro-negocio-card {
  position: relative;
  overflow: hidden;
}

.registro-negocio-submit {
  min-width: 14rem;
}

.registro-negocio-processing {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.registro-negocio-processing[hidden] {
  display: none;
}

.registro-negocio-processing.is-visible {
  animation: registro-negocio-fade-in 180ms ease-out both;
}

.registro-negocio-processing__panel {
  width: min(100%, 28rem);
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 1rem;
  background: #fff;
  color: #1f2937;
  text-align: center;
  box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.14);
}

.registro-negocio-processing__spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
}

.registro-negocio-processing__message {
  min-height: 1.5rem;
  color: #475569;
  font-weight: 600;
}

@keyframes registro-negocio-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 575.98px) {
  .registro-negocio-processing {
    padding: 0.75rem;
  }

  .registro-negocio-processing__panel {
    padding: 1.25rem 1rem;
  }

  .registro-negocio-submit {
    min-width: 0;
  }
}

.mora-type-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.mora-type-option {
  min-height: 3rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light);
  color: var(--bs-body-color);
  font-weight: 600;
  text-align: left;
}

.mora-type-option:hover,
.mora-type-option:focus {
  border-color: var(--bs-primary);
  background: #eef5ff;
  color: var(--bs-primary);
}

.mora-type-option.is-active {
  border-color: var(--bs-success);
  background: var(--bs-success);
  color: #fff;
  box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.18);
}

.mora-type-option:disabled {
  opacity: 0.75;
}

.mora-example-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.625rem 0.75rem;
}

.mora-example-card .table {
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.15;
}

.mora-example-card h6 {
  font-size: 0.875rem;
  line-height: 1.15;
}

.mora-example-card .small {
  font-size: 0.75rem;
}

.mora-example-card .table-responsive {
  margin-top: 0.5rem !important;
}

.mora-example-card .table > :not(caption) > * > * {
  padding: 0.25rem 0.375rem;
}

.mora-example-card .table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
}

.mora-example-card .mora-base-highlight td {
  background: #ecfdf3;
  color: #0f5132;
  font-weight: 700;
}

.mora-example-card .table tbody tr:last-child td {
  padding-top: 0.375rem;
}

@media (min-width: 768px) {
  .mora-type-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mora-type-option {
    text-align: center;
  }
}
