/* Paleta oficial: Manual de marca AXIS Travel Consulting v0.2 (17 sep 2026).
   Regla de Alexander: nunca fondos negros ni oscuros -- blanco y colores vivos. */
:root {
  --text: #2C2C2B;
  --text-soft: #7D7A75;
  --bg: #FFFFFF;
  --bg-soft: #F9F8F7;
  --border: #E6E5E3;
  --primary: #2783DE;      /* azul consultivo */
  --navy: #0A2E6E;         /* azul oscuro del logo: titulos y encabezados de tabla */
  --accent: #D5803B;       /* naranja AXIS: enfasis */
  --accent-soft: #FBEFE2;  /* beige/naranja suave: totales y destacados */
  --ok: #46A171;
  --danger: #E56458;
  --primary-soft: #E8F2FC;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, Aptos, Calibri, sans-serif; color: var(--text); background: var(--bg-soft); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--navy); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; color: var(--navy); }
h2 { font-size: 1.1rem; color: var(--navy); }

/* ---------- Aplicacion (con sesion) ---------- */
.stripe { height: 5px; background: linear-gradient(90deg, var(--navy) 0%, var(--primary) 55%, var(--accent) 100%); }
.shell { display: flex; min-height: calc(100vh - 5px); }
/* Menu lateral flotante y abatible (2026-10-25, mismo lenguaje que OMNICHAT): panel claro azul grisaceo con filete naranja, esquinas de 16 px y separacion
   del contenido; iconos en azul AXIS; opcion activa #1868B7 con borde izquierdo naranja; secciones OMNICHAT / OMNIAXIS. */
.sidebar { position: sticky; top: 8px; align-self: flex-start; width: 232px; height: calc(100vh - 5px - 16px); margin: 8px 6px 8px 8px; padding: 10px 10px 12px;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overflow-x: hidden; flex-shrink: 0; background: #F5F8FC; border: 1px solid #DCE3EC;
  border-top: 3px solid var(--accent); border-radius: 16px; box-shadow: 0 1px 2px rgba(10, 46, 110, .06), 0 8px 24px rgba(10, 46, 110, .08); }
.sidebar-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .logo { display: block; width: 118px; margin: 4px 0 6px 6px; border-radius: 10px; }
.menu-plegar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--navy);
  cursor: pointer; padding: 0; }
.menu-plegar:hover { background: rgba(39, 131, 222, .10); }
.menu-plegar svg, .nav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-seccion { display: block; margin: .85rem .6rem .3rem; padding-top: .55rem; border-top: 1px solid rgba(10, 46, 110, .10); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; color: #4F5B6E; }
.nav-seccion:first-child { margin-top: .35rem; }
.nav a { display: flex; align-items: center; gap: .7rem; min-height: 40px; padding: 0 .75rem; border-radius: 8px; color: var(--navy); margin-bottom: 2px; font-size: .9rem;
  font-weight: 600; white-space: nowrap; }
.nav a svg { color: var(--primary); }
.nav a:hover { background: rgba(39, 131, 222, .10); color: var(--navy); }
.nav a.active, .nav a.active:hover { background: #1868B7; color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.active svg { color: #fff; }
.nav a:focus-visible, .menu-plegar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Contraido (solo escritorio): solo iconos; los nombres quedan para lectores de pantalla y en el title */
@media (min-width: 901px) {
  .shell.menu-compacto .sidebar { width: 64px; padding-left: 8px; padding-right: 8px; }
  .shell.menu-compacto .sidebar-cab { flex-direction: column; }
  .shell.menu-compacto .sidebar .logo { width: 40px; margin: 2px auto 0; }
  .shell.menu-compacto .menu-plegar { transform: rotate(180deg); }
  .shell.menu-compacto .nav a { justify-content: center; padding: 0; }
  .shell.menu-compacto .nav-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shell.menu-compacto .nav-seccion { font-size: 0; margin: .6rem .2rem .3rem; padding-top: 0; }
}
.main { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.75rem; background: var(--bg); border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text-soft); }
.topbar strong { color: var(--navy); }
.topbar form { margin: 0; }
.content { padding: 1.75rem; max-width: 1100px; }.subtitle { color: var(--text-soft); margin: 0 0 1.5rem; font-size: .93rem; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(10, 46, 110, .06); }
.panel.highlight { border-top: 4px solid var(--accent); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
th { text-align: left; background: var(--navy); color: #fff; font-weight: 600; padding: .65rem .7rem; }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td { padding: .65rem .7rem; border-bottom: 1px solid var(--border); }
tbody tr:hover td { background: var(--bg-soft); }
tr.total td { background: var(--accent-soft); font-weight: 700; color: var(--navy); }
.muted { color: var(--text-soft); }
.badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #e6f4ec; color: #1f6b45; }
.badge.off { background: var(--bg-soft); color: var(--text-soft); border: 1px solid var(--border); }
.badge.accent { background: var(--accent-soft); color: #9a5314; }
.badge.warn { background: var(--accent-soft); color: #9a5314; }
.badge.danger { background: #fbe9e7; color: #a3382e; }
.money { color: var(--navy); font-weight: 700; }
.money .cur { color: var(--accent); font-weight: 700; }
.row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: min(160px, 100%); }
.row > .fit { flex: 0 0 auto; min-width: 0; }
.flash { padding: .7rem .95rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; font-weight: 500; }
.flash.ok { background: #e6f4ec; color: #1f6b45; border-left: 4px solid var(--ok); }
.flash.error { background: #fbe9e7; color: #a3382e; border-left: 4px solid var(--danger); }
.empty { text-align: center; padding: 2rem; color: var(--text-soft); }

/* ---------- Formularios y botones (toda la app) ---------- */
label { display: block; font-size: .82rem; color: var(--text-soft); margin-bottom: .25rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: .58rem .7rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); margin-bottom: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d9f6; border-color: var(--primary); }
.btn, .card button, .card .tenant-option.submit { display: inline-block; padding: .6rem 1.1rem; border: none; border-radius: 8px; background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover, .card button:hover { background: var(--navy); }
.btn.secondary { background: var(--bg); color: var(--navy); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.small { padding: .28rem .7rem; font-size: .82rem; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #b9692b; }

/* ---------- Paginas publicas (login, alta de agencia) ---------- */
body.public { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem;
  background: linear-gradient(160deg, #ffffff 0%, var(--primary-soft) 100%); }
.card { background: var(--bg); padding: 2rem 2.25rem 2.25rem; border-radius: 16px; width: 100%; max-width: 420px;
  box-shadow: 0 12px 34px rgba(10, 46, 110, .14); border-top: 5px solid var(--accent); }
.card .logo { display: block; width: 130px; margin: 0 auto 1.25rem; }
.card h1 { text-align: center; font-size: 1.3rem; margin-bottom: 1.25rem; }
.card button[type=submit] { width: 100%; }
.error { background: #fbe9e7; color: #a3382e; padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; border-left: 4px solid var(--danger); }
.tenant-option { display: block; width: 100%; text-align: left; padding: .8rem .9rem; margin-bottom: .6rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--navy); cursor: pointer; font-weight: 600; }
.tenant-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.card .tenant-option { color: var(--navy); }
.card .tenant-option:hover { background: var(--primary-soft); color: var(--navy); }
.role { color: var(--text-soft); font-size: .85rem; font-weight: 400; }

/* ---------- Componentes visuales (pipeline y resto de la app) ---------- */
:root {
  --st-quoted: #2783DE; --st-confirmed: #46A171; --st-to_invoice: #D5803B;
  --st-invoiced: #0A2E6E; --st-lost: #E56458; --st-cancelled: #7D7A75;
  /* tarjeta "No concretados" (Perdido + Cancelado unidos solo en el panel de indicadores) */
  --st-not_won: #C0574F;
}
.agent-bar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: 1rem 1.25rem; margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--primary-soft), #fff); border: 1px solid #cfe3f7; border-left: 6px solid var(--accent); border-radius: 12px; }
.agent-bar .title { font-weight: 800; color: var(--navy); font-size: 1rem; }
.agent-bar select { width: auto; min-width: min(260px, 100%); max-width: 100%; margin: 0; font-weight: 700; color: var(--navy); border: 2px solid var(--primary); background: #fff; }
.agent-bar .hint { color: var(--text-soft); font-size: .85rem; }
.agent-bar form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
/* Panel de indicadores de Ventas (6 tarjetas exactas): columnas iguales que reparten el ancho
   disponible, para que quepan en una sola fila en escritorio sin desplazamiento horizontal
   (auto-fit/minmax no alcanza con 6 tarjetas dentro de .content{max-width:1100px}). En pantallas
   angostas se apila de forma responsiva. */
.kpis.kpis-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .kpis.kpis-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpis.kpis-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi { background: #fff; border: 1px solid var(--border); border-top: 5px solid var(--kpi, var(--primary)); border-radius: 12px; padding: .9rem 1rem;
  box-shadow: 0 1px 3px rgba(10, 46, 110, .06); display: block; color: inherit; }
.kpi:hover { box-shadow: 0 6px 16px rgba(10, 46, 110, .12); color: inherit; }
div.kpi:hover { box-shadow: 0 1px 3px rgba(10, 46, 110, .06); cursor: default; } /* .kpi sin <a>: resumen sin destino, sin apariencia de enlace */
.kpi.active { outline: 3px solid var(--kpi, var(--primary)); outline-offset: 1px; }
.kpi .label { font-size: .78rem; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.kpi .count { font-size: 2rem; font-weight: 800; color: var(--kpi, var(--navy)); line-height: 1.1; margin: .2rem 0; }
.kpi .amount { font-size: .88rem; color: var(--navy); font-weight: 700; }
.kpi .amount .cur { color: var(--accent); }
.kpi.total { --kpi: var(--navy); background: linear-gradient(135deg, #fff, var(--accent-soft)); }
/* Retoque visual (Ajuste 2): las 6 tarjetas de Ventas/Inicio centradas y con la misma
   altura de titulo reservada, para que numeros y montos queden alineados aunque
   "No concretados" ocupe dos lineas. Solo afecta esta fila de 6 tarjetas. */
.kpis.kpis-compact .kpi { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kpis.kpis-compact .kpi .label { min-height: 2.3rem; display: flex; align-items: center; justify-content: center; }
.kpis.kpis-compact .kpi .count { margin: .15rem 0; }
.kpis.kpis-compact .kpi .amount { min-height: 1.3rem; display: flex; align-items: center; justify-content: center; }
.kpis.kpis-compact .kpi > .muted { margin-top: .15rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.pill.on_track { background: #e6f4ec; color: #1f7a4d; }
.pill.needs_follow_up { background: #fde8e5; color: #c0392b; }
.pill.closed_won { background: #e3effc; color: #1a5fae; }
.pill.closed_lost { background: #eeedec; color: #6b6863; }
.chip { display: inline-block; padding: .2rem .7rem; border-radius: 8px; font-size: .78rem; font-weight: 700; color: #fff; background: var(--c, var(--primary)); }
.chip.quoted { --c: var(--st-quoted); } .chip.confirmed { --c: var(--st-confirmed); } .chip.to_invoice { --c: var(--st-to_invoice); }
.chip.invoiced { --c: var(--st-invoiced); } .chip.lost { --c: var(--st-lost); } .chip.cancelled { --c: var(--st-cancelled); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: .72rem; font-weight: 800; margin-right: .5rem; vertical-align: middle; }
.avatar.a1 { background: #2783DE; } .avatar.a2 { background: #D5803B; } .avatar.a3 { background: #46A171; } .avatar.a4 { background: #0A2E6E; } .avatar.a5 { background: #8e5bd0; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1; min-width: 150px; }
.filters input, .filters select { margin-bottom: 0; }
.alert-link { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-radius: 999px; background: #fde8e5; color: #c0392b; font-weight: 700; font-size: .85rem; }
.choice { display: block; padding: .9rem 1rem; border: 2px solid var(--border); border-radius: 12px; margin-bottom: .6rem; cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--primary); }
.choice input { width: auto; margin: 0 .6rem 0 0; }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .6rem 0 .6rem 1.2rem; border-left: 3px solid var(--border); margin-left: .4rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -.5rem; top: 1rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .45rem .75rem; font-size: .92rem; }
.kv dt { color: var(--text-soft); font-weight: 600; } .kv dd { margin: 0; }

/* ---------- Ficha del expediente: dinero, cotizaciones, servicios y pagos ---------- */
.pill.no_payments { background: #fde8e5; color: #c0392b; }
.pill.partial, .pill.partially_paid { background: var(--accent-soft); color: #9a5314; }
.pill.paid { background: #e6f4ec; color: #1f7a4d; }
.pill.pending { background: #e3effc; color: #1a5fae; }
.pill.overdue { background: #fde8e5; color: #c0392b; }
.chip.qproposed { --c: var(--primary); } .chip.qchosen { --c: var(--ok); } .chip.qnot_chosen { --c: var(--st-cancelled); }
.chip.ppending { --c: var(--accent); } .chip.pconfirmed { --c: var(--ok); } .chip.pvoided { --c: var(--st-cancelled); }
/* Pagos a proveedores (0046): movimientos y cifras de la obligacion */
.chip.prejected { --c: var(--danger); }
.sp-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: .6rem 0 .2rem; }
.sp-figure { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.sp-figure .lbl { font-size: .76rem; color: var(--text-soft); }
.sp-figure .val { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.sp-figure.reserved .val { color: #9a5314; }
.sp-figure.reserved { background: var(--accent-soft); border-color: #f0d6bb; }
.sp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; align-items: end; }
.sp-form label { font-size: .78rem; color: var(--text-soft); display: block; margin-bottom: .15rem; }
.sp-note { font-size: .8rem; color: var(--text-soft); margin: .25rem 0 0; }
.sp-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.sp-actions form { margin: 0; }
.sp-reject { display: flex; gap: .3rem; align-items: center; }
.sp-reject input[type=text] { min-width: 11rem; }
/* Pago conjunto: motivo del rechazo con etiqueta y ayuda visibles, sin cortes en el ancho revisado */
.sp-reject-group { display: flex; flex-direction: column; align-items: stretch; gap: .2rem; min-width: 18rem; max-width: 100%; }
.sp-reject-group label { font-size: .78rem; color: var(--text-soft); margin: 0; }
.sp-reject-group .sp-reject-row { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.sp-reject-group .sp-reject-row input[type=text] { flex: 1 1 12rem; min-width: 0; box-sizing: border-box; }
.sp-reject-group .sp-note { margin: 0; }
/* Correccion visual (solo Pagos a proveedores): selector de estado completo y columna de acciones con ancho suficiente */
.sp-filters select { min-width: 16rem; }
.sp-attach { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.sp-attach input[type=file] { max-width: 15rem; }
.sp-form input[type=file] { width: 100%; max-width: 100%; box-sizing: border-box; }
.sp-form .sp-file { grid-column: span 2; }
/* Pago conjunto (0047): importes por obligacion */
.sp-lines .gp-amount { width: 100%; max-width: 10rem; text-align: right; box-sizing: border-box; }
@media (min-width: 1000px) {
  .sp-detail td.pay-actions-cell { min-width: 19rem; }
  .sp-detail td.pay-actions-cell .sp-reject input[type=text] { min-width: 12rem; flex: 1 1 12rem; }
}
.pay-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.pay-band .kpi .count { font-size: 1.45rem; }
.kpi.semaforo { --kpi: var(--sem, var(--text-soft)); }
.kpi.semaforo.no_payments { --sem: var(--danger); } .kpi.semaforo.partial { --sem: var(--accent); } .kpi.semaforo.paid { --sem: var(--ok); }
.kpi.semaforo.overdue { --sem: var(--danger); }
.quote-card { border: 1px solid var(--border); border-left: 6px solid var(--primary); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; background: #fff; }
.quote-card.chosen { border-left-color: var(--ok); background: #f6fbf8; }
.quote-card.not_chosen { border-left-color: var(--st-cancelled); opacity: .75; }
/* flex-wrap:nowrap a proposito: con "wrap", el navegador decide si la fila salta de linea usando el
   ancho COMPLETO (sin encoger) del titulo, incluso si luego el titulo si podria encogerse -- por eso un
   titulo largo empujaba el total entero debajo, con espacio en blanco al lado (Ajuste visual 3). Con
   nowrap, el titulo se encoge y envuelve su propio texto en 2-3 lineas, pero el total se queda siempre
   a la derecha, igual que una cotizacion con titulo corto. Vuelve a "wrap" solo en celular (ver abajo). */
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: nowrap; margin-bottom: .6rem; }
/* Titulo largo: maximo 2 lineas (el resto se ve al pasar el mouse, por el title="" de la plantilla) en
   vez de encogerse hasta verse angosto y alto -- eso era lo que se veia desordenado (Ajuste visual 4). */
.quote-head .name { font-weight: 800; color: var(--navy); font-size: 1.02rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quote-head-info { min-width: 0; flex: 1 1 auto; }
.quote-totals { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .85rem; color: var(--text-soft); flex-shrink: 0; }
.quote-totals strong { color: var(--navy); display: block; font-size: 1.05rem; }
.quote-totals .big strong { color: var(--accent); font-size: 1.2rem; }
/* OJO: .quote-totals tambien la usa la vista previa de precio del formulario "Agregar/Editar linea"
   (_line_fields.html), con el valor arriba del rotulo (strong en bloque). Lo de abajo, en cambio, es
   SOLO para la cabecera de la tarjeta de cotizacion: pasa de 3 bloques grandes en fila a una lista
   compacta alineada a la derecha (rotulo y valor en la misma linea), para dejarle mas ancho al titulo
   sin perder ninguna cifra (Ajuste visual 4). Por eso va con el prefijo ".quote-head" -- no toca la
   vista previa del formulario. */
.quote-head .quote-totals { flex-direction: column; align-items: flex-end; gap: .2rem; font-size: .78rem;
  text-align: right; white-space: nowrap; }
.quote-head .quote-totals .big { font-size: .85rem; }
.quote-head .quote-totals strong { display: inline; font-size: inherit; font-weight: 700; margin-left: .35rem; }
.quote-head .quote-totals .big strong { font-size: .98rem; }
/* La frase larga del aviso de comision vivia DENTRO de .quote-totals (con flex-basis:100%) y, aunque
   se dibujaba en su propia linea, su ancho de texto completo seguia inflando el ancho "natural" que el
   navegador usa para decidir si .quote-head envuelve (esa decision se toma ANTES de poder encoger nada).
   Por eso una cotizacion con comision pendiente se veia distinta a una sin ella. Sacando la frase como
   hermana, fuera de .quote-totals, ambas cotizaciones miden lo mismo y envuelven igual (Ajuste visual 2). */
.quote-commission-note { font-size: .85rem; margin: 0 0 .6rem; }
.mini { font-size: .85rem; margin: .5rem 0; }
.mini th { padding: .4rem .55rem; font-size: .78rem; } .mini td { padding: .4rem .55rem; }
.line-fields .grp { display: contents; }
details.inline > summary { cursor: pointer; color: var(--primary); font-weight: 700; padding: .3rem 0; }
/* Retoque visual (Ajuste 2): boton real para "Pasar a No concretado", con clase propia
   (no ".inline") para no afectar los <details class="inline"> de Cotizaciones/Servicios/Costeos.
   El summary ya trae .btn.secondary; solo se quita la marca nativa de <summary>. */
.status-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.status-not-won > summary { list-style: none; cursor: pointer; }
.status-not-won > summary::-webkit-details-marker { display: none; }
.status-not-won > summary::marker { content: ""; }
.status-not-won-panel { margin-top: .6rem; min-width: min(280px, 100%); display: flex; flex-direction: column; gap: .5rem;
  padding: .9rem 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; }
.status-not-won-option { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin: 0; }
.status-not-won-option input { width: auto; margin: 0; }
.btn.choose { background: var(--ok); } .btn.choose:hover { background: #2f7a54; }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #c4493e; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.inline-form input { width: 130px; margin: 0; padding: .3rem .5rem; }

textarea { font: inherit; resize: vertical; }
.chip.brequested { --c: var(--accent); } .chip.binvoiced { --c: var(--navy); } .chip.bcancelled { --c: var(--st-cancelled); }

/* Paneles de pagos de la ficha comercial: se apilan cuando dos columnas no alcanzan para mostrar su contenido; las tablas, los
   botones y el formulario quedan contenidos dentro de su panel (sin desbordamiento horizontal). */
.pay-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 1.25rem; align-items: start; }
.pay-panels > .panel { min-width: 0; }
.pay-panels .pay-wrap { overflow-wrap: anywhere; }
.pay-panels .nowrap { white-space: nowrap; }
.pay-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.pay-actions-cell { text-align: right; }
/* Ajuste 9: nota de estado (motivo del rechazo o por que no se puede decidir) y rechazo con motivo, contenidos en el panel. */
.pay-status { min-width: 0; }
.pay-note { font-size: .78rem; margin-top: .2rem; overflow-wrap: anywhere; white-space: normal; }
.pay-actions .sp-reject { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.pay-actions .sp-reject input[type=text] { min-width: 0; flex: 1 1 9rem; }
.pay-form { margin-top: .75rem; }
.pay-form .row > div { min-width: min(160px, 100%); }
/* Ancho reducido: cada fila de las tablas de pagos pasa a una tarjeta (etiqueta a la izquierda, valor a la derecha) para que nada
   se salga del panel. */
@media (max-width: 1000px) {
  .pay-panels .pay-table thead { display: none; }
  .pay-panels .pay-table, .pay-panels .pay-table tbody, .pay-panels .pay-table tr, .pay-panels .pay-table td { display: block; width: 100%; }
  .pay-panels .pay-table tr { border: 1px solid var(--border); border-radius: 10px; padding: .35rem .7rem; margin-bottom: .6rem; }
  .pay-panels .pay-table td { border: none; padding: .2rem 0; display: flex; justify-content: space-between; align-items: center; gap: .75rem; text-align: right; }
  .pay-panels .pay-table td::before { content: attr(data-label); color: var(--text-soft); font-weight: 600; text-align: left; flex: 0 0 auto; }
  .pay-panels .pay-table td.pay-actions-cell { justify-content: flex-end; }
  .pay-panels .pay-table td.pay-actions-cell::before { content: none; }
  .pay-panels .pay-table td.pay-actions-cell:not(:has(form)) { display: none; }
}

/* ---------- Adaptacion a pantalla dividida y movil (corte responsive del nucleo) ----------
   Objetivo: que los asesores trabajen con la ventana a media pantalla (640-760 px) sin desplazamiento horizontal de la pagina, sin cortes ni
   superposiciones y sin ocultar informacion. Solo presentacion: ningun permiso, calculo, validacion ni dato cambia. Escritorio (> 900 px) no cambia. */

/* Textos largos (correos, enlaces, nombres sin espacios) se parten en vez de empujar la pagina. */
h1, h2 { overflow-wrap: anywhere; }
.panel p, .panel dd, .panel li, .panel a:not(.btn), .subtitle { overflow-wrap: anywhere; }
.btn, .badge, .chip, .pill { overflow-wrap: normal; word-break: normal; }
.badge, .chip, .pill, .nowrap { white-space: nowrap; }
.btn { max-width: 100%; }
input[type=file] { max-width: 100%; }

/* Tablas con desplazamiento horizontal LOCAL: el contenedor lleva la barra (visible) y sombras laterales que avisan cuando hay mas columnas a un lado;
   toda la tabla y sus acciones se alcanzan dentro del propio panel, y la pagina nunca se desplaza por culpa de una tabla. Lleva tabindex para que se
   pueda recorrer con el teclado. `.wide` (listas y tarifas de muchas columnas) conserva un ancho minimo legible. */
.table-scroll { max-width: 100%; overflow-x: auto; margin: .25rem 0 .5rem; scrollbar-width: thin; scrollbar-color: var(--primary) var(--primary-soft);
  background:
    linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) 0 0 / 2.2rem 100% no-repeat local,
    linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) 100% 0 / 2.2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(10, 46, 110, .3), rgba(10, 46, 110, 0)) 0 0 / .8rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(10, 46, 110, .3), rgba(10, 46, 110, 0)) 100% 0 / .8rem 100% no-repeat scroll; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: var(--primary-soft); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 999px; }
.table-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.table-scroll > table { margin: 0; }
.table-scroll.wide > table { min-width: 34rem; }
.table-scroll.wider > table { min-width: 52rem; }
/* Aviso de desplazamiento (solo cuando el ancho puede obligarlo): la barra y las sombras estan en la tabla, que puede quedar mas abajo. */
.scroll-hint { display: none; margin: .1rem 0 .35rem; font-size: .8rem; color: var(--text-soft); font-weight: 600; }
@media (max-width: 700px) { .scroll-hint { display: block; } }

/* Pantalla dividida (<= 900 px): el menu lateral pasa a una barra superior compacta; el contenido usa todo el ancho. */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  /* Movil y tableta: el mismo panel claro, en una barra horizontal (sin abatir ni titulos de seccion) */
  .sidebar { position: static; align-self: stretch; min-width: 0; width: auto; height: auto; margin: 6px; flex-direction: row; align-items: center; gap: .75rem;
    padding: .45rem .75rem; border-radius: 12px; }
  .sidebar-cab { flex: none; }
  .menu-plegar, .nav-seccion { display: none; }
  .sidebar .logo { width: auto; height: 54px; margin: 0; flex: none; }
  .nav { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .15rem .25rem; }
  .nav a { margin: 0; min-height: 0; gap: .35rem; padding: .36rem .5rem; font-size: .86rem; white-space: nowrap; }
  .nav a svg { width: 15px; height: 15px; }
  .topbar { padding: .5rem .75rem; flex-wrap: wrap; gap: .35rem .75rem; }
  .content { padding: 1rem .75rem; }
  .panel { padding: 1rem; }
  .row > div { min-width: min(260px, 100%); }
  .filters > div { min-width: min(200px, 100%); }
  th, td { padding: .5rem .55rem; }
  /* Las celdas de acciones (dos botones) dejan de forzar una sola linea: los botones pasan a la linea siguiente en vez de ensanchar la tabla. */
  .table-scroll td[style*="white-space:nowrap"] { white-space: normal !important; }
  .kv { grid-template-columns: minmax(96px, 150px) 1fr; }
}

/* Movil (<= 560 px): campos en una sola columna, datos clave/valor apilados y menu en una sola fila que se desliza (con degradado que avisa de mas opciones). */
@media (max-width: 560px) {
  .sidebar .logo { height: 46px; }
  .nav { position: relative; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); padding-right: 1.5rem; }
  .nav::-webkit-scrollbar { display: none; }
  .content { padding: .75rem .6rem; }
  .panel { padding: .85rem; }
  .row > div, .filters > div { min-width: 100%; }
  .row > .fit { min-width: 0; }
  .kv { grid-template-columns: 1fr; gap: .05rem 0; }
  .kv dd { margin-bottom: .5rem; }
  h1 { font-size: 1.3rem; }
  .agent-bar select { width: 100%; }
  /* En celular ni el bloque de totales por si solo cabe al lado del titulo: aqui si conviene volver a
     apilarlos (titulo arriba, totales debajo a todo el ancho), como antes de "quote-head { nowrap }". */
  .quote-head { flex-wrap: wrap; }
  .quote-head .name { -webkit-line-clamp: unset; }
  .quote-head .quote-totals { align-items: flex-start; text-align: left; white-space: normal; }
}

/* ---------- Ventas: resumen compacto (solo /pipeline) ----------
   Pedido de Alexander: conservar el resumen (Agente, Mes y las 6 tarjetas) con menos altura y menos espacios internos para que la lista de expedientes muestre mas filas, comodo
   a zoom 100 %. Todo cuelga de `.sales-summary` (el panel del resumen de Ventas) y de `.sales-subtitle`: Inicio, Costeos y el resto de modulos conservan .kpi, .kpis, .panel
   y .agent-bar tal cual. Solo presentacion: cifras, filtros, enlaces, colores AXIS y tarjeta activa no cambian. Cada tarjeta: titulo arriba, cifra e importe en la misma linea y,
   si la hay, la nota debajo. De 1100 px hacia abajo (pantalla dividida) las tarjetas pasan a 3 columnas y la ayuda del filtro a su propia linea; en movil, 2 columnas. */
.subtitle.sales-subtitle { margin-bottom: .6rem; }
.panel.sales-summary { padding: .55rem .7rem .65rem; margin-bottom: .8rem; }
.sales-summary .agent-bar { gap: .3rem .6rem; padding: .3rem .75rem; margin-bottom: .5rem; border-left-width: 4px; border-radius: 10px; }
.sales-summary .agent-bar .title { font-size: .9rem; }
.sales-summary .agent-bar select { width: auto; min-width: 9rem; max-width: 22rem; padding: .28rem .55rem; font-size: .9rem; }
.sales-summary .agent-bar .hint { margin-left: auto; font-size: .78rem; line-height: 1.25; text-align: right; }
.sales-summary .kpis.kpis-compact { gap: .5rem; margin: 0; }
.sales-summary .kpis.kpis-compact .kpi { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: baseline; column-gap: .45rem; row-gap: 0;
  padding: .3rem .5rem .35rem; border-top-width: 4px; border-radius: 10px; }
.sales-summary .kpis.kpis-compact .kpi .label { flex: 0 0 100%; min-height: 0; display: block; font-size: .74rem; line-height: 1.2; }
.sales-summary .kpis.kpis-compact .kpi .count { margin: 0; font-size: 1.75rem; line-height: 1.1; }
.sales-summary .kpis.kpis-compact .kpi .amount { flex: 0 0 100%; min-height: 0; display: block; font-size: .82rem; line-height: 1.2; text-align: center; } /* debajo de la cifra, como en todas las tarjetas */
.sales-summary .kpis.kpis-compact .kpi .kpi-note { flex: 0 0 100%; margin: 0; font-size: .7rem; line-height: 1.2; }
@media (max-width: 1100px) {
  .sales-summary .kpis.kpis-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-summary .agent-bar select[name="agent"] { max-width: 15rem; }
  .sales-summary .agent-bar .hint { flex: 1 0 100%; margin-left: 0; text-align: left; }
}
@media (max-width: 560px) {
  .sales-summary .kpis.kpis-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Inicio en dos columnas (2026-10-25): la pagina de inicio usa todo el ancho; a la derecha el periodo y los expedientes del periodo (fijos al desplazarse),
   a la izquierda el resto de tarjetas. Por debajo de 1200 px, una sola columna con el orden de siempre. */
.content.content-ancho { max-width: 1480px; }
.home-grid { display: flex; flex-direction: column; }
@media (min-width: 1200px) {
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); column-gap: 1.25rem; align-items: start; }
  .home-lado { grid-column: 2; grid-row: 1; position: sticky; top: 1rem; }
  .home-principal { grid-column: 1; grid-row: 1; min-width: 0; }
  .home-lado .agent-bar { gap: .6rem .75rem; }
  .home-lado .agent-bar select { min-width: 0; flex: 1 1 120px; }
  .home-lado .kpis-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* dos columnas: las etiquetas no se parten a mitad de palabra */
}

/* Expediente en dos columnas (2026-10-25): a la derecha datos, estado y asesor; a la izquierda el registro (cotizaciones/servicios) y el resto, que suben.
   Menos de 1200 px: una columna con el orden de siempre. La columna derecha NO es fija: con el formulario de edicion abierto puede ser mas alta que la ventana. */
.case-grid { display: flex; flex-direction: column; }
@media (min-width: 1200px) {
  .case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); column-gap: 1.25rem; align-items: start; }
  .case-lado { grid-column: 2; grid-row: 1; min-width: 0; }
  .case-principal { grid-column: 1; grid-row: 1; min-width: 0; }
  .case-lado .kv { grid-template-columns: 130px minmax(0, 1fr); }
}

/* Listas en dos columnas (2026-10-25: Clientes, Pasajeros, Proveedores y Pagos a proveedores): al centro el buscador y la base;
   a la derecha el panel de crear (o el filtro de pagos). Sin panel lateral (sin permiso de crear), la base ocupa todo el ancho.
   Menos de 1200 px: una columna con el orden de siempre. */
.lista-grid { display: flex; flex-direction: column; }
@media (min-width: 1200px) {
  .lista-grid.con-lado { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); column-gap: 1.25rem; align-items: start; }
  .lista-grid.con-lado > .lista-lado { grid-column: 2; grid-row: 1; min-width: 0; }
  .lista-grid.con-lado > .lista-principal { grid-column: 1; grid-row: 1; min-width: 0; }
  .lista-lado .sp-filters .row > div { flex: 1 1 100%; }
}
.lista-lado .sp-filters select { min-width: 0; } /* el minimo de 16rem desbordaba el panel lateral y el movil */
.lista-lado-titulo { margin: 0 0 .75rem; font-size: 1.05rem; }
.lista-lado .filters { flex-direction: column; align-items: stretch; }
.lista-lado .filters > form { width: 100%; }
.lista-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .85rem;
             padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.lista-cab h2 { margin: 0; font-size: 1.1rem; }
.lista-conteo { padding: .15rem .65rem; border-radius: 999px; background: #EEF3F9; color: var(--navy); font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* Configuracion agrupada en desplegables (2026-10-25): cada grupo es una tarjeta con cabecera (titulo, detalle, numero de ajustes y flecha);
   dentro, los ajustes de siempre como subpaneles mas sobrios. */
.cfg-grupo { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; margin-bottom: .85rem;
             box-shadow: 0 1px 3px rgba(10, 46, 110, .05); }
.cfg-grupo[open] { border-left-color: var(--accent); }
.cfg-grupo > summary { display: flex; align-items: center; gap: .75rem 1rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; border-radius: 12px; }
.cfg-grupo > summary::-webkit-details-marker { display: none; }
.cfg-grupo > summary:hover { background: #F5F8FC; }
.cfg-grupo > summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.cfg-txt { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.cfg-titulo { font-size: 1.08rem; font-weight: 800; color: var(--navy); }
.cfg-detalle { font-size: .85rem; color: var(--text-soft); overflow-wrap: anywhere; }
.cfg-conteo { flex: none; padding: .15rem .65rem; border-radius: 999px; background: #EEF3F9; color: var(--navy); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.cfg-flecha { flex: none; width: .65rem; height: .65rem; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg);
              margin: 0 .3rem .25rem 0; transition: transform .15s ease; }
.cfg-grupo[open] > summary .cfg-flecha { transform: rotate(-135deg); margin-bottom: -.25rem; }
.cfg-grupo[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.cfg-cuerpo { padding: .9rem 1.1rem .2rem; background: #FAFBFD; border-radius: 0 0 12px 12px; }
.cfg-cuerpo > .panel { box-shadow: none; margin-bottom: .9rem; }
.cfg-cuerpo > .panel h2 { font-size: 1.02rem; }
@media (max-width: 560px) {
  .cfg-grupo > summary { flex-wrap: wrap; padding: .8rem .85rem; }
  .cfg-cuerpo { padding: .7rem .6rem .1rem; }
}
@media (max-width: 760px) { .cfg-cuerpo table.mini { display: block; max-width: 100%; overflow-x: auto; } } /* las tablas de personas se desplazan dentro del panel, no la pagina */

/* Nombres largos al crear (2026-10-25): el campo de nombre ocupa todo el ancho del panel y crece en alto con el texto (textarea.campo-nombre). */
.row > .campo-completo { flex: 1 1 100%; }
textarea.campo-nombre { display: block; width: 100%; min-height: 2.4rem; resize: none; overflow: hidden; line-height: 1.35; font: inherit; }
.lista-lado-nota { margin: .1rem 0 0; font-size: .8rem; line-height: 1.35; }
/* Boton «Documentos» de las bases de clientes y pasajeros: con clip, siempre visible en cada fila. */
.btn-docs { display: inline-flex; align-items: center; gap: .3rem; }
.btn-docs .icono-clip { flex: none; }

/* «Adjuntar documentos» al crear cliente o pasajero (2026-10-25): bloque claro dentro del panel, con boton visible para elegir archivos.
   El campo de archivo real queda oculto a la vista pero accesible; la etiqueta-boton lo abre y debajo se listan los archivos elegidos. */
.adjuntar-crear { margin: .2rem 0 .9rem; padding: .75rem .85rem .6rem; border: 1px dashed #B9C7D8; border-radius: 10px; background: #F5F8FC; }
.adjuntar-cab { display: flex; align-items: center; gap: .35rem; margin-bottom: .55rem; font-weight: 800; color: var(--navy); font-size: .95rem; }
.adjuntar-cab .muted { font-weight: 400; font-size: .8rem; }
.adjuntar-btn { display: inline-flex; align-items: center; gap: .35rem; margin: 0; cursor: pointer; }
.adjuntar-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.adjuntar-input:focus-visible + .adjuntar-elegidos, .adjuntar-btn:focus-within { outline: 3px solid var(--navy); outline-offset: 2px; }
.adjuntar-elegidos { margin: .4rem 0 0; font-size: .8rem; overflow-wrap: anywhere; }
.adjuntar-ayuda { margin: .35rem 0 0; font-size: .76rem; line-height: 1.35; }
.crear-btn { width: 100%; }