.history{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:28px 32px;margin-top:28px}
.history-head{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-bottom:20px}
.history-head h2{margin:0 0 5px}
.history-head p{margin:0;color:var(--muted);font-size:14px;line-height:1.5}
.history-link{font-weight:700;color:#945200;white-space:nowrap;font-size:14px}
.history-link:hover{text-decoration:underline}
.history-loading{border:1px dashed #c9d2d7;border-radius:10px;padding:16px 18px;color:var(--muted);font-size:14px;background:#fafbfb}
.history-empty{border-top:1px solid var(--line);padding:25px 0 5px;display:flex;gap:14px;align-items:flex-start}
.history-empty p{margin:4px 0 0;font-size:14px;color:var(--muted);line-height:1.55}.history-empty strong{color:var(--navy)}
.receipt-icon{display:grid;place-items:center;flex:0 0 42px;height:42px;background:#edf1f3;color:var(--navy);border-radius:8px}
.receipt-icon svg{width:22px;stroke:currentColor;fill:none;stroke-width:1.6}
.history-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:0 0 18px}
.history-stats article{border:1px solid var(--line);border-radius:12px;padding:16px 18px;background:#fafbfb}
.history-stats span{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.history-stats strong{display:block;font-size:26px;line-height:1.1;color:var(--navy);letter-spacing:-.04em;overflow-wrap:anywhere}
.history-table-wrap{overflow-x:auto;border-top:1px solid var(--line)}
.history-table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
.history-table th{text-align:left;font-size:12px;color:var(--muted);padding:12px 8px;border-bottom:1px solid var(--line)}
.history-table td{padding:15px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
.history-table th:nth-child(n+2),.history-table td:nth-child(n+2){text-align:right}
.history-table td:first-child{overflow-wrap:anywhere}.history-table tbody tr:last-child td{border-bottom:0}
.invoice-date{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.earned{color:#176b42;font-weight:700}
.history-note{font-size:12px;color:var(--muted);line-height:1.5;margin:15px 0 0}
.demo-banner{background:#fff3df;color:#754600;border-bottom:1px solid #e5c994;padding:11px 16px;text-align:center;font-size:14px;font-weight:600}
.history-page-title{font-size:clamp(32px,5vw,48px);letter-spacing:-.045em;color:var(--navy);margin:10px 0}
.history-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:16px 0}
.history-controls input{max-width:320px}.history-controls label{margin:0}.history-controls .outline{min-height:42px}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:18px;border-top:1px solid var(--line)}
.pagination .outline{min-height:40px;padding:8px 12px;font-size:13px}.pagination button:disabled{cursor:default}.pagination span{font-size:13px;color:var(--muted)}
@media(max-width:850px){.history-stats{grid-template-columns:1fr}.history-stats strong{font-size:23px}}
@media(max-width:600px){.history{padding:20px 16px;margin-top:22px}.history-head{align-items:flex-start;gap:12px;flex-direction:column}.history-head h2{font-size:21px}.history-head p{font-size:13px}.history-link{font-size:13px}.history-table{font-size:12px;table-layout:fixed}.history-table th:first-child{width:52%}.history-table th:nth-child(2){width:24%}.history-table th:last-child{width:24%}.history-table th,.history-table td{padding:13px 4px}.invoice-date{font-size:11px}.history-table td:first-child{font-weight:600}.history-controls input{max-width:100%}}
.verify-form{margin:12px 0}.verify-row{display:flex;gap:10px;align-items:center}.verify-row input{max-width:350px}.verify-row .outline{min-height:50px}.invoice-state{display:block;font-size:12px;color:var(--muted);margin-top:4px;line-height:1.35}.invoice-state.good{color:#176b42}.invoice-state.warn{color:#8a5200}.history-controls select{font:inherit;min-height:42px;padding:8px;border:1px solid #aebdc5;border-radius:7px;background:white;color:var(--navy)}.history-table td{overflow-wrap:anywhere}#hist-table,#page-table{overflow-x:auto}.history-note[role=status]{font-size:14px}.receipt-missing{color:var(--muted)}@media(max-width:480px){.verify-row{flex-direction:column;align-items:stretch}.verify-row input{max-width:none}.history-table td:first-child{font-size:12px}.invoice-state{font-size:11px}}
/* Panel 4: compact account dashboard, clean spacing and mobile-friendly rows. */
:root{--paper:#f4f5f3;--radius:16px}
.dashboard .dash-head{margin-bottom:24px;align-items:center}.dashboard .dash-head h1{font-size:clamp(30px,4.5vw,48px);line-height:1.1;margin-bottom:7px}.dashboard .overline{letter-spacing:0;font-size:12px;text-transform:none}.dashboard .dash-grid{gap:20px}.dashboard .points-card{min-height:274px;padding:28px 30px;border-top:4px solid var(--orange)}.dashboard .balance-label{margin-top:24px}.dashboard .account-card{padding:26px 28px;box-shadow:none}.dashboard .account-card dl>div{padding:12px 0}.dashboard .history,.history{box-shadow:0 5px 22px #142e4305}.history-head{padding-bottom:15px;margin-bottom:0;border-bottom:1px solid var(--line)}.history-head h2{font-size:23px;letter-spacing:-.035em}.history-link{display:inline-flex;align-items:center;min-height:42px;padding:0 12px;border:1px solid #d9c8af;border-radius:8px}.history-table th{font-size:12px;text-transform:none;letter-spacing:.015em}.history-table td{padding-block:18px}.history-table td strong{color:var(--navy);font-weight:650}.history-table .earned{font-size:15px;white-space:nowrap}.invoice-state{font-weight:500}.history-note[role=status]{margin:12px 0;line-height:1.55}.remember-device{display:flex;gap:10px;align-items:center;line-height:1.45;font-weight:500;color:var(--navy);margin:15px 0 0}.remember-device input{width:20px;height:20px;min-height:0;flex:none;accent-color:var(--navy)}.verify-form .small{margin-top:6px}.history-empty{padding-top:20px;border-top:0}.history-controls{margin-top:20px}.next{margin-top:22px;padding:20px 0}.next h2{font-size:21px}.history-page-title{line-height:1.1}.dashboard .points-card,.dashboard .account-card{min-width:0}.dashboard .balance{font-size:clamp(46px,7vw,76px)}
@media(max-width:850px){.dashboard .dash-head{align-items:flex-start;gap:12px}.dashboard .dash-grid{gap:16px}.dashboard .points-card{min-height:240px}.dashboard .account-card{padding:20px}.dashboard .main{padding-block:28px}.dashboard .dash-head .outline{min-height:44px}.dashboard .balance-label{margin-top:18px}}
@media(max-width:600px){.main{padding-block:26px 40px}.header-inner{min-height:66px}.dashboard .dash-head h1{font-size:34px}.dashboard .points-card{padding:22px;min-height:220px}.dashboard .balance{font-size:53px}.dashboard .point-top{font-size:14px}.dashboard .point-bottom{font-size:12px}.dashboard .account-head{margin-bottom:12px}.dashboard .account-card dl{display:grid;grid-template-columns:1fr 1fr;column-gap:14px}.dashboard .account-card dl>div:last-child{grid-column:1/-1}.dashboard .account-card dd{font-size:14px}.history{margin-top:18px;padding:18px 14px}.history-head{flex-direction:row;align-items:center;gap:8px}.history-head>div{min-width:0}.history-head h2{font-size:20px}.history-head p{font-size:12px}.history-link{font-size:12px;min-height:38px;padding:0 9px}.history-table{table-layout:fixed;font-size:12px}.history-table th:first-child{width:50%}.history-table th:nth-child(2){width:27%}.history-table th:last-child{width:23%}.history-table th,.history-table td{padding:14px 3px}.history-table td strong{font-size:12px;overflow-wrap:anywhere}.history-table .earned{font-size:13px;white-space:normal}.invoice-state,.invoice-date{font-size:11px}.history-note[role=status]{font-size:12px}.history-controls{display:grid;grid-template-columns:1fr auto;gap:8px}.history-controls label{grid-column:1/-1}.history-controls select{min-width:0;width:100%;font-size:14px}.history-controls .outline{padding:10px 12px;font-size:13px}.pagination{gap:5px}.pagination .outline{padding:8px 10px}.pagination span{text-align:center}.next .outline{width:100%}.form-card{box-shadow:none}.intro h1{font-size:36px}.intro .photo{height:150px}.access{gap:20px}}
@media(max-width:600px){.dashboard{display:flex;flex-direction:column;gap:16px}.dashboard .dash-grid{display:contents}.dashboard .dash-head{order:0;margin:0}.dashboard #dash-message{order:1;margin:0}.dashboard .points-card{order:2}.dashboard .history{order:3;margin:0}.dashboard .account-card{order:4}.dashboard .next{order:5;margin:0}.dashboard .updated{order:6;margin:0}.dashboard .point-unit{margin-bottom:16px}.dashboard .dash-head .outline{min-height:40px;padding:8px 13px;font-size:13px}}

.invoice-loader{display:flex;gap:14px;align-items:center;padding:20px 8px;color:var(--navy);min-height:85px}.invoice-loader strong{display:block;font-size:14px}.invoice-loader small{display:block;color:var(--muted);font-size:12px;margin-top:5px;line-height:1.4}.spinner{width:25px;height:25px;border:3px solid #e2e8eb;border-top-color:#e89212;border-radius:50%;flex:none;animation:el-spin .8s linear infinite}@keyframes el-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation:none;border-color:#e89212}}.preview-warning{padding:10px 16px;background:#fff1d8;color:#744500;text-align:center;font-size:13px;line-height:1.4}.preview-panel{max-width:850px;margin:0 auto}.preview-form{max-width:500px;margin:0 auto}.preview-panel .history{margin-top:20px}.preview-panel .history-controls{display:flex;align-items:center}.preview-panel .history-controls label{margin:0}.preview-panel .history-controls select{flex:1}.preview-panel .history-controls .outline{min-height:42px}.preview-panel .points-card{min-height:210px}.preview-panel .balance-label{margin-top:20px}.preview-panel .history-note{overflow-wrap:anywhere}

/* V6: loading and retry appear without an intermediate code form. */
.history-retry{margin:14px 0 0;min-height:40px;font-size:13px}.invoice-loader{min-height:96px}.history-note[role=status]:empty{display:none}.history-table td{overflow-wrap:anywhere}@media(max-width:360px){.history{padding:14px 10px}.history-head h2{font-size:18px}.history-table td strong{font-size:11px}.history-table th:first-child{width:49%}.history-table th:nth-child(2){width:27%}.history-table th:last-child{width:24%}}

/* Electrolum V8 · acceso al PDF sin saturar el historial */
.invoice-pdf{display:inline-flex;align-items:center;justify-content:center;min-height:33px;margin:10px 0 0;padding:6px 12px;background:#eef3f5;border:1px solid #cad9df;border-radius:7px;color:#17374d;font-size:12px;font-weight:700;line-height:1;white-space:nowrap}
.invoice-pdf:hover{background:#dfeaf0;border-color:#8ca7b5}
.invoice-pdf:focus-visible{outline:3px solid #e89212;outline-offset:2px}
.pdf-modal[hidden]{display:none!important}
.pdf-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px}
.pdf-backdrop{position:absolute;inset:0;background:rgba(10,30,44,.68)}
.pdf-dialog{z-index:1;position:relative;width:min(100%,470px);max-height:90vh;overflow-y:auto;background:#fff;border-radius:16px;padding:30px 32px;box-shadow:0 25px 90px #081d2f45;color:var(--navy)}
.pdf-dialog h2{font-size:27px;margin:8px 0 10px;letter-spacing:-.04em}
.pdf-dialog p{color:var(--muted);font-size:14px;line-height:1.6;margin:0 0 14px}
.pdf-dialog-icon{width:52px;height:52px;background:#f8ecda;border-radius:12px;color:#ab6412;display:grid;place-items:center;font-size:26px}
.pdf-close{position:absolute;right:15px;top:12px;border:0;background:none;font-size:27px;color:var(--navy);width:36px;height:36px}
.pdf-dialog input{text-transform:uppercase;font-variant-numeric:tabular-nums;letter-spacing:.04em}
.pdf-dialog .primary{margin-top:16px}
.pdf-dialog .pdf-hint{font-size:12px;margin:16px 0 0}
.pdf-message{margin-top:12px;background:#edf4f6;color:#17374d;border-radius:7px;padding:11px;font-size:13px}
.pdf-msg-error{background:#fff2df;color:#854400}
.pdf-dialog-open{overflow:hidden}
.pdf-inline-status{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:999;max-width:min(520px,calc(100% - 32px));padding:0;margin:0;background:#17374d;color:white;border-radius:8px;font-size:13px;text-align:center;box-shadow:0 6px 24px #0002}
.pdf-inline-status:not(:empty){padding:11px 15px}
@media(max-width:600px){.invoice-pdf{min-height:35px;margin:8px 0 0;font-size:12px}.pdf-dialog{padding:24px 20px;border-radius:13px}.pdf-dialog h2{font-size:24px}.pdf-inline-status{bottom:12px}}

/* Electrolum V9: PDF como columna independiente. */
.history-table{table-layout:auto;min-width:0}
.history-table th:last-child,.history-table td:last-child{text-align:right;width:112px;white-space:nowrap}
.history-table .pdf-cell{padding-left:10px;vertical-align:middle}
.history-table .invoice-pdf{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin:0;min-height:38px;padding:7px 11px;border-radius:8px;background:#edf3f6;border:1px solid #bdcdd6;color:#17374d;font-size:12px;line-height:1;font-weight:700;white-space:nowrap}
.history-table .invoice-pdf:hover{background:#dfeaf0;border-color:#8ca7b5}
.history-table .invoice-pdf svg{display:block;width:17px;height:17px;flex:none}
.history-table .pdf-unavailable{color:#9eaab1;font-size:14px}
.history-table th:first-child{min-width:180px}
.history-table th:nth-child(2){min-width:75px}
.history-table th:nth-child(3){min-width:67px}
@media(max-width:700px){
 .history-table{table-layout:fixed;width:100%;font-size:12px}
 .history-table th:first-child{width:41%;min-width:0}
 .history-table th:nth-child(2){width:23%;min-width:0}
 .history-table th:nth-child(3){width:18%;min-width:0}
 .history-table th:last-child,.history-table td:last-child{width:18%;min-width:0}
 .history-table td{padding:13px 4px;line-height:1.45}
 .history-table .pdf-cell{padding-left:4px}
 .history-table .invoice-pdf{width:36px;height:36px;min-height:36px;min-width:36px;padding:0;border-radius:8px}
 .history-table .invoice-pdf span{display:none}
 .history-table .invoice-pdf svg{width:18px;height:18px}
 .history-table th:last-child{font-size:11px;letter-spacing:-.01em}
 .history-table td:first-child strong{font-size:11px;line-height:1.35}
 .history-table .earned{font-size:12px}
}
@media(max-width:390px){
 .history-table th:first-child{width:42%}
 .history-table th:nth-child(2){width:22%}
 .history-table th:nth-child(3){width:19%}
 .history-table th:last-child,.history-table td:last-child{width:17%}
 .history-table th,.history-table td{padding-left:2px;padding-right:2px}
 .history-table .invoice-pdf{width:32px;height:34px;min-width:32px;min-height:34px}
 .history-table th:last-child{font-size:10px}
}
