/* CR-INVOICES online · ajustes sobre la interfaz de escritorio */
html.web [data-act="openDir"], html.web [data-act="changeDir"], html.web [data-act="authWs"] { display: none !important; }
html.web .auth .foot { flex-direction: row; justify-content: center; gap: 18px; }
html.web .auth .foot a { color: var(--muted); }
html.web .side-foot::after { content: "Nube CRASIS"; font-size: 11px; color: var(--muted); }
/* Aviso «instala la app» */
.pwa-hint { position: fixed; z-index: 15; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--accent-line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.pwa-hint img { border-radius: 10px; flex: none; }
.pwa-hint .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.4; }
.pwa-hint .tx span { color: var(--muted); }
.side-tools { display: none; }

/* ───────── móvil (también la app instalada) ───────── */
@media (max-width: 760px) {
  html.web, html.web body { height: 100%; overflow: hidden; }
  html.web body { padding: 0; }
  html.web .win { height: 100dvh; min-height: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  /* barra superior: una fila con lo esencial y la empresa debajo */
  html.web .titlebar { flex-wrap: wrap; height: auto; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px max(10px, env(safe-area-inset-left, 0px)); }
  html.web .titlebar > .chip.y, html.web .titlebar .tb-title, html.web #userBtn, html.web .titlebar > .seg { display: none; } /* cerrar sesión: en Ajustes */
  html.web .titlebar .iconbtn, html.web .titlebar .btn { min-width: 44px; height: 44px; justify-content: center; }
  html.web .titlebar .btn.y { font-size: 0; gap: 0; padding: 0 12px; }
  html.web .titlebar .btn.y svg { width: 18px; height: 18px; }
  html.web .titlebar .chip.lic { min-height: 32px; padding: 4px 10px; }
  html.web .empbtn { order: 10; flex: 1 1 100%; max-width: none; min-height: 44px; }
  html.web .empbtn #tbTitle { flex: 1; text-align: left; }
  /* menú lateral como cajón */
  html.web .body { position: relative; min-height: 0; }
  html.web .side { position: absolute; top: 0; z-index: 5; width: min(300px, 86vw); height: 100%; box-shadow: var(--shadow); padding-left: env(safe-area-inset-left, 0px); }
  html.web .side.collapsed { width: 0; padding-left: 0; }
  html.web .side:not(.collapsed) + .main { opacity: .35; pointer-events: none; }
  html.web .nav button { min-height: 44px; font-size: 15px; }
  html.web .side-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
  html.web .side-tools .seg button { min-height: 38px; padding: 6px 14px; font-size: 13px; }
  html.web .side-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* contenido */
  html.web .main { padding: 16px max(14px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); gap: 14px; }
  html.web .main p.tb-title, html.web .main .toolbar > span.tb-title, html.web .mb .tb-title { display: block; } /* textos de ayuda: en el móvil también */
  html.web .phead { flex-direction: column; align-items: stretch; gap: 10px; }
  html.web .phead h1 { font-size: 22px; }
  html.web .phead .acts { margin-left: 0; }
  html.web .phead .acts .btn { flex: 1 1 auto; justify-content: center; }
  html.web .btn { min-height: 44px; padding: 9px 14px; font-size: 14px; }
  html.web .iconbtn { width: 44px; height: 44px; }
  html.web .linkbtn { min-height: 36px; }
  html.web input, html.web select, html.web textarea { font-size: 16px !important; } /* evita el zoom de iOS al escribir */
  html.web .field input, html.web .field select { min-height: 44px; }
  html.web .toolbar .search { min-width: 0; max-width: none; flex: 1 1 100%; min-height: 44px; }
  html.web .toolbar select { min-height: 44px; flex: 1 1 40%; }
  html.web .doc-grid, html.web .grid2, html.web .grid3, html.web .wiz, html.web .form { grid-template-columns: minmax(0, 1fr); }
  html.web .main > *, html.web .doc-grid > *, html.web .sec, html.web .with-btn > input, html.web .with-btn > select { min-width: 0; max-width: 100%; }
  html.web .form .w2, html.web .form .full { grid-column: auto; }
  html.web .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  html.web .kpis .card { min-width: 0; }
  html.web .kpi .val { font-size: 20px; }
  html.web .banner { flex-wrap: wrap; gap: 10px; }
  html.web .banner .btn { flex: 1 1 100%; justify-content: center; }
  html.web .card { min-width: 0; }
  /* tablas: se desplazan dentro de su tarjeta, nunca la página */
  html.web .card.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html.web .card.tbl table.t { min-width: 600px; }
  html.web div:has(> table.t) { overflow-x: auto; max-width: 100%; }
  /* líneas de la factura: una tarjeta por línea; la descripción a todo el ancho y las cifras debajo */
  html.web .lines, html.web .lines thead, html.web .lines tbody { display: block; width: 100%; }
  html.web .lines thead tr { display: flex; align-items: center; }
  html.web .lines thead th:not(:first-child) { display: none; }
  html.web .lines thead th:first-child { flex: 1; }
  html.web .lines tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  html.web .lines td { display: block; width: auto !important; min-width: 0; padding: 0; border: 0; }
  html.web .lines td:first-child { grid-column: 1 / -1; }
  html.web .lines td.imp { grid-column: 1 / 5; padding-top: 2px; }
  html.web .lines td.del { grid-column: 5; padding-top: 0; }
  html.web .lines .lbl { display: block; margin-bottom: 3px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--font-sans, inherit); font-weight: 600; text-align: left; }
  html.web .lines td.imp .lbl { display: inline; margin-right: 8px; }
  html.web .lines tr.grp-h { display: block; padding: 6px 0; }
  html.web .lines tr.grp-h td { display: block; }
  html.web .ta-grip { min-height: 22px; }
  html.web .chk { min-height: 40px; align-items: center; }
  /* ventanas: hoja a pantalla completa */
  html.web .scrim { padding: 0; place-items: end stretch; }
  html.web .modal, html.web .modal.lg, html.web .modal.xl, html.web .modal.wide { width: 100%; max-height: 100dvh; height: auto; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  html.web .mh { padding: 16px 16px 0; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  html.web .mb { padding: 14px 16px; }
  html.web .mf { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }
  html.web .mf .toolbar { flex: 1; justify-content: flex-end; }
  html.web .impopts { grid-template-columns: 1fr; }
  html.web .toast { max-width: calc(100vw - 24px); text-align: center; }
  html.web .auth { min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
}
