@font-face { font-family: 'OpenSansUI'; font-weight: 400; src: url(/fonts/opensans-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'OpenSansUI'; font-weight: 700; src: url(/fonts/opensans-700.woff2) format('woff2'); font-display: swap; }

:root {
  --bg: #f5f3ef; --card: #fff; --ink: #1d1b1a; --muted: #6d6660; --line: #e6e1da; --line2: #d6cfc6;
  --dark: #231f20; --brand: #009e98; --brand-ink: #00716d; --brand-soft: #e3f4f3; --accent: #f8b033; --accent-soft: #fff3dc;
  --blue: #006eaa; --danger: #c0392b; --danger-soft: #fbeae8; --ok: #1e8e4e;
  --r: 14px; --r-sm: 10px; --sh: 0 1px 2px rgba(35,31,32,.06), 0 4px 18px rgba(35,31,32,.06);
  --side: 248px; --gut: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'OpenSansUI', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
a { color: var(--brand-ink); }
.muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: #faf8f5; border-color: #c7bfb5; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-pri { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-pri:hover { background: #3a3435; border-color: #3a3435; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(35,31,32,.06); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #eab8b2; }
.btn-lg { min-height: 50px; font-size: 16px; padding: 0 22px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-ico { width: 42px; padding: 0; }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo > span { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.campo > span i { font-style: normal; font-weight: 400; color: #9a928a; }
.campo input, .campo textarea, .campo select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: #fff;
  font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.campo textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.campo.err input, .campo.err textarea { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.campo .ayuda { font-size: 12px; color: #9a928a; }
.dinero { position: relative; }
.dinero::before { content: '$'; position: absolute; left: 12px; bottom: 11px; color: var(--muted); font-weight: 700; pointer-events: none; }
.dinero input { padding-left: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Carga y login */
.carga { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.carga img { width: 96px; opacity: .9; }
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px var(--gut);
  background: radial-gradient(1200px 600px at 10% -10%, #e9f5f4 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fff1d6 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 28px 24px 24px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 14px; }
.login-logo { width: 104px; height: 104px; align-self: center; margin: -6px 0 -4px; }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card > p.muted { margin: -8px 0 4px; text-align: center; font-size: 14px; }
.login-err { margin: 0; min-height: 20px; color: var(--danger); font-size: 14px; font-weight: 700; }

/* Estructura */
.app { min-height: 100svh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--dark); color: #eee7e0; display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; z-index: 5; }
.side-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 2px 6px; }
.side-marca img { width: 46px; height: 46px; background: #fff; border-radius: 12px; padding: 2px; }
.side-marca span { display: flex; flex-direction: column; line-height: 1.25; }
.side-marca b { font-size: 15px; }
.side-marca small { font-size: 12px; color: #b3aaa1; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #d9d1c8; text-decoration: none; font-weight: 700; font-size: 14.5px; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a svg { width: 20px; height: 20px; flex: none; }
.side-nav .pronto { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #8f877f; border: 1px solid #4a4344; border-radius: 99px; padding: 1px 7px; }
.side-yo { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #3a3435; padding: 14px 4px 0; }
.side-yo div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-yo b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-yo small { font-size: 12px; color: #a59c93; }
.side-yo .btn { color: #d9d1c8; }
.side-yo .btn:hover { background: rgba(255,255,255,.08); }
.vista { margin-left: var(--side); padding: 28px 32px 120px; max-width: calc(1480px + var(--side)); outline: none; }
.tabbar { display: none; }

.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cab h1 { font-size: 26px; }
.cab p { margin: 4px 0 0; color: var(--muted); }
.tarjeta { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 20px; }
.tarjeta + .tarjeta { margin-top: 16px; }
.tarjeta > h2 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.tarjeta > h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; }
.rejilla { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla .ancho { grid-column: 1 / -1; }

/* Nueva factura */
.nf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 24px; align-items: start; }
.nf-prev { position: sticky; top: 20px; }
.nf-prev-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.hoja { position: relative; width: 100%; background: #fff; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 12px 32px rgba(35,31,32,.12); overflow: hidden; }
.hoja > .fx { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.hoja > .fx-pags { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfbf9; }
.item + .item { margin-top: 12px; }
.item-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.item-cab b { font-size: 14px; }
.item-cuerpo { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 14px; }
.foto-sel { position: relative; width: 148px; aspect-ratio: 4 / 3; border: 1.5px dashed var(--line2); border-radius: 10px; background: #fff; display: grid; place-items: center;
  text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; overflow: hidden; }
.foto-sel:hover { border-color: var(--brand); color: var(--brand-ink); }
.foto-sel svg { width: 26px; height: 26px; display: block; margin: 0 auto 4px; }
.foto-sel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-sel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-acc { display: flex; gap: 6px; margin-top: 6px; }
.foto-acc .btn { flex: 1; min-height: 30px; font-size: 12px; padding: 0 8px; }
.item-campos { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item-campos .ancho { grid-column: 1 / -1; }
.agregar { margin-top: 12px; width: 100%; border-style: dashed; color: var(--brand-ink); }

.totales { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.cifra { background: #faf8f5; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 44px; }
.cifra small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.cifra b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cifra.saldo { background: var(--accent-soft); border-color: #f3d79f; }

.barra-gen { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 4; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 12px 32px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.barra-gen .total { margin-right: auto; display: flex; flex-direction: column; line-height: 1.2; }
.barra-gen .total small { font-size: 12px; color: var(--muted); font-weight: 700; }
.barra-gen .total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.solo-cel { display: none !important; }

/* Buscador de catálogo */
.sug-wrap { position: relative; }
.sug-wrap > label { display: block; }
.sug-wrap .lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.sug-wrap .lbl i { font-style: normal; font-weight: 400; color: #9a928a; }
.ayuda.ok { color: var(--ok); font-weight: 700; font-size: 12.5px; }
.sug-ancla { position: relative; }
.sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8; background: #fff; border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(35,31,32,.16); max-height: 360px; overflow: auto; padding: 4px; }
.sug-op { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.sug-op:hover, .sug-op.act { background: var(--brand-soft); }
.sug-op img, .sug-sin { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; background: #eee; }
.sug-op span { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sug-op b { font-size: 14px; }
.sug-op small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-op em { font-style: normal; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sug-nada { padding: 12px; font-size: 13.5px; color: var(--muted); }
.mas-det { border-top: 1px solid var(--line); padding-top: 10px; }
.mas-det > summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--brand-ink); padding: 4px 0 8px; }
.mas-det > summary i { font-style: normal; font-weight: 400; color: #9a928a; }
.mas-det > .item-campos { margin-top: 4px; }
.foto-sel small { font-weight: 400; font-size: 11px; }

/* Listas */
.filtros { display: flex; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; align-items: flex-end; }
.filtros .fechas { display: flex; gap: 10px; }
.filtros .fechas .campo { width: 160px; }
.filtros .rapidos { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 5px; }
.resumen { margin: 4px 0 10px; font-size: 14px; color: var(--muted); }
.resumen:empty { display: none; }
@media (max-width: 760px) { .filtros .fechas { width: 100%; } .filtros .fechas .campo { flex: 1; width: auto; } .filtros .rapidos { gap: 0; padding-bottom: 0; } .filtros .rapidos .btn-sm { padding: 0 9px; } }
.buscar { position: relative; flex: 1; max-width: 420px; min-width: 220px; }
.buscar svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; color: var(--muted); }
.buscar input { width: 100%; min-height: 44px; padding: 10px 12px 10px 38px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; font-size: 16px; }
.buscar input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr.fila { cursor: pointer; }
.tabla tr.fila:hover td { background: #faf8f5; }
.tabla .der { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .n { font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla .cli b { display: block; }
.tabla .cli small { color: var(--muted); }
.tabla tr.anulada td { color: #a39a91; text-decoration: line-through; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.chip.warn { background: var(--accent-soft); color: #8a5a00; }
.chip.mal { background: var(--danger-soft); color: var(--danger); text-decoration: none; }
.vacio { text-align: center; padding: 40px 16px; color: var(--muted); }
.vacio b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Tablero */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px; }
.kpi small { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi b { display: block; font-size: 24px; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.acento { background: var(--dark); color: #fff; }
.kpi.acento small, .kpi.acento span { color: #bdb4ab; }
.dos { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dos .tarjeta + .tarjeta { margin-top: 0; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista a { text-decoration: none; color: inherit; display: flex; flex-direction: column; min-width: 0; }
.lista a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista small { color: var(--muted); font-size: 12.5px; }
.lista .der { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Detalle */
.det { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 24px; align-items: start; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.datos dt { color: var(--muted); font-weight: 700; }
.datos dd { margin: 0; overflow-wrap: anywhere; }

/* Equipo */

/* Modal y aviso */
.modal { position: fixed; inset: 0; background: rgba(29,27,26,.5); display: grid; place-items: center; padding: 16px; z-index: 30; }
.modal-card { width: 100%; max-width: 440px; max-height: calc(100svh - 32px); overflow: auto; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card.ancha { max-width: 640px; padding: 14px; }
.modal-card h2 { font-size: 20px; margin-bottom: 6px; }
.modal-card p { margin: 0 0 16px; color: var(--muted); }
.modal-ok { width: 56px; height: 56px; border-radius: 50%; background: #e4f5ea; color: var(--ok); display: grid; place-items: center; margin-bottom: 12px; }
.modal-ok svg { width: 30px; height: 30px; }
.modal-acc { display: grid; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 96px; translate: -50% 20px; opacity: 0; pointer-events: none; background: var(--dark); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-weight: 700; font-size: 14px; transition: opacity .2s, translate .2s; z-index: 40; max-width: calc(100vw - 32px); text-align: center; }
.toast.ver { opacity: 1; translate: -50% 0; }
.toast.mal { background: var(--danger); }

/* Responsive */
@media (max-width: 1240px) {
  .nf { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  :root { --side: 0px; }
  .side { display: none; }
  .vista { margin-left: 0; padding: 18px var(--gut) calc(170px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--dark);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: #b8afa6; text-decoration: none; font-size: 11px; font-weight: 700;
    background: none; border: 0; cursor: pointer; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] svg { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .nf { grid-template-columns: minmax(0, 1fr); }
  .nf-prev { display: none; }
  .barra-gen { left: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: 10px var(--gut); }
  .solo-cel { display: inline-flex !important; }
  .det { grid-template-columns: minmax(0, 1fr); }
  .det-hoja { max-width: 560px; }
  .toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .dos { grid-template-columns: minmax(0, 1fr); }
  .cab h1 { font-size: 22px; }
  .tarjeta { padding: 16px; }
  .rejilla, .item-campos { grid-template-columns: minmax(0, 1fr); }
  .item-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .item-cuerpo > div:first-child { order: 2; }
  .foto-sel { width: 100%; max-width: 260px; }
  .foto-sel:not(:has(img)) { max-width: 150px; }
  .foto-acc { max-width: 260px; }
  .totales { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .totales .campo { grid-column: 1 / -1; }
  .tabla .ocultable { display: none; }
  .tabla td, .tabla th { padding: 10px 8px; }
  .kpi b { font-size: 20px; }
  .barra-gen .btn-lg { padding: 0 16px; }
  .barra-gen .total b { font-size: 17px; }
  .barra-gen { gap: 8px; }
  .barra-gen .total { min-width: 0; }
  .txt-prev { display: none; }
  #ver-prev { width: 44px; padding: 0; }
  .barra-gen .btn-lg { padding: 0 14px; font-size: 15px; }
}
@media (max-width: 400px) {
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 17px; }
  .barra-gen { gap: 8px; }
  .barra-gen .btn { padding: 0 12px; font-size: 14px; }
}

/* ===== Empleados ===== */
.chip.gris { background: #efebe6; color: var(--muted); }
.ava { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center;
  font-weight: 700; font-size: 17px; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.xl { width: 88px; height: 88px; font-size: 28px; }
.emp-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.emp-grid > .vacio { grid-column: 1 / -1; }
.emp { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.emp:hover { border-color: var(--line2); box-shadow: 0 2px 4px rgba(35,31,32,.06), 0 10px 28px rgba(35,31,32,.09); transform: translateY(-1px); }
.emp:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.emp.inactivo { opacity: .6; }
.emp-cab { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emp-nom { display: flex; flex-direction: column; min-width: 0; }
.emp-nom b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-nom span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.emp-datos { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; font-size: 14px; }
.emp-datos li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.emp-datos li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-datos svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.emp-datos small { color: var(--muted); font-size: 12.5px; min-width: 62px; }
.emp-acc { display: flex; gap: 8px; margin-top: auto; }
.emp-acc .btn { flex: 1; }
.modal-card.emp-modal { max-width: 620px; padding: 22px; }
.f-emp-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.f-emp-cab h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-emp-foto { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.f-emp-foto > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.f-emp-foto small { color: var(--muted); font-size: 13px; }
.f-emp-foto .btn { margin-left: -12px; }
.ava-sel { position: relative; cursor: pointer; border-radius: 50%; }
.ava-sel:focus-within, .ava-sel:hover .ava { box-shadow: 0 0 0 3px var(--brand-soft); }
.ava-cam { position: absolute; left: 50%; bottom: -6px; translate: -50% 0; background: var(--dark); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.f-emp-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.f-emp-grid .ancho { grid-column: 1 / -1; }
.f-emp-grid[hidden] { display: none; }
.f-emp-acceso { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 18px 0 0; display: grid; gap: 12px; }
.f-emp-acceso legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.modal-card .err-form { color: var(--danger); font-size: 14px; font-weight: 700; min-height: 20px; margin: 10px 0 0; }
.campo .ayuda { color: var(--muted); font-size: 13px; }
.f-emp-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.f-emp-pie > div { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 560px) {
  .f-emp-grid { grid-template-columns: 1fr; }
  .modal-card.emp-modal { padding: 18px 16px; }
  .f-emp-pie > div { width: 100%; } .f-emp-pie > div .btn { flex: 1; }
}

/* Facturas: selección y eliminar definitivamente (solo Administrador general) */
.tabla .sel-c { width: 44px; padding: 0 0 0 10px; cursor: pointer; }
.sel-c input { width: 20px; height: 20px; accent-color: var(--danger); cursor: pointer; vertical-align: middle; }
.tabla tr.marcada td, .tabla tr.marcada:hover td { background: var(--danger-soft); }
.sel-barra { position: sticky; top: 8px; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 8px 8px 14px;
  background: var(--dark); color: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(35,31,32,.22); }
.sel-barra #sel-n { font-weight: 700; font-size: 14px; margin-right: auto; }
.sel-barra .btn-ghost { color: #e6dfd7; }
@media (hover: hover) { .sel-barra .btn-ghost:hover { background: rgba(255,255,255,.1); } }
.btn-borrar { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (hover: hover) { .btn-borrar:hover:not(:disabled) { background: #a5301f; border-color: #a5301f; } }
.btn-borrar:disabled { opacity: .45; cursor: not-allowed; }
.borrar-modal { max-width: 480px; }
.borrar-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; font-weight: 700; font-size: 26px; margin-bottom: 12px; }
.borrar-modal h2 { font-size: 20px; }
.borrar-modal p { color: var(--muted); margin: 8px 0 12px; }
.borrar-lista { list-style: none; margin: 0 0 14px; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.borrar-lista li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.borrar-lista li:last-child { border-bottom: 0; }
.borrar-lista span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.borrar-lista em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.borrar-ok { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 44px; }
.borrar-ok input { width: 20px; height: 20px; accent-color: var(--danger); flex: none; }
.borrar-acc { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) { .sel-barra { top: 4px; } .borrar-acc { flex-direction: column-reverse; } .borrar-acc .btn { width: 100%; } }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; border-color: #1ebe5b; }
.btn-wa:disabled { background: #e9e4dd; border-color: #e9e4dd; color: var(--muted); cursor: not-allowed; }
.btn-wa svg { width: 19px; height: 19px; }

/* Lector de facturas (16 nov) */
.nf-cab-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lector-c { text-align: center; padding: 18px 8px; }
.lector-c .spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); margin: 0 auto 14px; animation: giro 0.9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lector-c .spin { animation-duration: 3s; } }

/* Hoja Cámara / Galería (celular) */
.hoja-foto { position: fixed; inset: 0; z-index: 90; background: rgba(20,18,17,.45); display: flex; align-items: flex-end; justify-content: center; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.hf-caja { width: 100%; max-width: 420px; background: var(--card, #fff); border-radius: 18px; padding: 14px; display: grid; gap: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.25); animation: hfSube .18s ease-out; }
.hf-caja b { font-size: 15px; padding: 2px 4px 4px; }
.hf-caja button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line, #e5e0d8); background: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink, #231f20); cursor: pointer; }
.hf-caja button svg { width: 24px; height: 24px; color: var(--brand, #00716d); flex: none; }
.hf-caja .hf-no { justify-content: center; background: transparent; border-color: transparent; color: var(--muted, #6b645d); font-weight: 600; }
@keyframes hfSube { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hf-caja { animation: none; } }
