/* fluidez.css — adenda 3 (Inicio, Facturas por mes, hoja de pago, Pedidos, Resumen del mes) + iPhone de verdad
   + polish/harden. Va DESPUÉS de facturas.css. Solo tokens DMC / Superficies v2; Inter en todo.
   Contraste: el gris de apoyo pasa a #64748B (el mismo --dh-m del header DMC) para llegar a AA sobre blanco. */

:root {
  --ds-text-3: #64748B;
  --fx-safe-b: env(safe-area-inset-bottom, 0px);
  --fx-safe-t: env(safe-area-inset-top, 0px);
  --fx-vvh: 100dvh;
  --fx-kb: 0px;
}
::placeholder { color: #64748B; opacity: 1; }
::selection { background: rgba(27, 79, 138, .18); color: var(--ds-text); }
html { scroll-padding-top: 64px; }
body { min-height: 100vh; min-height: 100dvh; caret-color: var(--ds-blue); }
.fx-meta { color: var(--ds-text-3); }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { -webkit-tap-highlight-color: transparent; text-underline-offset: 3px; }
.fx-boot { min-height: 40vh; }

/* Notch / Dynamic Island en horizontal */
.dh-in { padding-left: max(var(--dh-pad, 24px), env(safe-area-inset-left)); padding-right: max(var(--dh-pad, 24px), env(safe-area-inset-right)); }
.dh { padding-top: 0; }

/* ── Botón principal flotante en el teléfono (al alcance del pulgar) ── */
@media (max-width: 768px) {
  .fx-head-r .fx-fab {
    position: fixed; z-index: 150; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + var(--fx-safe-b));
    min-height: 52px; padding: 0 22px; font-size: 15px; box-shadow: 0 14px 32px -12px rgba(15, 52, 96, .55);
    flex: none !important; width: auto;
  }
  .fx-head-r .fx-fab .ic { width: 18px; height: 18px; }
  html.fx-lock .fx-fab, html.dh-lock .fx-fab { visibility: hidden; }
  .fx-panel { padding-bottom: calc(112px + var(--fx-safe-b)); }
}

/* ── Toast con acción ("Deshacer") ── */
.fx-toast { display: flex; align-items: center; gap: 14px; bottom: calc(24px + var(--fx-safe-b)); }
.fx-toast.has-act { pointer-events: auto; padding: 8px 8px 8px 18px; }
.fx-toast-t { flex: 1; min-width: 0; }
.fx-toast-b { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--ds-r-pill); background: rgba(255, 255, 255, .16); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fx-toast-b:hover { background: rgba(255, 255, 255, .26); }
.fx-toast-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fx-toast-ok { background: var(--ds-navy); }
@media (max-width: 768px) { .fx-toast { bottom: calc(84px + var(--fx-safe-b)); width: calc(100% - 32px); max-width: none; } html.fx-lock .fx-toast { bottom: calc(16px + var(--fx-safe-b)); } }

/* ── Diálogos → hojas inferiores en el teléfono ── */
.fx-dialog-grab { display: none; }
.fx-dialog-hl { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-dialog-sub { font-size: 13px; color: var(--ds-text-3); overflow-wrap: anywhere; }
.fx-dialog-t { overflow-wrap: anywhere; }
.fx-dialog-b { display: flex; flex-direction: column; gap: 14px; }
.fx-dialog { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
@media (max-width: 768px) {
  .fx-dialog { bottom: var(--fx-kb); max-height: calc(var(--fx-vvh) - var(--fx-safe-t) - 12px); transition: transform .24s var(--ds-ease), opacity .18s var(--ds-ease), bottom .12s linear; }
  .fx-dialog-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: #CBD5E1; margin: 8px auto 0; flex-shrink: 0; }
  .fx-dialog-h { padding: 10px 12px 4px 20px; }
  .fx-dialog-b { padding: 8px 20px 8px; }
  .fx-dialog-f { padding: 12px 20px calc(14px + var(--fx-safe-b)); border-top: 1px solid var(--ds-line); background: #fff; border-radius: 0 0 0 0; }
  .fx-dialog-f .ds-btn, .fx-dialog-f .fx-btn-quiet { flex: 1 1 0; min-height: var(--ds-hit-mob); }
  .fx-dialog .fx-icon-btn { width: 44px; height: 44px; }
}

/* ── Campos: 16 px en el teléfono (evita el zoom de iOS), objetivos de 44 px ── */
@media (max-width: 768px), (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="month"], input[type="date"], input[type="password"], input[type="email"], input[type="time"], input:not([type]), select, textarea { font-size: 16px; min-height: 44px; }
  .ds-btn, .fx-btn-quiet, .fx-tab, .fx-toggle, .fx-seg-b, .fx-rel-it { min-height: var(--ds-hit-mob); }
  .fx-icon-btn { width: 44px; height: 44px; }
  .fx-icon-sm { width: 40px; height: 40px; }
  .fx-check input { width: 22px; height: 22px; }
  .fx-check { min-height: 44px; align-items: center; }
  .fx-details > summary { min-height: 44px; }
  .fx-kbd-hint { display: none; }
}
input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* ── Selector de archivos (Cámara / Fotos / Archivos) ── */
.fx-pick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fx-pick-l { font-size: 13px; font-weight: 600; color: var(--ds-text); }
.fx-pick-h { font-size: 12.5px; color: var(--ds-text-3); margin-top: -4px; }
.fx-pick-bs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; }
.fx-pick-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 6px; border: 1px solid var(--ds-line-2); border-radius: 18px; background: #fff; color: var(--ds-navy); font-size: 14px; font-weight: 600; cursor: pointer; }
.fx-pick-b .ic { width: 24px; height: 24px; }
.fx-pick-b:active { background: var(--ds-panel); }
.fx-pick-b:focus-visible, .fx-pick-drop:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-pick-drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; width: 100%; padding: 22px 18px; border: 2px dashed var(--ds-line-2); border-radius: 20px; background: var(--ds-page); cursor: pointer; font: inherit; color: inherit; }
.fx-pick-drop:hover, .fx-pick-drop.is-over { border-color: var(--ds-blue); background: #EEF4FB; }
.fx-pick-list { display: flex; flex-direction: column; gap: 8px; }
.fx-pick-it { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: 16px; border: 1px solid var(--ds-line-2); background: #fff; min-width: 0; }
.fx-pick-thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--ds-panel); display: flex; align-items: center; justify-content: center; color: var(--ds-navy); }
.fx-pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-pick-thumb.is-doc { flex-direction: column; gap: 1px; background: var(--fx-tint); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.fx-pick-thumb .ic { width: 20px; height: 20px; }
.fx-pick-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-pick-nm { font-size: 13.5px; font-weight: 500; color: var(--ds-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pick-s { font-size: 12px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-pick-err { font-size: 12.5px; color: #991B1B; }
.fx-pick.is-off { opacity: .65; }

/* Progreso de subida */
.fx-prog { display: flex; flex-direction: column; gap: 6px; }
.fx-prog-bar { display: block; height: 8px; border-radius: var(--ds-r-pill); background: var(--ds-panel); overflow: hidden; }
.fx-prog-v { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ds-blue); transition: width .2s var(--ds-ease); }
.fx-prog-t { font-size: 12.5px; color: var(--ds-text-2); font-variant-numeric: tabular-nums; }
.fx-prog.is-err .fx-prog-v { background: var(--ds-err); }
.fx-prog.is-err .fx-prog-t { color: #991B1B; }

/* ── Hoja de pago ── */
.fx-pg-sum { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--ds-page); }
.fx-pg-who { min-width: 0; }
.fx-pg-n { font-size: 15px; font-weight: 600; color: var(--ds-text); overflow-wrap: anywhere; line-height: 1.3; }
.fx-pg-d { font-size: 12.5px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-pg-amt { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; }
.fx-pg-amt span { font-size: 12px; color: var(--ds-text-3); }
.fx-pg-amt b { font-size: 22px; font-weight: 600; color: var(--ds-navy); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.fx-addnota { align-self: flex-start; padding-left: 4px; }
.fx-addnota .ic { width: 16px; height: 16px; }
@media (max-width: 420px) { .fx-pg-sum { flex-direction: column; align-items: flex-start; } .fx-pg-amt { text-align: left; } .fx-pg-campos { grid-template-columns: minmax(0, 1fr); } }

/* ── Fichas de mes ── */
.fx-meses { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.fx-meses::-webkit-scrollbar { display: none; }
.fx-meses:empty { display: none; }
.fx-mesf { flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 48px; min-width: 76px; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--ds-line-2); background: #fff; color: var(--ds-text-2); cursor: pointer; scroll-snap-align: start; text-align: left; }
.fx-mesf:hover { border-color: rgba(15, 35, 96, .3); }
.fx-mesf-t { font-size: 13px; font-weight: 600; color: var(--ds-text); white-space: nowrap; }
.fx-mesf-n { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-mesf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-blue); }
.fx-mesf[aria-pressed="true"] { background: var(--ds-navy); border-color: var(--ds-navy); }
.fx-mesf[aria-pressed="true"] .fx-mesf-t { color: #fff; }
.fx-mesf[aria-pressed="true"] .fx-mesf-n { color: rgba(255, 255, 255, .8); }
.fx-mesf[aria-pressed="true"] .fx-mesf-dot { background: #fff; }

/* ── Lista agrupada por mes ── */
.fx-mes-h th { white-space: normal; padding: 18px 14px 10px; background: var(--ds-page); text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--ds-line); }
.fx-mes-g:first-of-type .fx-mes-h th { border-radius: 0; }
.fx-mes-hb { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.fx-mes-t { font-size: 15px; font-weight: 600; color: var(--ds-text); letter-spacing: -.01em; }
.fx-mes-n { font-size: 12.5px; font-weight: 500; color: var(--ds-text-3); }
.fx-mes-tot { font-size: 12.5px; font-weight: 500; color: var(--ds-text-2); font-variant-numeric: tabular-nums; margin-left: auto; }
.fx-mes-g.is-urg .fx-mes-t { color: #991B1B; }
.fx-table thead + .fx-mes-g .fx-mes-h th { border-top: 0; }
@media (max-width: 1280px) {
  .fx-mes-g { display: block; }
  .fx-mes-h { display: block; }
  .fx-mes-h th { display: block; padding: 14px 4px 8px; background: transparent; border: 0; }
  .fx-mes-g + .fx-mes-g .fx-mes-h th { padding-top: 22px; }
}
@media (max-width: 768px) { .fx-mes-tot { margin-left: 0; flex-basis: 100%; } }

/* Textos y montos largos no rompen las tarjetas */
.fx-td-total { white-space: nowrap; }
@media (max-width: 1280px) {
  .fx-tr { align-items: flex-start; }
  .fx-td-who { flex: 1 1 200px; }
  .fx-rowlink { overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fx-meta { flex-wrap: wrap; row-gap: 2px; }
  .fx-td-total { margin-left: auto; text-align: right; }
}
@media (max-width: 420px) { .fx-td-total { flex: 1 1 100%; text-align: left; margin-left: 0; order: 3 !important; font-size: 16px; } .fx-td-num { order: 2 !important; } }
.fx-dr-amt-n { overflow-wrap: anywhere; }

/* ── Filtros en el teléfono: búsqueda + "Filtros" plegable ── */
.fx-fmas { display: contents; }
.fx-ftog { display: none; }
.fx-filters .fx-field-q { order: 9; }
@media (max-width: 768px) {
  .fx-filters { gap: 10px; }
  .fx-filters .fx-field-q { order: 0; flex: 1 1 0; min-width: 0; }
  .fx-filters .fx-field-q .fx-field-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fx-ftog { display: inline-flex; align-items: center; gap: 8px; order: 1; min-height: 44px; padding: 0 16px; border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line-2); background: #fff; color: var(--ds-navy); font-size: 14px; font-weight: 600; cursor: pointer; align-self: flex-end; }
  .fx-ftog[aria-expanded="true"] { background: var(--ds-navy); color: #fff; border-color: var(--ds-navy); }
  .fx-ftog[aria-expanded="true"] .fx-tab-n { background: rgba(255, 255, 255, .2); color: #fff; }
  .fx-fmas { display: none; order: 2; width: 100%; flex-wrap: wrap; gap: 10px; padding: 14px; border-radius: 20px; background: var(--ds-card); border: 1px solid var(--ds-line); }
  .fx-filters.is-open .fx-fmas { display: flex; }
  .fx-fmas .fx-field { width: calc(50% - 5px); }
  .fx-fmas .fx-seg-f { width: 100%; margin: 0; }
}

/* ── Detalle: pantalla completa en el teléfono, Atrás y pie con la acción principal ── */
.fx-dr-back { display: none; }
.fx-dr-foot { flex-shrink: 0; display: flex; gap: 10px; padding: 12px 28px 14px; border-top: 1px solid var(--ds-line); background: #fff; border-radius: 0 0 0 24px; }
.fx-dr-foot .ds-btn { min-height: 44px; padding: 0 22px; }
.fx-drawer { height: 100vh; height: 100dvh; }
@media (max-width: 768px) {
  .fx-drawer { top: 0; bottom: auto; height: 100vh; height: 100dvh; padding-top: var(--fx-safe-t); transform: translateX(32px); }
  .fx-dr-bar { gap: 6px; padding: 6px 8px 6px 4px; min-height: 56px; }
  .fx-dr-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 12px 0 4px; border: 0; background: none; color: var(--ds-blue); font-size: 16px; font-weight: 500; cursor: pointer; border-radius: 12px; flex-shrink: 0; }
  .fx-dr-back .ic { width: 24px; height: 24px; }
  .fx-dr-t { flex: 1; text-align: center; font-size: 14px; }
  #dr-x, .fx-pd-drawer .fx-dr-nav .fx-icon-btn { display: none; }
  .fx-dr-pos { display: none; }
  .fx-dr-foot { padding: 10px 16px calc(10px + var(--fx-safe-b)); border-radius: 0; }
  .fx-dr-foot .ds-btn { flex: 1 1 0; min-height: 50px; font-size: 15px; }
  .fx-dr-b { padding-bottom: 32px; }
  .fx-compose-f { position: static; }
}
.fx-pdf-card { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--ds-line-2); background: #fff; text-decoration: none; color: var(--ds-text); }
.fx-pdf-card:active { background: var(--ds-page); }
.fx-pdf-card-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--fx-tint); color: var(--ds-navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-pdf-card-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-pdf-card-b strong { font-size: 15px; font-weight: 600; color: var(--ds-navy); }
.fx-pdf-card-b span { font-size: 12.5px; color: var(--ds-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pdf-card > .ic { color: var(--ds-text-3); width: 20px; height: 20px; flex-shrink: 0; }
/* Visor de imagen/PDF a pantalla completa y con zoom de dos dedos en el teléfono */
@media (max-width: 768px) {
  .fx-visor { top: 0; bottom: 0; max-height: none; height: 100dvh; border-radius: 0; padding-top: var(--fx-safe-t); }
  .fx-visor .fx-dialog-grab { display: none; }
  .fx-visor-b { padding: 4px 8px; }
  .fx-visor-media { min-height: 100%; touch-action: pinch-zoom pan-x pan-y; }
  .fx-visor-media img { max-height: none; width: 100%; }
}

/* ── Resumen del mes ── */
.fx-rm-w { margin: 0 0 16px; }
.fx-rm { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); }
.fx-rm-h { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; min-height: 56px; cursor: pointer; border-radius: var(--ds-r-card); }
.fx-rm-h::-webkit-details-marker { display: none; }
.fx-rm-h:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-rm-ht { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fx-rm-t { font-size: 16px; font-weight: 600; color: var(--ds-text); letter-spacing: -.01em; }
.fx-rm-tog { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ds-text-3); flex-shrink: 0; transition: transform .2s var(--ds-ease); }
.fx-rm-tog .ic { width: 18px; height: 18px; }
.fx-rm[open] .fx-rm-tog { transform: rotate(180deg); }
.fx-rm-b { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.fx-rm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fx-rm-box { padding: 14px 16px; border-radius: 18px; background: var(--ds-page); min-width: 0; }
.fx-rm-bh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fx-rm-bt { font-size: 12.5px; font-weight: 600; color: var(--ds-text-2); }
.fx-rm-bt2 { margin-top: 12px; }
.fx-rm-bn { font-size: 12px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-rm-total { font-size: 24px; font-weight: 600; color: var(--ds-navy); letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin: 4px 0 8px; overflow-wrap: anywhere; line-height: 1.15; }
.fx-rm-dl { display: flex; flex-direction: column; gap: 4px; }
.fx-rm-dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.fx-rm-dl dt { color: var(--ds-text-3); }
.fx-rm-dl dd { color: var(--ds-text); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.fx-rm-sub { font-size: 12px; color: var(--ds-text-3); margin-top: 8px; }
.fx-rm-sec { display: flex; flex-direction: column; gap: 8px; }
.fx-rm-pend { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-rm-pl { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px 0 14px; border-radius: var(--ds-r-pill); border: 1px solid #FDE68A; background: #FFFBEB; color: #92400E; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; }
.fx-rm-pl .ic { width: 16px; height: 16px; }
.fx-rm-pl.is-static { cursor: default; padding-right: 14px; }
.fx-rm-ok { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #15803D; }
.fx-rm-ok .ic { width: 18px; height: 18px; }
.fx-rm-catw { overflow-x: auto; border: 1px solid var(--ds-line); border-radius: 16px; }
.fx-rm-cat { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-rm-cat th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ds-text-3); text-align: left; padding: 10px 12px; background: var(--ds-page); }
.fx-rm-cat td { padding: 10px 12px; border-top: 1px solid var(--ds-line); color: var(--ds-text); vertical-align: top; }
.fx-rm-cat td small { display: block; font-size: 11.5px; color: var(--ds-text-3); }
.fx-rm-cn { overflow-wrap: anywhere; }
.fx-rm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--ds-line); }
.fx-rm-nota { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ds-text-2); flex: 1 1 320px; line-height: 1.45; }
.fx-rm-nota .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--ds-blue); }
.fx-rm-exp { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) { .fx-rm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .fx-rm-box-s { grid-column: 1 / -1; } }
@media (max-width: 768px) {
  .fx-rm-h { padding: 14px 16px; }
  .fx-rm-b { padding: 0 14px 16px; }
  .fx-rm-grid { grid-template-columns: minmax(0, 1fr); }
  .fx-rm-exp { width: 100%; } .fx-rm-exp .ds-btn { flex: 1 1 0; min-height: var(--ds-hit-mob); }
}

/* ── Inicio ── */
.fx-in-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }
.fx-in-grid > .fx-in-tiles, .fx-in-grid > .fx-in-rm { grid-column: 1 / -1; }
.fx-in-card { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); padding: 18px 20px 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.fx-in-card.is-hi { border-color: rgba(15, 52, 96, .22); }
.fx-in-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fx-in-hl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-in-ic { width: 40px; height: 40px; border-radius: 14px; background: var(--fx-tint); color: var(--ds-navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-in-ic .ic { width: 20px; height: 20px; }
.fx-in-card.is-urg .fx-in-ic { background: #FEF2F2; color: #B91C1C; }
.fx-in-t { font-size: 17px; font-weight: 600; color: var(--ds-text); letter-spacing: -.01em; }
.fx-in-n { min-width: 36px; height: 32px; padding: 0 10px; border-radius: var(--ds-r-pill); background: var(--ds-navy); color: #fff; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fx-in-card.is-urg .fx-in-n { background: #B91C1C; }
.fx-in-sub { font-size: 13px; color: var(--ds-text-2); }
.fx-in-l { display: flex; flex-direction: column; }
.fx-in-it { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--ds-line); min-width: 0; }
.fx-in-itb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-in-itt { font-size: 14.5px; font-weight: 600; color: var(--ds-text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
.fx-in-itt:hover { color: var(--ds-blue); text-decoration: underline; }
.fx-in-itd { font-size: 12.5px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-in-q { font-size: 13px; color: var(--ds-text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin-top: 2px; }
.fx-in-q strong { font-weight: 600; color: var(--ds-text); }
.fx-in-q.is-urg { color: #991B1B; }
.fx-in-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fx-in-ita { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.fx-in-amt { font-size: 15px; font-weight: 600; color: var(--ds-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-in-it:hover .ds-btn-secondary, .fx-in-it:focus-within .ds-btn-secondary { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; }
.fx-in-ver { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--ds-blue); text-decoration: none; border-radius: 10px; }
.fx-in-ver:hover { text-decoration: underline; }
.fx-in-ver .ic { width: 16px; height: 16px; }
.fx-in-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fx-in-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-height: 112px; border-radius: var(--ds-r-card); background: var(--ds-card); border: 1px solid var(--ds-line); text-decoration: none; color: inherit; min-width: 0; transition: box-shadow .2s; }
.fx-in-tile:hover { box-shadow: var(--ds-shadow-hover); }
.fx-in-tile-l { font-size: 13px; font-weight: 500; color: var(--ds-text-2); }
.fx-in-tile-n { font-size: 32px; }
.fx-in-tile-s { font-size: 12px; color: var(--ds-text-3); overflow-wrap: anywhere; }
.fx-in-tile.is-zero .fx-in-tile-n { color: var(--ds-text-3); }
.fx-in-tile.is-alert .fx-in-tile-n { color: #92400E; }
.fx-in-ok { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); margin-bottom: 14px; }
.fx-in-ok-ic { width: 64px; height: 64px; border-radius: 22px; background: #DCFCE7; color: #15803D; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.fx-in-ok-ic .ic { width: 30px; height: 30px; stroke-width: 2.4; }
.fx-in-ok-t { font-size: 26px; font-weight: 600; color: var(--ds-text); letter-spacing: -.015em; }
.fx-in-ok-d { font-size: 14px; color: var(--ds-text-2); max-width: 420px; }
.fx-in-ok-l { font-size: 13px; color: var(--ds-text-3); }
.fx-in-rm { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 16px 20px; background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); }
.fx-in-rm .fx-in-t { font-size: 15px; }
.fx-in-rm-l { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-in-rm-a { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 16px; border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line-2); background: #fff; color: var(--ds-navy); font-size: 13px; font-weight: 600; text-decoration: none; }
.fx-in-rm-a:hover { background: var(--ds-panel); }
.fx-in-rm-a .ic { width: 16px; height: 16px; }
@media (max-width: 1100px) { .fx-in-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .fx-in-card { padding: 16px 16px 10px; }
  .fx-in-it { flex-wrap: wrap; gap: 8px 12px; }
  .fx-in-ita { width: 100%; justify-content: space-between; }
  .fx-in-ita { flex-wrap: wrap; row-gap: 8px; }
  .fx-in-ita .ds-btn { flex: 1 1 150px; min-width: 0; max-width: 260px; min-height: var(--ds-hit-mob); margin-left: auto; }
  .fx-in-tiles { gap: 10px; }
  .fx-in-tile { min-height: 100px; padding: 14px; }
  .fx-in-tile-n { font-size: 28px; }
  .fx-in-ok { padding: 36px 18px; }
  .fx-in-rm-l, .fx-in-rm-a { width: 100%; } .fx-in-rm-a { justify-content: space-between; min-height: 44px; }
  .fx-head-r#in-acts > .ds-btn:not(.fx-fab) { flex: 1 1 100%; }
}

/* ── Pedidos ── */
.fx-pd-mes { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 600; color: var(--ds-text); margin: 20px 4px 10px; letter-spacing: -.01em; }
.fx-pd-mes:first-child { margin-top: 4px; }
.fx-pd-l { display: flex; flex-direction: column; gap: 10px; }
.fx-pd-it { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px 14px 20px; border-radius: var(--ds-r-row); border: 1px solid var(--ds-line); background: var(--ds-card); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: box-shadow .2s; }
.fx-pd-it:hover { box-shadow: var(--ds-shadow-hover); }
.fx-pd-it:hover .fx-pd-itt { color: var(--ds-blue); }
.fx-pd-it.is-off .fx-pd-itt { color: var(--ds-text-2); font-weight: 500; }
.fx-pd-itb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-pd-itt { font-size: 14.5px; font-weight: 600; color: var(--ds-text); overflow-wrap: anywhere; line-height: 1.3; }
.fx-pd-itd { font-size: 13px; color: var(--ds-text-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fx-pd-itm { font-size: 12px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-pd-its { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; max-width: 46%; }
.fx-pd-chev { color: var(--ds-text-3); flex-shrink: 0; display: flex; }
.fx-pd-chev .ic { width: 18px; height: 18px; }
.fx-pd-head { display: flex; flex-direction: column; gap: 4px; }
.fx-pd-k { font-size: 12.5px; color: var(--ds-text-3); }
.fx-pd-det { margin-top: 14px; font-size: 14px; color: var(--ds-text-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.fx-pd-fac { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 0 12px 0 14px; border-radius: 14px; border: 1px solid var(--ds-line-2); color: var(--ds-navy); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.fx-pd-fac .ic { width: 16px; height: 16px; }
.fx-pd-files { display: flex; flex-direction: column; gap: 8px; }
.fx-pd-file { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 8px; border-radius: 16px; border: 1px solid var(--ds-line-2); background: #fff; text-decoration: none; color: inherit; }
.fx-pd-file:hover { background: var(--ds-page); }
.fx-pd-file-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--fx-tint); color: var(--ds-navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-pd-file-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-pd-file-n { font-size: 13.5px; font-weight: 500; color: var(--ds-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pd-file-s { font-size: 12px; color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.fx-pd-file-a { font-size: 13px; font-weight: 600; color: var(--ds-blue); flex-shrink: 0; }
.fx-pd-drawer .fx-compose { display: flex; flex-direction: column; gap: 10px; }
.fx-plant { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.fx-plant-b { min-height: 40px; padding: 0 14px; border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line-2); background: #fff; color: var(--ds-text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.fx-plant-b:hover { color: var(--ds-navy); border-color: rgba(15, 35, 96, .3); }
.fx-plant-b[aria-pressed="true"] { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; font-weight: 600; }
@media (max-width: 768px) {
  .fx-pd-it { flex-wrap: wrap; gap: 8px 10px; padding: 14px 14px 14px 16px; }
  .fx-pd-itb { flex: 1 1 calc(100% - 30px); }
  .fx-pd-its { max-width: none; justify-content: flex-start; order: 3; flex-basis: 100%; }
  .fx-plant-b { min-height: 44px; }
}

/* ── Sin hover (táctil): lo que en escritorio aparece al pasar el ratón, aquí ya se ve ── */
@media (hover: none) {
  .fx-cand .ds-btn-secondary, .fx-in-it .ds-btn-secondary { background: #fff; color: var(--ds-navy); border-color: var(--ds-line-2); }
  .fx-tr:hover, .fx-pd-it:hover, .fx-in-tile:hover, .fx-kpi:hover { box-shadow: none; }
  .fx-tr:active, .fx-pd-it:active { background: var(--ds-page); }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .fx-prog-v, .fx-rm-tog, .fx-in-tile, .fx-pd-it, .fx-dialog, .fx-toast { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Tabla de escritorio: las fichas de estado y categoría pueden partirse en dos líneas para no desbordar */
@media (min-width: 1281px) {
  .fx-td-est .fx-chip { white-space: normal; max-width: 128px; }
  .fx-td-cat { white-space: normal; }
  .fx-td-cat .fx-cat { max-width: 168px; }
  .fx-table th, .fx-table td { padding-left: 12px; padding-right: 12px; }
}
/* 1281–1600 px con "Todas": no cabe la categoría junto a la razón social y el número; aparece al elegir una razón social */
@media (min-width: 1281px) and (max-width: 1600px) {
  .fx-table:not(.fx-table-1ent) thead .fx-th-cat, .fx-table:not(.fx-table-1ent) .fx-td-cat { display: none; }
}

/* ══ Ronda 6 (crítica Andy + Cecorp) ═══════════════════════════════════════════════════════════════ */

/* ── Barra inferior del teléfono: la acción principal sin tapar la lista ── */
.fx-bbar { display: none; }
@media (max-width: 768px) {
  .fx-head-r .fx-fab { display: none !important; }
  .fx-bbar { display: flex; gap: 10px; position: fixed; z-index: 140; left: 0; right: 0; bottom: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + var(--fx-safe-b)) max(16px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--ds-line); }
  .fx-bbar .ds-btn { flex: 1 1 0; min-height: 50px; font-size: 15px; }
  html.fx-lock .fx-bbar, html.dh-lock .fx-bbar { visibility: hidden; }
  body.has-bbar .fx-panel { padding-bottom: calc(96px + var(--fx-safe-b)); }
  body.has-bbar .fx-toast { bottom: calc(86px + var(--fx-safe-b)); }
  body.has-bbar.fx-lock .fx-toast, html.fx-lock body.has-bbar .fx-toast { bottom: calc(16px + var(--fx-safe-b)); }
}

/* ── Inicio DMC: "Hoy", plegados de cobrar/pagar, lo último que marcaste ── */
.fx-in-grid-dmc { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.fx-in-hoy .fx-in-it:first-child { border-top: 0; padding-top: 4px; }
.fx-hoy-it.is-urg .fx-in-itt { color: #991B1B; }
.fx-hoy-u { padding: 1px 8px; font-size: 11px; margin-right: 6px; vertical-align: 1px; }
.fx-hoy-u::before { display: none; }
.fx-in-fold { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); min-width: 0; }
.fx-in-fold-h { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; min-height: 64px; cursor: pointer; border-radius: var(--ds-r-card); }
.fx-in-fold-h::-webkit-details-marker { display: none; }
.fx-in-fold-h:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-in-fold-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-in-fold-k { font-size: 16px; font-weight: 600; color: var(--ds-text); letter-spacing: -.01em; }
.fx-in-fold-s { font-size: 12.5px; color: var(--ds-text-3); }
.fx-in-fold-m { font-size: 18px; font-weight: 600; color: var(--ds-navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-in-fold[open] .fx-rm-tog { transform: rotate(180deg); }
.fx-in-fold-b { padding: 0 18px 12px; display: flex; flex-direction: column; gap: 8px; }
.fx-in-line { display: flex; align-items: center; gap: 12px; padding: 14px 18px; min-height: 56px; border-radius: var(--ds-r-row); border: 1px dashed #FDE68A; background: #FFFBEB; color: #92400E; text-decoration: none; }
.fx-in-line-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.fx-in-line-t strong { font-size: 14px; font-weight: 600; }
.fx-in-line .ic { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Inicio Cecorp: "Desde tu última visita" ── */
.fx-nov { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--ds-r-card); background: #EEF4FB; grid-column: 1 / -1; }
.fx-nov-t { font-size: 14px; font-weight: 600; color: var(--ds-navy); }
.fx-nov-d { font-weight: 500; color: var(--ds-text-2); }
.fx-nov-l { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-nov-a { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 8px 0 14px; border-radius: var(--ds-r-pill); background: #fff; border: 1px solid rgba(27, 79, 138, .18); color: var(--ds-navy); font-size: 13px; text-decoration: none; }
.fx-nov-a b { font-weight: 700; font-variant-numeric: tabular-nums; }
.fx-nov-a:hover { border-color: var(--ds-navy); }
.fx-nov-a:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-nov-a .ic { width: 15px; height: 15px; margin-left: 2px; }
.fx-nov-0 { font-size: 13px; color: var(--ds-text-2); }
@media (max-width: 768px) { .fx-nov-a { min-height: 44px; } }

/* ── Facturas: KPIs plegados en el teléfono + línea de ámbito ── */
.fx-kpitog { display: none; }
.fx-ambito { font-size: 12px; color: var(--ds-text-3); margin: -12px 0 10px; }
@media (max-width: 768px) {
  .fx-kpitog { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px 8px 16px; margin-bottom: 10px; border-radius: var(--ds-r-row); border: 1px solid var(--ds-line); background: var(--ds-card); text-align: left; cursor: pointer; font: inherit; color: inherit; }
  .fx-kpitog-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .fx-kpitog-t { font-size: 13px; font-weight: 600; color: var(--ds-text); }
  .fx-kpitog-s { font-size: 12.5px; color: var(--ds-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fx-kpitog[aria-expanded="true"] .fx-rm-tog { transform: rotate(180deg); }
  .fx-kpis { display: none; }
  .fx-kpis.is-open { display: grid; }
  .fx-ambito { margin: 0 2px 8px; }
  .fx-head-l .fx-lect { display: none; }
}

/* Categorías plegadas con una línea de resumen */
.fx-cats { padding: 0; gap: 0; }
.fx-cats-d > summary { list-style: none; }
.fx-cats-d > summary::-webkit-details-marker { display: none; }
.fx-cats-sum { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; min-height: 52px; cursor: pointer; border-radius: var(--ds-r-card); }
.fx-cats-sum:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-cats-sum-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fx-cats-sum-s { font-size: 12.5px; color: var(--ds-text-2); }
.fx-cats-d[open] > .fx-cats-sum .fx-rm-tog { transform: rotate(180deg); }
.fx-cats-in { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.fx-cats-in > .fx-cats-h { justify-content: flex-end; margin-top: -4px; }
.fx-rm-line { font-size: 12.5px; color: var(--ds-text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 768px) { .fx-rm-line { flex-basis: 100%; } }

/* ── Tabla: número visible, selección, cursor de teclado, menú de la fila, RUC que no pisa la razón social ── */
.fx-td-who .fx-meta { min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.fx-meta > * { flex-shrink: 0; }
.fx-meta .fx-ruc { white-space: nowrap; }
.fx-td-num .fx-doc { display: block; font-size: 11px; color: var(--ds-text-3); }
.fx-td-num .fx-nro { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ds-text-2); white-space: nowrap; }
.fx-td-sel, .fx-th-sel { width: 36px; padding-right: 0 !important; }
.fx-td-sel input, .fx-th-sel input { width: 18px; height: 18px; accent-color: var(--ds-navy); cursor: pointer; }
.fx-td-menu { width: 44px; padding-left: 0 !important; }
.fx-row-menu { border-color: transparent; background: transparent; color: var(--ds-text-3); }
.fx-row-menu:hover, .fx-row-menu:focus-visible { border-color: var(--ds-line-2); background: #fff; color: var(--ds-navy); }
.fx-tr.is-sel { background: #F1F6FC; }
.fx-tr.is-cursor { box-shadow: inset 0 0 0 2px var(--ds-blue); }
.fx-cat { max-width: 100%; }
.fx-td-cat .fx-cat { flex-wrap: wrap; row-gap: 0; }
.fx-cat-n { min-width: 0; overflow-wrap: anywhere; }
.fx-nc { display: block; margin-top: 3px; font-size: 11.5px; color: #92400E; line-height: 1.35; overflow-wrap: anywhere; }
.fx-nc strong { font-weight: 600; }
.fx-nc-a { color: var(--ds-text-2); }
.fx-tr.is-nc { background: #FFFDF5; }
.fx-falta { display: none; }
.fx-list-tools { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.fx-keys-b { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; min-height: 32px; }
.fx-keys-b .ic { width: 16px; height: 16px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--ds-line-2); border-bottom-width: 2px; background: #fff; font: 600 11.5px/1 Inter, system-ui, sans-serif; color: var(--ds-text); }
.fx-keys { display: flex; flex-direction: column; gap: 10px; }
.fx-keys > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 13.5px; }
.fx-keys dd { color: var(--ds-text-2); }
@media (hover: none), (max-width: 1280px) { .fx-list-tools { display: none; } }
@media (min-width: 1281px) and (max-width: 1600px) {
  .fx-table th, .fx-table td { padding-left: 10px; padding-right: 10px; }
  .fx-td-pago .fx-chip, .fx-td-est .fx-chip { white-space: normal; max-width: 118px; }
}
/* Barra de selección (escritorio) */
.fx-selbar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px 10px 18px; border-radius: var(--ds-r-pill); background: var(--ds-navy); color: #fff; box-shadow: 0 14px 32px -14px rgba(15, 52, 96, .6); }
.fx-sel-n { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-sel-sp { flex: 1; }
.fx-selbar .fx-check { min-height: 0; }
.fx-selbar .fx-check-t span { color: rgba(255, 255, 255, .9); font-size: 12.5px; }
.fx-selbar .fx-btn-quiet { color: #fff; }
.fx-selbar .fx-btn-quiet:hover { background: rgba(255, 255, 255, .12); }
.fx-selbar .ds-btn-primary { background: #fff; color: var(--ds-navy); border-color: #fff; }
.fx-selbar .ds-btn-primary:disabled { opacity: .55; }
.fx-selbar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fx-sel-res { margin-top: 12px; padding: 14px 16px; border-radius: var(--ds-r-row); background: var(--ds-card); border: 1px solid var(--ds-line); display: flex; flex-direction: column; gap: 8px; }
.fx-sel-res-t { font-size: 14px; color: var(--ds-text); }
.fx-sel-res-l { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ds-text-2); }
.fx-sel-res-l li { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-sel-res-w { font-weight: 600; color: var(--ds-text); }
.fx-sel-res .fx-btn-quiet { align-self: flex-start; }

/* Lista en el teléfono: tarjeta compacta (quién, monto, fecha y UN chip con lo que falta) */
@media (max-width: 768px) {
  .fx-tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who total" "info menu"; gap: 2px 10px; padding: 12px 6px 10px 14px; align-items: center; }
  .fx-td-who { grid-area: who; }
  .fx-td-total { grid-area: total; align-self: start; text-align: right !important; font-size: 15px !important; margin: 0 !important; padding-right: 8px !important; }
  .fx-td-fecha { grid-area: info; margin: 0 !important; display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
  .fx-td-menu { grid-area: menu; width: auto; justify-self: end; }
  .fx-td-num, .fx-td-ent, .fx-td-cat, .fx-td-est, .fx-td-pago, .fx-td-com, .fx-td-sel, .fx-td-who .fx-meta, .fx-td-who .fx-nc { display: none !important; }
  .fx-rowlink { min-height: 0; font-size: 15px; -webkit-line-clamp: 1; }
  .fx-falta { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--ds-r-pill); background: var(--fx-tint); color: var(--ds-navy); font-size: 12px; font-weight: 600; line-height: 1.3; }
  .fx-falta-responder, .fx-falta-razon_social, .fx-falta-elegir_entidad, .fx-falta-no_contabilizable { background: #FFFBEB; color: #92400E; }
  .fx-row-menu { width: 44px !important; height: 44px !important; }
  .fx-tr.is-urg .fx-rowlink { color: #991B1B; }
  .fx-mes-h th { padding-top: 10px; }
}

/* Menú de la fila (hoja) */
.fx-menu-rows { display: flex; flex-direction: column; gap: 6px; }
.fx-menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--ds-line-2); background: #fff; color: var(--ds-navy); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.fx-menu-row:hover { background: var(--ds-page); }
.fx-menu-row:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-menu-row .ic { width: 20px; height: 20px; }
.fx-menu-row[hidden] { display: none; }

/* Exportar: aviso "Faltan N cosas para cerrar el mes" */
.fx-menu-warn { display: flex; gap: 10px; align-items: flex-start; margin: 2px 2px 6px; padding: 10px 12px; border-radius: 12px; background: #FFFBEB; color: #92400E; font-size: 12.5px; line-height: 1.4; }
.fx-menu-warn .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.fx-menu-warn strong { display: block; font-weight: 600; }
.fx-menu-warn small { display: block; font-size: 12px; color: #A16207; }
.fx-menu-warn.is-ok { background: #F0FDF4; color: #15803D; }
.fx-menu-warn[hidden] { display: none; }

/* No contabilizable en el detalle y en la confirmación */
.fx-nc-l { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.fx-nc-l li { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.fx-nc-l strong { font-weight: 600; color: var(--ds-text); }
.fx-nc-l .fx-nc-a, .fx-nc-l li > span + span { color: var(--ds-text-2); font-size: 12.5px; }
.fx-nc-box { margin-top: 14px; }

/* Pago detectado: la prueba (miniatura o movimiento) junto al botón Confirmar */
.fx-pago-prueba { display: flex; flex-direction: column; gap: 10px; }
.fx-pago-prueba.is-det { padding: 12px; border-radius: 18px; background: #FFFBEB; border: 1px solid #FDE68A; margin-bottom: 12px; }
.fx-pago-prueba.is-det .fx-pago-acts { margin-top: 0; }

/* Enviar documento: "¿Es para alguno de estos?" */
.fx-env-q { font-size: 15px; font-weight: 600; color: var(--ds-text); }
.fx-env-l { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fx-env-it { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 12px 10px 16px; border-radius: 16px; border: 1px solid var(--ds-line-2); background: #fff; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.fx-env-it:hover { background: var(--ds-page); }
.fx-env-it:focus-visible { outline: 2px solid var(--ds-blue); outline-offset: 2px; }
.fx-env-it > .ic { width: 18px; height: 18px; color: var(--ds-text-3); flex-shrink: 0; }
.fx-env-itb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fx-env-itt { font-size: 14.5px; font-weight: 600; color: var(--ds-text); overflow-wrap: anywhere; }
.fx-env-itd { font-size: 12.5px; color: var(--ds-text-3); }
.fx-env-otro { border-style: dashed; }
.fx-env-p2 { display: flex; flex-direction: column; gap: 14px; }
.fx-env-libre { display: flex; flex-direction: column; gap: 14px; }
.fx-env-resp { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; border-radius: 16px; background: #EEF4FB; }
.fx-env-resp > .ic { width: 20px; height: 20px; color: var(--ds-navy); flex-shrink: 0; }
.fx-env-resp-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-env-resp-k { font-size: 12px; color: var(--ds-text-2); }
.fx-env-resp-b strong { font-size: 14.5px; color: var(--ds-navy); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .fx-in-fold .fx-rm-tog, .fx-kpitog .fx-rm-tog, .fx-cats-sum .fx-rm-tog { transition: none !important; }
}

/* 1281–1440 px: la fecha va bajo el número para que quepan Número, proveedor y razón social sin desbordar */
.fx-num-f { display: none; }
@media (min-width: 1281px) and (max-width: 1440px) {
  .fx-th-fecha, .fx-td-fecha { display: none; }
  .fx-td-num .fx-num-f { display: block; font-size: 11.5px; color: var(--ds-text-3); }
  .fx-th-num .fx-num-f { display: inline; }
  .fx-td-cat .fx-cat { max-width: 150px; }
}
@media (max-width: 768px) { .fx-ambito-x { display: none; } }
/* Categoría en la tabla: nombre completo en dos líneas antes que «Gastos de …» */
@media (min-width: 1281px) { .fx-td-cat .fx-cat { white-space: normal; } .fx-td-cat .fx-cat-n { overflow: visible; text-overflow: clip; } }
@media (min-width: 1281px) { .fx-in-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
