/* 3.9.4: recepción de facturas y guías en el portal del personal externo. */
.invoice-card { grid-column: 1 / -1; }
.invoice-note { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.invoice-scan { width: 100%; min-height: 64px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #fff; background: linear-gradient(135deg, #dd1621, #a90913); border: 0; border-radius: 14px; box-shadow: 0 10px 24px rgba(207,9,18,.22); font-size: 18px; font-weight: 850; }
.invoice-scan svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.invoice-today { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.invoice-today:empty { display: none; }
.invoice-today-head { padding: 10px 14px; background: #f7f8f9; font-size: 13.5px; font-weight: 850; }
.invoice-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #eef0f2; }
.invoice-row b { display: block; font-size: 14.5px; }
.invoice-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.invoice-tag { width: 40px; height: 38px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 900; }
.invoice-tag.guide { background: var(--amber-soft); color: var(--amber); }
.invoice-state { margin-left: auto; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 850; white-space: nowrap; }
.invoice-state.review { background: #fbe9ea; color: var(--red-dark); }
.invoice-empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }

body.inv-open { overflow: hidden; }
.inv-flow { position: fixed; inset: 0; z-index: 1000; background: #f4f5f7; color: var(--ink); }
.inv-flow[hidden] { display: none; }
.inv-page { height: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; }
.inv-head { padding: max(14px, env(safe-area-inset-top, 0px)) 16px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.inv-head-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; font-weight: 700; }
.inv-link { min-height: 40px; border: 0; background: transparent; color: var(--red-dark); font-weight: 850; }
.inv-steps { display: flex; gap: 6px; margin-top: 8px; }
.inv-steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.inv-steps .done { background: #1e8e5a; }
.inv-steps .now { background: var(--red); }
.inv-head h1 { margin: 12px 0 0; font-size: 23px; font-weight: 850; }
.inv-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.inv-body.center { align-items: center; justify-content: center; text-align: center; }
.inv-flow .inv-foot { display: flex !important; }
.inv-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.inv-btn { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #d5d9de; border-radius: 14px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 750; }
.inv-btn.big { min-height: 58px; font-size: 17.5px; }
.inv-btn.primary { border: 0; background: var(--red); color: #fff; font-weight: 850; }
.inv-btn.primary:disabled { background: #e3a3a6; }
.inv-btn.ghost { border-style: dashed; }
.inv-tips { display: flex; flex-direction: column; gap: 10px; }
.inv-tips > div { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: #fff; color: #39424a; font-size: 14.5px; line-height: 1.45; }
.inv-tips svg { flex: 0 0 auto; color: var(--red); }
.inv-tips b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.inv-reading h1 { margin: 18px 0 6px; font-size: 24px; }
.inv-reading p { margin: 0 0 18px; color: var(--muted); }
.inv-spin { width: 54px; height: 54px; border-radius: 50%; border: 6px solid #f3c4c6; border-top-color: var(--red); animation: inv-spin .9s linear infinite; }
@keyframes inv-spin { to { transform: rotate(360deg); } }
.inv-progress { width: min(320px, 90%); height: 10px; border-radius: 5px; background: #e3e6ea; overflow: hidden; }
.inv-progress span { display: block; height: 100%; background: var(--red); transition: width .3s ease; }
.inv-reading b { margin-top: 8px; font-size: 15px; }
.inv-badge { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 750; line-height: 1.4; }
.inv-badge.ok { background: var(--green-soft); color: var(--green); }
.inv-badge.warn { background: var(--amber-soft); color: #7a4b00; }
.inv-badge.gray { background: #eef0f2; color: #39424a; }
.inv-badge svg { flex: 0 0 auto; }
.inv-error { padding: 12px 14px; border-radius: 14px; background: #fbe9ea; color: var(--red-dark); font-size: 14.5px; font-weight: 750; }
.inv-card { border-radius: 18px; background: #fff; overflow: hidden; }
.inv-card-title { padding: 14px 16px 8px; font-size: 14px; font-weight: 850; color: #39424a; }
.inv-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 14px; }
.inv-type { min-height: 48px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.inv-type[aria-pressed="true"] { border-color: var(--red); background: #fff8f8; color: var(--red-dark); }
.inv-field { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px; border-top: 1px solid #eef0f2; }
.inv-card .inv-field:first-child, .inv-two .inv-field { border-top: 0; }
.inv-field > span { font-size: 13px; font-weight: 750; color: var(--muted); }
.inv-field small { margin-left: 6px; font-weight: 600; color: #8a939b; }
.inv-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 2px solid #d5d9de; border-radius: 12px; background: #fff; font-size: 17px; font-weight: 700; color: var(--ink); }
.inv-field input:focus { outline: none; border-color: var(--red); }
.inv-field.need input { border-color: #e3a3a6; background: #fff8f8; }
.inv-two { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #eef0f2; }
.inv-amounts .inv-field { flex-direction: row; align-items: center; justify-content: space-between; }
.inv-amounts .inv-field > span { flex: 1; font-size: 15px; color: #39424a; }
.inv-amounts .inv-field input { width: 46%; text-align: right; font-size: 18px; }
.inv-amounts .inv-field:last-child { background: #f7f8f9; }
.inv-amounts .inv-field:last-child > span { color: var(--ink); font-weight: 850; font-size: 16px; }
.inv-checks { display: flex; flex-direction: column; gap: 8px; }
.inv-checks:empty { display: none; }
.inv-check { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; font-size: 14px; font-weight: 750; line-height: 1.35; text-align: left; }
.inv-check svg { flex: 0 0 auto; }
.inv-check.ok { background: var(--green-soft); color: var(--green); }
.inv-check.warn { background: var(--amber-soft); color: #7a4b00; }
.inv-check.info { background: #eaf1fb; color: #1f4e9a; }
.inv-add { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #b8bec4; border-radius: 14px; background: transparent; color: #39424a; font-size: 14.5px; font-weight: 800; }
.inv-missing { text-align: center; color: var(--red-dark); font-size: 13.5px; font-weight: 750; }
.inv-done h1 { margin: 12px 0 4px; font-size: 27px; }
.inv-ok { width: 92px; height: 92px; border-radius: 50%; background: #1e8e5a; color: #fff; display: grid; place-items: center; }
.inv-summary { width: 100%; }
.inv-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid #eef0f2; font-size: 15px; }
.inv-summary div:first-child { border-top: 0; }
.inv-summary span { color: var(--muted); }
.inv-done .inv-check { width: 100%; }
.inv-small { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .inv-spin { animation-duration: 2.5s; } }
.inv-body > * { flex-shrink: 0; }
.inv-foot > .inv-btn { width: 100%; }
.inv-tips > div, .inv-card, .inv-check, .inv-add { width: 100%; box-sizing: border-box; }
