
body:not(.erp-authed) .sidebar,body:not(.erp-authed) .main-content{visibility:hidden!important}
#erpAuthGate{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#1e293b 60%,#1d4ed8);padding:16px;font-family:inherit}
#erpAuthGate.show{display:flex}
.eag-card{width:100%;max-width:400px;background:#fff;border-radius:16px;padding:28px 26px;box-shadow:0 20px 60px rgba(0,0,0,.4)}
.eag-card h2{margin:0 0 4px;font-size:1.25rem;color:#0f172a}
.eag-card p.sub{margin:0 0 16px;color:#64748b;font-size:.85rem}
.eag-card label{display:block;font-size:.78rem;font-weight:600;color:#334155;margin:10px 0 4px}
.eag-card input{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:.92rem}
.eag-card input:focus{outline:2px solid #2563eb33;border-color:#2563eb}
.eag-btn{width:100%;margin-top:16px;padding:11px;border:0;border-radius:8px;background:#2563eb;color:#fff;font-weight:600;font-size:.92rem;cursor:pointer}
.eag-btn:hover{background:#1d4ed8}
.eag-btn.alt{background:#e2e8f0;color:#334155;margin-top:8px}
.eag-link{display:block;text-align:center;margin-top:12px;font-size:.8rem;color:#2563eb;cursor:pointer}
.eag-err{color:#dc2626;font-size:.82rem;min-height:18px;margin-top:8px}
.eag-sec{font-size:.72rem;font-weight:700;color:#2563eb;text-transform:uppercase;letter-spacing:.05em;margin-top:14px}
.eag-key{font-family:monospace;font-size:1.25rem;text-align:center;letter-spacing:.08em;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:8px;padding:14px;margin:12px 0;user-select:all}

/* RC8.12: bounded auth cards; role panels fit laptops and stack on phones. */
html body #erpAuthGate{overflow-y:auto!important;padding:16px!important;box-sizing:border-box!important}
html body #erpAuthGate.show{display:grid!important;place-items:center!important}
html body .eag-card{box-sizing:border-box!important;min-width:0!important;max-height:calc(100vh - 32px)!important;max-height:calc(100dvh - 32px)!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable;padding:24px!important;line-height:1.45}
html body #eagBody:has(#su_go){max-width:780px!important;width:100%!important}
html body .eag-brand{color:#2563eb;font-size:12px;font-weight:700;letter-spacing:1.2px;margin-bottom:7px}
html body .eag-password-hint{font-size:12px;color:#52667e;line-height:1.5;background:#f1f5fb;border-radius:8px;padding:9px 12px;margin:12px 0 16px}
html body .eag-setup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
html body .eag-account-panel{min-width:0;border:1px solid #dce5f1;border-radius:12px;padding:16px;background:#fbfcff}
html body .eag-account-panel h3{font-size:16px;font-weight:600;color:#172b4d;line-height:1.4;margin:0 0 12px}
html body .eag-account-panel h3 span{display:block;font-size:12px;font-weight:400;color:#64748b;margin-top:2px}
html body .eag-account-panel label{font-size:12px;margin:10px 0 5px}
html body .eag-account-panel input{height:38px;min-width:0;font-size:14px;padding:8px 10px}
html body .eag-setup-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid #e2e8f0}
html body .eag-setup-footer .eag-err{flex:1 1 230px;min-width:0;margin:0;overflow-wrap:anywhere}
html body .eag-setup-footer .eag-btn{width:auto;min-width:180px;margin:0;padding:10px 16px;min-height:40px}
@media(max-width:600px){html body #erpAuthGate{padding:12px!important}html body .eag-card{max-height:calc(100vh - 24px)!important;max-height:calc(100dvh - 24px)!important;padding:18px!important;border-radius:12px}html body .eag-setup-grid{grid-template-columns:1fr;gap:12px}html body .eag-account-panel{padding:14px}html body .eag-setup-footer .eag-btn{width:100%}html body .eag-setup-footer .eag-err{flex-basis:100%}}

/* RC8.13: Admin-only onboarding; accessible password visibility and inline feedback. */
html body #eagBody:has(#su_go){max-width:520px!important}
html body .eag-setup-grid.eag-admin-only{grid-template-columns:1fr!important}
html body .fab-password-field{position:relative;min-width:0;width:100%}
html body .fab-password-field input{padding-right:68px!important;width:100%!important;box-sizing:border-box!important}
html body .fab-password-toggle{position:absolute;right:5px;top:50%;transform:translateY(-50%);min-width:52px;min-height:30px;padding:4px 8px;border:0;border-radius:5px;background:#eef4fc;color:#1e4c82;font:600 12px 'Segoe UI',Tahoma,sans-serif;cursor:pointer}
html body .fab-password-toggle:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
html body .fab-field-error{display:block;color:#b91c1c;font-size:12px;line-height:1.45;margin-top:5px;overflow-wrap:anywhere}
html body .fab-field-error[hidden]{display:none!important}
html body input[aria-invalid=true]{border-color:#dc2626!important}
html body .fab-account-overlay{position:fixed;inset:0;z-index:2147482000;display:flex;align-items:center;justify-content:center;padding:16px;background:#0f172a99}
html body #erpSecCard #sec_acc{margin-top:12px}

/* RC8.15: keep the shared Show/Hide control; suppress Edge's duplicate native reveal.
   Scoped to managed password fields; unrelated browser/password-manager UI is untouched. */
html body .fab-password-field input::-ms-reveal{display:none!important}

/* RC8.19: shared sales/purchase report layout; no role or business-data changes. */
#erpReportsTab.erp-view-client-sales .erp-client-sales-table th:nth-child(n){width:auto!important;white-space:normal!important}
#erpReportsTab.erp-view-client-sales .erp-client-sales-table th:nth-child(2){width:15%!important}
#erpReportsTab.erp-view-client-sales .erp-client-sales-table th:nth-child(3){width:15%!important}
#erpReportsTab.erp-view-client-sales .erp-client-sales-table td{overflow-wrap:anywhere;white-space:normal!important}
#dispatchesTab .ds-ui-kpi:last-child em,#dispatchesTab .ds-ui-kpi:nth-child(3) em{display:block!important;font-size:9px!important;line-height:1.2!important;white-space:normal!important}

/* RC8.20: stable storage-card geometry while browser status resolves. */
#erpProtCard .erp-prot-row{align-items:center;min-height:42px;box-sizing:border-box}
#erpProtCard .erp-prot-row>span:first-child{flex:0 0 43%}
#erpProtCard .erp-prot-row>span:last-child{flex:1;min-width:0;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
@media(max-width:699px){#erpProtCard .erp-prot-row{min-height:62px}}
