:root { --bg:#f4f7f6; --surface:#fff; --ink:#18302a; --muted:#6d7d78; --line:#dfe7e4; --green:#19725c; --green-dark:#105643; --green-soft:#e7f4ef; --amber:#a86012; --amber-soft:#fff4dd; --quota-warning:#ffe46b; --quota-warning-ink:#5b4300; --quota-danger:#c8463f; --red:#b4443e; --shadow:0 12px 32px rgba(26,60,50,.08); font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif; color:var(--ink); background:var(--bg); }
.auth-locked .app-shell,.auth-locked>dialog { display:none!important; }
.auth-gate { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; background:#eef4f1; overflow:auto; }
.auth-gate[hidden] { display:none; }
.auth-activity-warning { position:fixed; z-index:1100; top:16px; right:16px; width:min(460px,calc(100vw - 32px)); display:flex; align-items:flex-start; gap:12px; padding:14px 16px; border:1px solid #e8ba75; border-radius:12px; background:#fff4dd; color:#653e0d; box-shadow:var(--shadow); font-size:14px; line-height:1.5; }
.auth-activity-warning[hidden] { display:none; }
.auth-activity-warning span { flex:1; }
.auth-activity-warning button { flex:0 0 auto; padding:2px 0; border:0; background:transparent; color:#653e0d; font-weight:700; cursor:pointer; }
.auth-card { width:min(440px,100%); max-height:calc(100vh - 40px); overflow:auto; padding:28px; border:1px solid #d9e7df; border-radius:18px; background:#fff; box-shadow:var(--shadow); }
.auth-brand { display:flex; align-items:center; gap:12px; margin-bottom:26px; }
.auth-brand strong,.auth-brand small { display:block; }.auth-brand small { margin-top:3px; color:var(--muted); font-size:12px; }
.auth-card h1 { margin:0 0 8px; font-size:24px; }.auth-description { margin:0 0 18px; color:var(--muted); font-size:13px; line-height:1.6; }
.auth-form { display:grid; gap:14px; }.auth-form label { display:grid; gap:7px; color:#455a54; font-size:13px; font-weight:700; }
.auth-form input { width:100%; height:44px; padding:9px 11px; border:1px solid #cedbd7; border-radius:9px; background:#fff; color:var(--ink); }
.auth-form button { margin-top:6px; }.auth-card>.text-button { display:block; margin:15px auto 0; }
.auth-transition-panel { display:grid; gap:12px; padding:16px; border:1px solid #e8ba75; border-radius:10px; background:#fff7e8; }
.auth-transition-panel p { margin:0; color:#653e0d; font-size:13px; line-height:1.6; }
.auth-error { color:var(--red); font-size:12px; line-height:1.5; min-height:18px; }.auth-code-panel { display:grid; gap:14px; }.auth-code-panel p { margin:0; font-size:13px; line-height:1.6; }.auth-code-panel code { display:block; padding:13px; border-radius:8px; background:#f2f6f4; overflow-wrap:anywhere; user-select:all; }
.topbar-account { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:12px; }
.account-menu { position:relative; z-index:25; }
.account-menu summary { display:flex; align-items:center; gap:7px; padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font-size:13px; font-weight:700; cursor:pointer; list-style:none; }
.account-menu summary::-webkit-details-marker { display:none; }
.account-menu summary::after { content:"⌄"; color:var(--green); }
.pending-review-badge { padding:2px 6px; border-radius:999px; background:var(--amber-soft); color:var(--amber); font-size:11px; white-space:nowrap; }
.pending-review-badge.error { background:#fff0ef; color:var(--red); }
.pending-review-badge.hidden { display:none; }
.account-menu summary:focus-visible,.account-menu-items button:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.account-menu-items { position:absolute; right:0; top:calc(100% + 6px); min-width:180px; padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:var(--shadow); }
.account-menu-items button { display:block; width:100%; padding:10px 12px; border:0; border-radius:7px; background:transparent; color:var(--ink); text-align:left; cursor:pointer; }
.account-menu-items button:hover { background:var(--green-soft); }
.auth-review-panel p { margin:0 0 16px; line-height:1.6; }
.auth-review-actions { display:grid; gap:8px; }
.registration-applications { margin:22px 0; padding:16px; border:1px solid var(--line); border-radius:12px; }
.pending-review-callout { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; padding:12px 14px; border:1px solid #e8ba75; border-radius:10px; background:#fff9ed; color:#653e0d; font-size:13px; font-weight:700; }
.pending-review-callout.error { border-color:#e7b3ae; background:#fff0ef; color:var(--red); }
.pending-review-callout button { flex:0 0 auto; }
.pending-review-summary { color:var(--amber)!important; font-weight:700; }
.registration-applications h3 { margin:0 0 6px; }
.registration-applications p { margin:0 0 12px; color:var(--muted); font-size:13px; }
#review-account-dialog { max-height:min(88vh,850px); overflow:auto; width:min(660px,calc(100vw - 28px)); }
#review-account-dialog .form-actions { flex-wrap:wrap; }
.settings-password-form { max-width:450px; margin:20px 0; }.settings-password-form h3 { margin:0; }
.account-logout { margin-top:22px; padding-top:16px; border-top:1px solid var(--line); }
.permissions-table,.security-table,.audit-table { min-width:650px; width:100%; }.permissions-table th,.permissions-table td,.security-table th,.security-table td,.audit-table th,.audit-table td { padding:11px 12px; white-space:normal; vertical-align:top; }
.permissions-table th:nth-child(2),.permissions-table td:nth-child(2) { min-width:180px; }.permission-allowed { color:var(--green-dark); font-weight:700; }.audit-table td small { display:block; margin-top:4px; color:var(--muted); }.audit-table .history-changes { margin:6px 0 0; padding-left:18px; }
@media (max-width:680px) { .auth-card { padding:22px; }.topbar-account { gap:6px; }.account-menu summary { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.topbar-account .date-chip { font-size:11px; padding:8px; }.permissions-table,.security-table,.audit-table { min-width:600px; } }
@media (max-width:390px) { .pending-review-callout { align-items:flex-start; flex-direction:column; }.pending-review-callout button { width:100%; } }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; }
button,input,select,textarea { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
.app-shell { min-height:100vh; display:grid; grid-template-columns:240px minmax(0,1fr); min-width:0; }
.sidebar { position:sticky; top:0; height:100vh; padding:28px 18px; background:#153c32; color:#eef8f4; display:flex; flex-direction:column; }
.brand { display:flex; align-items:center; gap:12px; padding:0 10px 28px; }
.brand-mark { width:40px; height:40px; border-radius:12px; display:grid; place-items:center; background:#d8f0e6; color:#155442; font-weight:800; font-size:20px; }
.brand strong,.brand small { display:block; }.brand strong { font-size:18px; }.brand small { margin-top:3px; opacity:.68; }
nav { display:grid; gap:8px; }.nav-item { border:0; background:transparent; color:#bcd0ca; text-align:left; padding:13px 14px; border-radius:10px; cursor:pointer; display:flex; gap:12px; align-items:center; }.nav-item:hover,.nav-item.active { color:white; background:rgba(255,255,255,.1); }.nav-item span { width:20px; text-align:center; }
.sidebar-note { margin-top:auto; padding:14px; border-top:1px solid rgba(255,255,255,.12); font-size:13px; line-height:1.7; }.sidebar-note small { opacity:.62; }.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#7de0b2; margin-right:7px; }
main { padding:32px clamp(22px,4vw,58px) 72px; max-width:1500px; width:100%; min-width:0; margin:0 auto; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:26px; }.topbar h1 { margin:4px 0 0; font-size:30px; }.eyebrow { margin:0; text-transform:uppercase; color:var(--green); font-size:12px; font-weight:800; letter-spacing:.12em; }.date-chip { background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:9px 14px; color:var(--muted); font-size:13px; }
.page { display:none; min-width:0; animation:fade .18s ease; }.page.active { display:block; } @keyframes fade { from { opacity:.4; transform:translateY(3px); } }
.hero { border-radius:22px; padding:34px; color:white; background:linear-gradient(125deg,#1d6955,#2d8a70); display:flex; align-items:center; justify-content:space-between; box-shadow:var(--shadow); }.hero .eyebrow { color:#bfe9da; }.hero h2 { margin:8px 0; font-size:28px; }.hero p:last-child { margin:0; opacity:.8; }.hero .primary { background:white; color:var(--green-dark); }
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:20px 0; }.stats article { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:22px; }.stats span { display:block; color:var(--muted); font-size:14px; }.stats strong { display:inline-block; margin:12px 6px 0 0; font-size:34px; }.stats small { color:var(--muted); }.stats .warning-card { background:var(--amber-soft); border-color:#f4dfb8; }
.panel { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px; box-shadow:0 5px 18px rgba(22,49,42,.035); margin-bottom:18px; }.panel-title { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }.panel-title h3 { margin:0 0 5px; font-size:18px; }.panel-title p { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.tip-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }.tip-grid>div { display:flex; gap:12px; align-items:center; }.tip-grid b { display:grid; place-items:center; flex:0 0 34px; height:34px; border-radius:50%; background:var(--green-soft); color:var(--green); }.tip-grid p { margin:0; color:var(--muted); line-height:1.5; }.tip-grid strong { color:var(--ink); }
.primary,.secondary,.danger { border:0; border-radius:10px; padding:11px 17px; cursor:pointer; font-weight:700; white-space:nowrap; }.primary { background:var(--green); color:white; }.primary:hover { background:var(--green-dark); }.secondary { background:white; color:var(--green); border:1px solid #b8d1c9; }.secondary:hover { background:var(--green-soft); }.danger { color:white; background:var(--red); }.danger:hover { background:#91342f; }.small { padding:8px 12px; font-size:13px; }.button-link { text-decoration:none; display:inline-block; }
.stepper { display:flex; gap:8px; margin:0 0 18px; color:var(--muted); font-size:13px; }.stepper span { flex:1; padding:10px; text-align:center; border-bottom:3px solid var(--line); }.stepper .active { color:var(--green); border-color:var(--green); font-weight:700; }
.entry-grid { display:grid; grid-template-columns:minmax(300px,.9fr) minmax(440px,1.5fr); gap:18px; }.entry-grid>.panel:first-child { position:sticky; top:18px; align-self:start; }.upload-zone { min-height:205px; border:1.5px dashed #aac6bd; border-radius:14px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--muted); cursor:pointer; background:#fbfdfc; }.upload-zone:hover { border-color:var(--green); background:var(--green-soft); }.upload-zone input { display:none; }.upload-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:var(--green-soft); color:var(--green); font-size:24px; }.upload-zone strong { color:var(--ink); }.upload-zone small { font-size:12px; }
.image-preview { display:grid; gap:10px; }.preview-toolbar,.preview-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }.preview-toolbar { justify-content:space-between; }.button-label { display:inline-block; }.preview-note { color:var(--muted); font-size:11px; line-height:1.4; }.image-viewport { position:relative; height:clamp(320px,52vh,520px); overflow:hidden; overscroll-behavior:contain; border:1px solid var(--line); border-radius:10px; background:#e8edeb; cursor:zoom-in; outline:none; }.image-viewport:focus-visible { box-shadow:0 0 0 3px rgba(25,114,92,.16); }.image-viewport.viewing { cursor:grab; touch-action:none; }.image-viewport.dragging { cursor:grabbing; }.image-preview img { position:absolute; top:0; left:0; display:block; height:auto; max-width:none; margin:0; border-radius:6px; transform-origin:0 0; will-change:transform; user-select:none; -webkit-user-drag:none; }.image-view-hint { position:absolute; z-index:2; left:50%; bottom:10px; transform:translateX(-50%); max-width:calc(100% - 20px); padding:6px 9px; border-radius:999px; color:white; background:rgba(16,50,42,.72); font-size:11px; white-space:nowrap; pointer-events:none; }.image-viewport.viewing .image-view-hint { opacity:.75; }.preview-actions #zoom-label { min-width:96px; text-align:center; color:var(--muted); font-size:12px; }.preview-actions .recognize-image-button { margin-left:auto; }.inline-status { margin-top:12px; padding:10px 12px; background:#f5f7f6; border-radius:9px; font-size:13px; color:var(--muted); line-height:1.5; }.inline-status.success { color:var(--green-dark); background:var(--green-soft); }.inline-status.warning { color:#76501f; background:var(--amber-soft); }.inline-status.error { color:var(--red); background:#fff0ef; }
.image-evidence-layer { position:absolute; z-index:1; top:0; left:0; transform-origin:0 0; pointer-events:none; }
.image-evidence-box { position:absolute; display:block; border:4px solid #df473c; border-radius:5px; background:rgba(255,230,93,.3); box-shadow:0 0 0 2px rgba(255,255,255,.9); }
.field-evidence { margin-top:10px; border:1px solid var(--line); border-radius:9px; background:#fbfcfc; font-size:12px; }
.field-evidence summary { padding:10px 12px; color:var(--green-dark); font-weight:700; cursor:pointer; }
.field-evidence>p { margin:2px 12px 10px; color:var(--muted); line-height:1.5; }
.field-evidence-list { max-height:260px; overflow:auto; border-top:1px solid var(--line); }
.field-evidence-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:9px 12px; border-bottom:1px solid var(--line); }
.field-evidence-row:last-child { border-bottom:0; }
.field-evidence-row strong,.field-evidence-row small { display:block; overflow-wrap:anywhere; }
.field-evidence-row small { margin-top:3px; color:var(--muted); line-height:1.4; }
.field-evidence-row button { padding:6px 8px; font-size:11px; }
.field-evidence-feedback { min-height:18px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }.form-grid.three { grid-template-columns:1.4fr 1fr 1fr; }.form-grid label,.filters label { display:grid; gap:7px; color:#455a54; font-size:13px; font-weight:700; }.form-grid em { font-style:normal; color:var(--amber); font-size:11px; margin-left:5px; }.form-grid input,.form-grid select,.filters input,.filters select { width:100%; min-height:42px; border:1px solid #cedbd7; border-radius:9px; padding:9px 11px; background:white; color:var(--ink); outline:none; }.form-grid input:focus,.form-grid select:focus,.filters input:focus,.filters select:focus { border-color:var(--green); box-shadow:0 0 0 3px rgba(25,114,92,.1); }.accent-panel { border-left:4px solid var(--green); }.tag { flex:0 0 auto; white-space:nowrap; padding:5px 9px; border-radius:999px; color:var(--muted); background:#f1f4f3; font-size:11px; }.tag.required { color:var(--green-dark); background:var(--green-soft); }
.calculation-panel { border-color:#c8dbd5; }.empty { padding:25px; text-align:center; color:var(--muted); background:#f7f9f8; border-radius:10px; }.result-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }.result-grid>div { padding:14px; background:#f5f8f7; border:1px solid transparent; border-radius:10px; }.result-grid span { display:flex; align-items:center; flex-wrap:wrap; gap:7px; color:var(--muted); font-size:12px; }.result-grid strong { display:block; margin-top:7px; font-size:18px; }.result-grid .key { color:white; background:var(--green); }.result-grid .key span { color:#c9e7dd; }.result-grid .validation-error { border-color:#e6aaa6; background:#fff0ef; }.result-grid .validation-error strong { color:var(--red); }.inline-verification { display:inline-block; padding:2px 6px; border-radius:999px; font-size:10px; font-weight:700; color:#61716c; background:#e9efed; }.inline-verification.consistent { color:var(--green-dark); background:#d9eee6; }.inline-verification.mismatch,.inline-verification.error { color:white; background:var(--red); }.inline-verification.pending { color:var(--amber); background:var(--amber-soft); }.precision-note { margin:10px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }.formula-list { margin:16px 0 0; padding:14px 14px 14px 34px; background:#fbfcfc; color:var(--muted); line-height:1.8; font-size:13px; }.process-list li { padding:7px 4px; }.process-list strong { color:var(--ink); }.substitution { display:block; margin-top:3px; color:var(--green-dark); font-variant-numeric:tabular-nums; }.substitution.missing { color:var(--amber); }.mini-tag { display:inline-block; margin-left:7px; padding:1px 6px; border-radius:999px; font-size:10px; color:var(--amber); background:var(--amber-soft); }.precision-warning { padding:12px 14px; margin-bottom:16px; border-radius:10px; background:var(--amber-soft); color:#76501f; font-size:13px; line-height:1.55; }
.verification-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }.verification-card { border:1px solid var(--line); border-left:4px solid #9aa9a4; border-radius:11px; padding:14px; background:#fbfcfc; }.verification-card.consistent { border-left-color:var(--green); background:#f3faf7; }.verification-card.mismatch,.verification-card.error { border-left-color:var(--red); background:#fff6f5; }.verification-card.pending { border-left-color:var(--amber); background:#fffaf0; }.verification-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }.verification-card dl { margin:10px 0 0; }.verification-card dl div { display:flex; justify-content:space-between; gap:12px; padding:4px 0; font-size:12px; }.verification-card dt { color:var(--muted); }.verification-card dd { margin:0; text-align:right; font-weight:700; }.verification-card small { display:block; color:var(--muted); font-weight:400; }.verification-card p { margin:9px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }.review-badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px; color:#61716c; background:#edf1f0; }.review-badge.consistent { color:var(--green-dark); background:var(--green-soft); }.review-badge.mismatch,.review-badge.error { color:var(--red); background:#ffebe9; }.review-badge.pending { color:var(--amber); background:var(--amber-soft); }
.form-actions { display:flex; align-items:center; justify-content:flex-end; gap:18px; }.form-actions span { color:var(--muted); font-size:13px; }
.filters { display:flex; align-items:end; gap:12px; margin-bottom:14px; }.filters .grow { flex:1; }.scope-line { padding:9px 12px; margin-bottom:12px; border-radius:8px; background:#f2f6f4; color:#52645e; font-size:12px; }.summary-overview { display:grid; grid-template-columns:1.25fr repeat(3,1fr); border:1px solid #cbded8; border-radius:11px; overflow:hidden; background:#f4faf7; }.summary-overview>div { padding:12px 14px; border-right:1px solid #dbe8e4; }.summary-overview>div:last-child { border-right:0; }.summary-overview span,.summary-overview small { display:block; color:var(--muted); font-size:11px; }.summary-overview strong { display:block; margin-top:5px; font-size:16px; font-variant-numeric:tabular-nums; }.summary-overview small { margin-top:5px; }.summary-note { color:var(--muted); font-size:11px; line-height:1.5; margin:8px 2px 10px; }.factory-summary { margin-bottom:12px; border:1px solid var(--line); border-radius:9px; background:#fbfcfc; }.factory-summary summary { padding:10px 12px; color:var(--green-dark); font-size:13px; font-weight:700; cursor:pointer; }.factory-summary .table-wrap { border-top:1px solid var(--line); }.factory-summary table { min-width:620px; }.table-wrap { overflow:auto; max-width:100%; }.ledger-scroll { max-height:65vh; border:1px solid var(--line); border-radius:10px; }.table-wrap table { width:100%; border-collapse:separate; border-spacing:0; min-width:720px; }.ledger-table,.ledger-table.has-jiulong { width:max-content!important; min-width:100%!important; }.table-wrap th { padding:8px 7px; text-align:left; color:var(--muted); font-size:11px; border-bottom:1px solid var(--line); white-space:nowrap; background:#f7f9f8; }.ledger-table thead th { position:sticky; top:0; z-index:3; white-space:normal; line-height:1.25; vertical-align:bottom; }.ledger-table thead th small { font-size:10px; font-weight:500; }.table-wrap td { padding:8px 7px; border-bottom:1px solid #edf1ef; font-size:12px; white-space:nowrap; background:white; }.table-wrap td.number,.table-wrap th.number { text-align:right; font-variant-numeric:tabular-nums; }.table-wrap .strong-number { color:var(--green-dark); font-weight:800; }.table-wrap tbody tr:hover td { background:#fafcfb; }.ledger-table .selection-column,.ledger-table .date-column,.ledger-table .factory-column,.ledger-table .customer-column { position:sticky; z-index:2; }.ledger-table .selection-column { left:0; width:42px; min-width:42px; text-align:center; }.ledger-table .date-column { left:42px; width:92px; min-width:92px; }.ledger-table .factory-column { left:134px; width:56px; min-width:56px; }.ledger-table .customer-column { left:190px; width:96px; min-width:96px; box-shadow:5px 0 8px rgba(18,50,41,.04); }.ledger-table thead .selection-column,.ledger-table thead .date-column,.ledger-table thead .factory-column,.ledger-table thead .customer-column { z-index:4; background:#eef4f1; }.ledger-table .selection-column input { width:16px; min-height:16px; margin:0; accent-color:var(--green); }.payments-table { table-layout:fixed; min-width:880px!important; }.payments-table .date-column { width:92px; }.payments-table .customer-column { width:130px; }.payments-table .factory-column { width:128px; }.payments-table .money-column { width:132px; }.payments-table .status-column { width:112px; }.payments-table tfoot th,.payments-table tfoot td { position:sticky; bottom:0; background:#e7f4ef; border-top:2px solid #b6d5ca; font-weight:800; }.payments-table tfoot th { text-align:left; }.payments-table td.number,.payments-table th.number { padding-left:5px; padding-right:10px; }.empty-row { text-align:center; color:var(--muted); padding:34px!important; }.status-badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px; background:#edf1f0; color:var(--muted); }.status-badge.review { color:var(--amber); background:var(--amber-soft); }.status-badge.ready { color:var(--green-dark); background:var(--green-soft); }.text-button { background:none; border:0; color:var(--green); cursor:pointer; font-weight:700; }
.payments-table td:nth-child(2),.payments-table td:nth-child(3) { white-space:normal; overflow-wrap:anywhere; }
.notice { position:fixed; z-index:20; top:24px; right:30px; max-width:430px; padding:13px 18px; border-radius:10px; color:white; background:var(--green-dark); box-shadow:var(--shadow); }.notice.error { background:var(--red); }.hidden { display:none!important; }
dialog { width:min(780px,calc(100vw - 32px)); height:min(86vh,900px); max-height:86vh; border:0; border-radius:16px; padding:0; overflow:hidden; color:var(--ink); box-shadow:0 24px 80px rgba(0,0,0,.25); } dialog::backdrop { background:rgba(10,30,24,.46); }.dialog-toolbar { height:58px; padding:0 16px 0 24px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); background:white; position:sticky; top:0; z-index:5; }.dialog-close { flex:0 0 auto; border:0; background:#eef2f1; border-radius:50%; width:36px; height:36px; font-size:22px; cursor:pointer; }.dialog-close:focus-visible { outline:3px solid rgba(25,114,92,.25); }.dialog-body { height:calc(100% - 58px); overflow-y:auto; overscroll-behavior:contain; padding:24px; }.detail-head h2 { margin:0 0 5px; }.detail-image { width:100%; max-height:330px; object-fit:contain; background:#f3f5f4; border-radius:10px; }.detail-section { margin-top:22px; }.detail-section h4 { margin:0 0 10px; }.detail-list { display:grid; grid-template-columns:repeat(2,1fr); gap:8px 18px; }.detail-list div { display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--line); gap:15px; }.detail-list span { color:var(--muted); }
@media (max-width:900px) { .app-shell { grid-template-columns:1fr; }.sidebar { position:fixed; z-index:10; bottom:0; top:auto; width:100%; height:auto; padding:8px 10px calc(8px + env(safe-area-inset-bottom)); }.brand,.sidebar-note { display:none; }.sidebar nav { grid-template-columns:repeat(7,1fr); gap:2px; }.nav-item { min-width:0; justify-content:center; flex-direction:column; gap:2px; font-size:11px; padding:6px 2px; text-align:center; }.nav-item span { font-size:18px; }.nav-item.active { background:rgba(255,255,255,.12); } main { padding:22px 16px 92px; }.entry-grid { grid-template-columns:1fr; }.entry-grid>.panel:first-child { position:static; }.stats { grid-template-columns:repeat(2,1fr); }.hero { align-items:flex-start; gap:20px; }.tip-grid { grid-template-columns:1fr; }.form-grid.three { grid-template-columns:1fr; } }
@media (max-width:560px) { .topbar h1 { font-size:24px; }.date-chip { display:none; }.hero { padding:24px; display:block; }.hero h2 { font-size:23px; }.hero .primary { margin-top:20px; width:100%; }.stats { gap:10px; }.stats article { padding:16px; }.stats strong { font-size:28px; }.panel { padding:18px; border-radius:13px; }.form-grid { grid-template-columns:1fr; }.result-grid { grid-template-columns:repeat(2,1fr); }.verification-grid { grid-template-columns:1fr; }.filters { display:grid; grid-template-columns:1fr 1fr; }.filters .grow { grid-column:1 / -1; }.filters button { grid-column:1 / -1; }.form-actions { align-items:stretch; flex-direction:column; }.form-actions .primary { width:100%; }.stepper { font-size:11px; }.image-viewport { height:360px; }.preview-actions .recognize-image-button { width:100%; margin-left:0; }.summary-overview { grid-template-columns:1fr 1fr; }.summary-overview>div { border-bottom:1px solid #dbe8e4; }.summary-overview>div:nth-child(2n) { border-right:0; }.detail-list { grid-template-columns:1fr; } dialog { width:calc(100vw - 18px); max-height:88vh; }.dialog-body { padding:18px; } }
.image-viewport { height:clamp(280px,42vh,500px); }
@media (max-width:560px) { .image-viewport { height:360px; } }

/* 第五轮：全站控件基线、日期筛选与表格排版 */
button,
input,
select,
.button-link { line-height:1.25; }
.primary,
.secondary,
.danger,
.button-link { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
.small { min-height:36px; }
.form-grid input,
.form-grid select { height:44px; min-height:44px; }
.form-grid select,
.filters select {
  -webkit-appearance:none;
  appearance:none;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%2352645e' d='m5 7 5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:36px;
}
.button-link.disabled,
.button-link[aria-disabled="true"] { opacity:.5; cursor:not-allowed; pointer-events:auto; }

.filters { display:grid; align-items:end; gap:12px; margin-bottom:14px; }
.panel.has-open-date-filter { position:relative; z-index:20; overflow:visible; }
.panel.has-open-date-filter .filters { position:relative; z-index:2; }
.date-filter.open { z-index:3; }
.ledger-scroll,
.payments-scroll,
.contact-scroll { position:relative; z-index:1; }
.ledger-filters { grid-template-columns:minmax(230px,280px) minmax(128px,145px) minmax(120px,140px) minmax(190px,1fr) auto; }
.payment-filters { grid-template-columns:minmax(230px,280px) minmax(128px,145px) minmax(190px,1fr) auto; }
.filter-field,
.date-filter { min-width:0; display:grid; align-content:end; gap:7px; position:relative; color:#455a54; font-size:13px; font-weight:700; }
.filter-caption { min-height:17px; display:flex; align-items:center; line-height:17px; }
.filters input,
.filters select,
.filter-submit,
.date-filter-trigger { width:100%; height:52px; min-height:52px; }
.filter-submit { align-self:end; padding-inline:22px; }
.filter-explanation { align-self:end; min-height:52px; margin:0; display:flex; align-items:center; padding:0 2px; color:var(--muted); font-size:12px; line-height:1.6; }
.date-filter-trigger {
  border:1px solid #cedbd7;
  border-radius:9px;
  padding:7px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--ink);
  background:#fff;
  cursor:pointer;
  text-align:left;
}
.date-filter-trigger:hover { border-color:#9cbdb2; }
.date-filter-trigger:focus-visible { outline:0; border-color:var(--green); box-shadow:0 0 0 3px rgba(25,114,92,.1); }
.date-filter-trigger span { min-width:0; display:grid; gap:2px; }
.date-filter-trigger strong,
.date-filter-trigger small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.date-filter-trigger strong { font-size:13px; }
.date-filter-trigger small { color:var(--muted); font-size:10px; font-weight:500; }
.date-filter-trigger b { color:var(--muted); font-size:16px; }
.date-popover {
  position:absolute;
  z-index:100;
  top:calc(100% + 8px);
  left:0;
  width:min(660px,calc(100vw - 300px));
  min-width:560px;
  display:grid;
  grid-template-columns:200px minmax(0,1fr);
  overflow:hidden;
  border:1px solid #d7e3df;
  border-radius:14px;
  background:#fff;
  box-shadow:0 20px 56px rgba(21,60,50,.2);
  color:var(--ink);
  font-weight:400;
}
.date-presets { padding:12px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:5px; background:#f5f8f7; border-right:1px solid var(--line); }
.date-preset,
.calendar-modes button,
.calendar-header button,
.calendar-day { border:0; background:transparent; color:inherit; cursor:pointer; }
.date-preset { min-height:36px; padding:8px 10px; border-radius:8px; text-align:left; font-size:13px; }
.date-preset:hover { background:#eaf3f0; }
.date-preset.active { color:#fff; background:var(--green); font-weight:700; }
.calendar-panel { min-width:0; padding:14px 16px 15px; }
.calendar-modes { display:grid; grid-template-columns:1fr 1fr; padding:3px; border-radius:9px; background:#edf3f1; }
.calendar-modes button { min-height:34px; border-radius:7px; font-size:12px; }
.calendar-modes button.active { color:var(--green-dark); background:#fff; box-shadow:0 1px 4px rgba(21,60,50,.1); font-weight:700; }
.calendar-header { min-height:44px; display:grid; grid-template-columns:38px 1fr 38px; align-items:center; text-align:center; }
.calendar-header button { min-height:34px; border-radius:8px; font-size:22px; }
.calendar-header button:hover { background:var(--green-soft); }
.calendar-header strong { font-size:14px; }
.calendar-weekdays,
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; }
.calendar-weekdays span { padding:5px 0; color:var(--muted); font-size:11px; }
.calendar-day { position:relative; min-width:0; height:36px; border-radius:8px; font-size:12px; font-variant-numeric:tabular-nums; }
.calendar-day:hover { background:var(--green-soft); }
.calendar-day.outside { color:#a8b3af; }
.calendar-day.in-range { border-radius:0; background:#e7f4ef; }
.calendar-day.today::after { content:""; position:absolute; left:50%; bottom:3px; width:4px; height:4px; transform:translateX(-50%); border-radius:50%; background:var(--green); }
.calendar-day.selected { border-radius:8px; color:#fff; background:var(--green); font-weight:800; }
.calendar-day.selected::after { background:#fff; }
.calendar-range-status { min-height:42px; margin-top:8px; padding:8px 10px; display:grid; align-content:center; gap:3px; border-radius:8px; color:var(--muted); background:#f5f8f7; font-size:11px; }
.calendar-range-status em { color:var(--red); font-style:normal; }
.calendar-actions { margin-top:10px; display:flex; justify-content:flex-end; gap:8px; }
.calendar-hint { margin:9px 0 0; color:var(--muted); font-size:11px; text-align:center; }
.filters .date-popover button { grid-column:auto; width:auto; }

.error-text { color:var(--red); }
.summary-table { min-width:760px!important; table-layout:fixed; }
.summary-table .summary-factory { width:16%; }
.summary-table .summary-count { width:12%; }
.summary-table .summary-money { width:17%; }
.summary-table .summary-payment { width:21%; }
.summary-table th,
.summary-table td { padding:10px 12px; }
.summary-table th.count,
.summary-table td.count { text-align:center; font-variant-numeric:tabular-nums; }
.summary-table th.number,
.summary-table td.number { text-align:right; font-variant-numeric:tabular-nums; }

.payments-scroll { max-height:65vh; border:1px solid var(--line); border-radius:10px; }
.payments-table { width:100%!important; min-width:1100px!important; table-layout:fixed; }
.payments-table .date-column { width:17%; }
.payments-table .customer-column { width:12%; }
.payments-table .factory-column { width:12%; }
.payments-table .factory-amount-column { width:11%; }
.payments-table .broker-column { width:11%; }
.payments-table .profit-column { width:11%; }
.payments-table .payment-column { width:13%; }
.payments-table .status-column { width:13%; }
.payments-table th,
.payments-table td { padding:10px 11px; }
.payments-table td.number,
.payments-table th.number { padding-left:8px; padding-right:11px; }
.payments-table tbody td:first-child small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.payment-status-cell { display:flex; align-items:center; gap:8px; }
.payment-row-anomaly td { background:#fff2f0!important; border-top:1px solid #e7b6b0; border-bottom:1px solid #e7b6b0; }
.empty-state { display:grid; justify-items:center; gap:9px; padding:20px; border:1px dashed #bed2cc; border-radius:10px; background:#f8fbfa; text-align:center; }
.empty-state[hidden] { display:none!important; }
.empty-state strong { color:var(--ink); }
.empty-state span { color:var(--muted); font-size:12px; line-height:1.5; }
.payment-empty-state { min-width:0; }
.customer-empty-state { margin-top:10px; }

@media (max-width:1150px) {
  .ledger-filters { grid-template-columns:minmax(220px,1fr) minmax(140px,.6fr) minmax(130px,.55fr); }
  .ledger-filters .grow { grid-column:1 / 3; }
  .ledger-filters .filter-submit { grid-column:3; }
  .date-popover { width:min(620px,calc(100vw - 250px)); }
}

@media (max-width:900px) {
  .ledger-filters { grid-template-columns:minmax(220px,1fr) minmax(140px,.6fr) minmax(130px,.55fr); }
  .ledger-filters .grow { grid-column:1 / 3; }
  .ledger-filters .filter-submit { grid-column:3; }
  .payment-filters { grid-template-columns:minmax(230px,320px) minmax(0,1fr); }
  .date-popover { width:min(650px,calc(100vw - 32px)); min-width:0; }
}

@media (max-width:720px) {
  .date-popover {
    position:fixed;
    z-index:40;
    top:12px;
    right:12px;
    bottom:auto;
    left:12px;
    width:auto;
    min-width:0;
    max-height:calc(100vh - 94px);
    grid-template-columns:1fr;
    grid-template-rows:auto auto;
    align-content:start;
    overflow:auto;
  }
  .date-presets { grid-template-columns:repeat(4,minmax(0,1fr)); border-right:0; border-bottom:1px solid var(--line); }
  .date-preset { min-width:0; padding-inline:6px; text-align:center; }
  .calendar-panel { padding:12px; }
  .calendar-day { height:38px; }
}

@media (max-width:560px) {
  .ledger-filters,
  .payment-filters { grid-template-columns:1fr; }
  .ledger-filters .grow,
  .ledger-filters .filter-submit,
  .payment-filters>* { grid-column:1; }
  .filter-submit { width:100%; }
  .filter-explanation { min-height:auto; }
  .date-presets { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .calendar-panel { padding:10px; }
  .calendar-day { height:36px; }
  .summary-table th,
  .summary-table td,
  .payments-table th,
  .payments-table td { padding:9px 8px; }
  .payments-table { width:1100px!important; min-width:1100px!important; }
  .empty-state { justify-items:start; padding:16px; text-align:left; }
  .empty-state button { width:100%; }
}

/* 第二版：安全更正、审计、作废恢复与备份 */
.edit-banner { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:16px; padding:14px 16px; border:1px solid #e6c778; border-left:4px solid var(--amber); border-radius:11px; background:var(--amber-soft); }
.preview-toolbar.edit-locked .button-label { display:none; }
.edit-banner div { display:grid; gap:4px; }
.edit-banner span { color:#76501f; font-size:12px; line-height:1.5; }
.backup-panel { border-left:4px solid var(--green); }
.backup-status { margin-bottom:9px; padding:11px 13px; border-radius:9px; color:var(--muted); background:#f5f8f7; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.backup-status.success { color:var(--green-dark); background:var(--green-soft); }
.backup-status.error { color:var(--red); background:#fff0ef; }
.backup-status.warning { color:#76501f; background:var(--amber-soft); }
.backup-status p { margin:0; }
.backup-status p+p { margin-top:6px; }
.backup-locations { display:grid; gap:8px; margin:12px 0; }
.backup-locations .path-row { margin:0; border:1px solid var(--line); }
.backup-location-empty,.backup-content-note,.backup-limit-note { margin:0; padding:11px 13px; border-radius:9px; color:var(--muted); background:#f5f8f7; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.backup-content-note { margin-top:12px; }
.backup-location-empty.warning { color:#76501f; background:var(--amber-soft); }
.backup-limit-note { margin-top:12px; color:#76501f; background:var(--amber-soft); }
.backup-table-wrap { border:1px solid var(--line); border-radius:10px; }
.backup-table-hint { margin:0 2px 8px; color:var(--muted); font-size:11px; line-height:1.5; }
.backup-table-hint::before { content:"↔ "; color:var(--green); font-weight:800; }
.backup-table { width:100%; min-width:790px; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.backup-table th { padding:10px 9px; text-align:left; color:var(--muted); font-size:11px; white-space:nowrap; background:#f7f9f8; border-bottom:1px solid var(--line); }
.backup-table td { white-space:normal; overflow-wrap:anywhere; padding:10px 9px; color:var(--ink); font-size:12px; vertical-align:middle; border-bottom:1px solid #edf1ef; }
.backup-table th:nth-child(1) { width:25%; }
.backup-table th:nth-child(2) { width:20%; }
.backup-table th:nth-child(3) { width:20%; }
.backup-table th:nth-child(4) { width:15%; }
.backup-table th:nth-child(5) { width:20%; }
.backup-table tbody tr:last-child td { border-bottom:0; }
.backup-table td small { display:block; max-width:230px; margin-top:4px; color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.backup-row.invalid td { color:var(--red); background:#fff8f7; }
.backup-row.invalid td small { color:var(--muted); }
.backup-badge { display:inline-block; padding:4px 8px; border-radius:999px; color:var(--amber); background:var(--amber-soft); white-space:nowrap; font-size:11px; }
.backup-badge.error { color:var(--red); background:#ffebe9; }
.backup-actions { display:flex; flex-wrap:wrap; gap:6px; }
.backup-check-result { padding:8px 0 2px; }
.backup-check-pending { color:var(--muted); font-size:11px; }
.backup-result-row td { padding-top:0; background:#fbfcfc; }
.settings-home-panel { max-width:880px; }
.settings-home-panel h2,.backup-panel h2 { margin:0; font-size:19px; }
.settings-link { display:grid; grid-template-columns:42px minmax(0,1fr) 20px; align-items:center; gap:14px; width:100%; padding:16px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:#fff; text-align:left; cursor:pointer; transition:border-color .15s,background .15s,transform .15s; }
.settings-link:hover { border-color:var(--green); background:#f7fbf9; transform:translateY(-1px); }
.settings-link:focus-visible { outline:3px solid #a8d7ca; outline-offset:2px; }
.settings-link-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:11px; color:var(--green-dark); background:var(--green-soft); font-size:21px; }
.settings-link-copy { display:grid; gap:5px; min-width:0; }
.settings-link-copy strong { font-size:15px; }
.settings-link-copy small { color:var(--muted); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.settings-link-arrow { color:var(--green); font-size:28px; line-height:1; }
.activity-filters { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:12px; align-items:end; margin-bottom:16px; }
.activity-filters label { display:grid; gap:7px; min-width:0; color:#455a54; font-size:13px; font-weight:700; }
.activity-filters input,.activity-filters select { width:100%; height:44px; min-height:44px; padding:9px 11px; border:1px solid #cedbd7; border-radius:9px; background:#fff; color:var(--ink); }
.activity-filters button { min-height:44px; }
.activity-status { padding:10px 12px; margin-bottom:12px; border-radius:9px; background:#f2f6f4; color:#52645e; font-size:13px; }
.activity-status.error { background:#fff0ef; color:var(--red); }
.activity-table-wrap { max-height:65vh; border:1px solid var(--line); border-radius:10px; }
.activity-table { min-width:900px!important; }
.activity-table .activity-wrap { white-space:normal; min-width:160px; max-width:310px; overflow-wrap:anywhere; }
.activity-pagination,.activity-pagination>div,.activity-detail-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.activity-pagination { padding-top:14px; font-size:13px; color:var(--muted); }
.activity-detail { margin-top:16px; padding:16px; border:1px solid var(--line); border-radius:11px; background:#f8faf9; overflow-wrap:anywhere; }
.activity-detail h3 { margin:0; }.activity-detail p { font-size:13px; line-height:1.6; }.activity-detail table { min-width:540px; width:100%; border-collapse:collapse; }.activity-detail th,.activity-detail td { padding:9px; border-bottom:1px solid var(--line); text-align:left; font-size:12px; }
@media (max-width:900px) { .activity-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .activity-filters { grid-template-columns:1fr; }.activity-pagination { align-items:flex-start; flex-direction:column; }.activity-pagination>div { width:100%; } }
.settings-breadcrumb { margin:0 0 5px; color:var(--green); font-size:11px; font-weight:800; }
.password-toggle,.auth-form .password-toggle { display:flex; align-items:center; gap:8px; font-weight:500; }
.password-toggle input,.account-checkbox input { width:18px; height:18px; accent-color:var(--green); }
.account-create-form { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.account-create-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.permission-help { margin:0; color:var(--muted); line-height:1.6; font-size:13px; }
.permission-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0; }
.permission-group { grid-column:1/-1; margin:12px 0 0; padding-bottom:6px; border-bottom:1px solid var(--line); font-size:15px; }
.permission-option { display:grid; grid-template-columns:18px minmax(0,1fr); align-items:start; gap:10px; padding:11px; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.permission-option input { margin:3px 0 0; accent-color:var(--green); }
.permission-option strong,.permission-option small { display:block; }
.permission-option small { margin-top:3px; color:var(--muted); font-weight:400; line-height:1.5; }
.permission-account-label { display:grid; gap:7px; max-width:400px; margin-top:18px; font-weight:700; }
.permission-account-label select { height:44px; padding:8px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.account-dialog { width:min(500px,calc(100vw - 28px)); padding:24px; border:1px solid var(--line); border-radius:14px; }
.account-dialog::backdrop { background:rgba(8,34,26,.45); }
.account-dialog h2 { margin:0; }
.account-dialog .account-checkbox { display:flex; align-items:center; gap:8px; }
.access-hidden,.deny-entry [data-go="entry"],.deny-update [data-edit-record],.deny-confirm [data-order-confirmation-action="confirm"],.deny-confirm #ledger-selection-toolbar,.deny-cancel [data-order-confirmation-action="cancel"],.deny-void [data-record-action="void"],.deny-restore [data-record-action="restore"],.deny-receipt-create #new-factory-receipt,.deny-receipt-create .receipt-selection-toolbar,.deny-receipt-create [data-start-order-receipt],.deny-receipt-create [data-receipt-select],.deny-receipt-reverse [data-reverse-receipt],.deny-export #ledger-xlsx,.deny-export #payments-xlsx,.deny-export #payments-csv,.deny-supplier-write #supplier-setting-form { display:none!important; }
@media (max-width:700px) { .account-create-grid,.permission-options { grid-template-columns:1fr; } }
.backup-subtitle { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:14px; }
.backup-subtitle p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.backup-subtitle button { flex:none; }
.reason-field { display:grid; gap:7px; margin:18px 0; color:#455a54; font-size:13px; font-weight:700; }
.reason-field em { color:var(--red); font-size:11px; font-style:normal; }
.reason-field textarea { width:100%; resize:vertical; min-height:82px; padding:10px 12px; border:1px solid #cedbd7; border-radius:9px; color:var(--ink); background:#fff; }
.reason-field textarea:focus { outline:0; border-color:var(--green); box-shadow:0 0 0 3px rgba(25,114,92,.1); }
.confirm-check { display:flex; align-items:flex-start; gap:9px; margin:10px 0 18px; color:#5d4b31; font-size:13px; line-height:1.5; }
.confirm-check input { margin-top:3px; }
.detail-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.voided-banner { margin:12px 0; padding:12px 14px; border-left:4px solid var(--red); border-radius:9px; color:#7e332e; background:#fff0ef; line-height:1.55; }
.history-list { display:grid; gap:10px; }
.history-event { padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#fbfcfc; }
.history-event header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.history-event header span,.history-event>p { color:var(--muted); font-size:11px; }
.history-event>p { margin:7px 0 0; line-height:1.5; }
.history-changes { margin:9px 0 0; padding-left:20px; color:#52645e; font-size:12px; line-height:1.7; }
.change-list { margin:12px 0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.change-row { display:grid; grid-template-columns:minmax(110px,.7fr) minmax(0,1fr) 28px minmax(0,1fr); gap:10px; align-items:center; padding:9px 11px; border-bottom:1px solid var(--line); font-size:12px; }
.change-row:last-child { border-bottom:0; }
.change-row span { color:var(--muted); overflow-wrap:anywhere; }
.changed-after-value { color:#684700!important; background:#fff1a8!important; box-shadow:inset 4px 0 0 #e2a400; font-weight:800!important; }
.change-row>.changed-after-value { padding:8px 10px; border-radius:7px; }
.impact-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin:12px 0; }
.impact-grid>div { padding:10px; border-radius:9px; background:#f5f8f7; }
.impact-grid span,.impact-grid small { display:block; color:var(--muted); font-size:11px; }
.impact-grid strong { display:block; margin:5px 0; font-variant-numeric:tabular-nums; }
.impact-grid small.changed-after-value { margin-top:6px; padding:6px 8px; border-radius:6px; }
.duplicate-list { display:grid; gap:10px; margin:12px 0; }
.duplicate-item { padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#fbfcfc; }
.duplicate-item.voided { border-color:#e4b5b1; background:#fff7f6; }
.duplicate-item header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.duplicate-item p { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.path-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; margin-top:9px; padding:8px 9px; border-radius:8px; color:var(--muted); background:rgba(255,255,255,.72); font-size:11px; }
.path-row code { min-width:0; overflow-wrap:anywhere; color:var(--ink); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.path-row button { white-space:nowrap; }
.confirmation-section { margin:0 0 18px; }
.confirmation-section h4 { margin:0 0 8px; }
.confirmation-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:10px; }
.confirmation-table { width:100%; min-width:520px; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.confirmation-table th,.confirmation-table td { padding:9px 11px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.confirmation-table thead th { color:var(--muted); background:#f5f8f7; }
.confirmation-table tbody th { width:30%; color:#455a54; background:#fbfcfc; }
.confirmation-table tbody tr:last-child>* { border-bottom:0; }
.confirmation-table .after-value { color:var(--green-dark); font-weight:800; }
.confirmation-table .changed-after-value { box-shadow:inset 4px 0 0 #e2a400; }
.confirmation-table.number-table td,.confirmation-table.number-table thead th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; }
.supplier-confirmation-table th:first-child { width:34%; }
.supplier-confirmation-table td { font-variant-numeric:tabular-nums; }
.final-reason { display:grid; gap:5px; margin:2px 0 18px; padding:11px 13px; border-left:4px solid var(--green); border-radius:8px; background:var(--green-soft); }
.final-reason span { color:var(--muted); font-size:11px; }
.choice-actions { display:grid; gap:10px; }
.choice-actions button { width:100%; }
.record-row-voided td { color:#8e7774; background:#fff8f7!important; }
.status-badge.voided { color:white; background:var(--red); }
.order-confirmation-cell { min-width:116px; }
.order-confirmation-control { display:grid; justify-items:start; gap:4px; }
.order-confirmation-badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px; font-weight:700; white-space:nowrap; }
.order-confirmation-badge.pending { color:#76501f; background:var(--amber-soft); }
.order-confirmation-badge.confirmed { color:white; background:var(--green); }
.order-confirmation-badge.unavailable { color:var(--muted); background:#edf1f0; }
.confirmed-order-banner { margin:12px 0; padding:12px 14px; border-left:4px solid var(--green); border-radius:9px; color:var(--green-dark); background:var(--green-soft); line-height:1.55; }

/* 2.2 批量录入、字段来源与导出 */
.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.entry-mode-tabs { display:inline-grid; grid-template-columns:1fr 1fr; gap:4px; margin:0 0 14px; padding:4px; border-radius:11px; background:#e7efec; }
.entry-mode-tabs button { min-height:40px; padding:8px 24px; border:0; border-radius:8px; color:var(--muted); background:transparent; cursor:pointer; font-weight:700; }
.entry-mode-tabs button.active { color:var(--green-dark); background:#fff; box-shadow:0 2px 7px rgba(18,50,41,.1); }
.panel-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.batch-upload-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.batch-resume { display:flex; flex-wrap:wrap; align-content:flex-start; gap:8px; max-height:270px; overflow-y:auto; }
.batch-resume button { min-height:36px; }
.batch-resume-summary { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin-top:8px; color:var(--muted); font-size:12px; }
.batch-item-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:244px; overflow:auto; margin-top:12px; }
.batch-item-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:7px; min-width:0; }
.batch-item { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:9px; min-width:0; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fff; text-align:left; cursor:pointer; }
.batch-item-row>.batch-item { width:100%; }
.batch-remove-button { min-width:54px; padding-inline:9px; }
.batch-protected { width:62px; color:var(--muted); font-size:11px; line-height:1.35; text-align:center; }
.batch-clear-button { color:var(--red); border-color:#e7bfbb; }
.batch-item:hover,.batch-item:focus-visible { border-color:var(--green); }
.batch-item.active { border-color:var(--green); background:#eef8f4; box-shadow:inset 3px 0 0 var(--green); }
.batch-item img { width:44px; height:44px; object-fit:cover; border-radius:7px; background:#edf1f0; }
.batch-item-copy { display:grid; gap:3px; min-width:0; }
.batch-item-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-size:12px; }
.batch-item-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:11px; }
.batch-status { display:inline-flex; padding:4px 8px; border-radius:999px; color:#52645e; background:#edf1f0; font-size:11px; }
.batch-status.reviewed,.batch-status.saved { color:var(--green-dark); background:var(--green-soft); }
.batch-status.recognition_failed,.batch-status.save_failed,.batch-status.recognition_interrupted,.batch-status.save_interrupted { color:var(--red); background:#ffebe9; }
.batch-status.needs_review,.batch-status.incomplete { color:var(--amber); background:var(--amber-soft); }
.batch-review { scroll-margin-top:18px; margin-top:18px; }
.batch-review-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; padding:18px; border:1px solid var(--line); border-radius:12px; background:white; }
.batch-review-nav { display:flex; gap:8px; }
.batch-review-footer-nav { display:flex; justify-content:flex-end; margin-top:14px; padding:12px 16px 0; border-top:1px solid var(--line); }
.batch-review-footer-nav:focus-visible { outline:3px solid rgba(25,114,92,.25); outline-offset:4px; }
.batch-review-footer-nav button { min-width:132px; }
.batch-record-form { display:grid; gap:18px; }
.batch-record-form .entry-grid { margin:0; }
.batch-record-form .image-viewport { touch-action:none; }
.batch-record-form .image-viewport.viewing { cursor:grab; }
.batch-record-form .image-viewport.dragging { cursor:grabbing; }
.batch-record-form .inline-status { overflow-wrap:anywhere; }
@media (max-width:700px) { .entry-mode-tabs { width:100%; }.entry-mode-tabs button { padding-inline:8px; }.panel-actions { width:100%; justify-content:stretch; }.panel-actions>* { flex:1; }.batch-upload-panel .panel-title,.batch-list-panel .panel-title { display:grid; gap:12px; }.batch-upload-actions { display:grid; width:100%; }.batch-upload-panel .button-label { display:block; width:100%; text-align:center; }.batch-item-list { grid-template-columns:1fr; }.batch-review-header { display:grid; }.batch-review-nav { justify-content:space-between; }.batch-review-footer-nav { padding-inline:0; }.batch-review-footer-nav button { width:100%; } }
.order-confirmation-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:14px 0 18px; }
.order-confirmation-summary>div { display:grid; gap:5px; min-width:0; padding:11px 13px; border:1px solid var(--line); border-radius:9px; background:#f8faf9; }
.order-confirmation-summary span { color:var(--muted); font-size:11px; }
.order-confirmation-summary strong { overflow-wrap:anywhere; font-size:14px; }
#change-dialog,#final-change-dialog,#record-action-dialog,#order-confirmation-dialog,#duplicate-dialog { width:min(720px,calc(100vw - 32px)); height:auto; max-height:86vh; }
#edit-new-dialog { width:min(520px,calc(100vw - 32px)); height:auto; max-height:86vh; }
#account-leave-dialog { width:min(560px,calc(100vw - 32px)); height:fit-content; max-height:86vh; }
#account-leave-dialog .dialog-body { height:auto; }
#batch-manage-dialog { width:min(520px,calc(100vw - 32px)); height:auto; max-height:86vh; }

@media (max-width:680px) {
  .backup-subtitle { align-items:stretch; flex-direction:column; }
  .backup-subtitle button { width:100%; }
  .backup-panel .panel-title { align-items:flex-start; }
  .backup-panel .panel-title>button { flex:none; }
  .settings-link { grid-template-columns:36px minmax(0,1fr) 16px; gap:10px; padding:13px; }
  .settings-link-icon { width:36px; height:36px; }
  .edit-banner { align-items:stretch; flex-direction:column; }
  .change-row { grid-template-columns:1fr; gap:3px; }
  .change-row b { display:none; }
  .impact-grid { grid-template-columns:1fr; }
  .path-row { grid-template-columns:1fr; }
  .path-row button { width:100%; }
  .confirmation-table { min-width:100%; font-size:11px; }
  .confirmation-table th,.confirmation-table td { padding:8px 7px; }
  .confirmation-table tbody th,.supplier-confirmation-table th:first-child { width:28%; }
  .order-confirmation-summary { grid-template-columns:1fr; }
}

/* 独立汇总页、额度税务表格与弹层层叠 */
.summary-filters { grid-template-columns:minmax(230px,280px) minmax(138px,160px) minmax(190px,1fr) auto auto; }
.tax-filters { grid-template-columns:minmax(138px,160px) minmax(230px,1fr) auto auto; }
.supplier-alert-panel { border-left:4px solid #c89800; background:#fffdf2; }
.supplier-alert-panel.has-exceeded { border-left-color:var(--quota-danger); }
.supplier-alert-list { margin-bottom:14px; }
.alert-scroll { border:1px solid #e7d797; border-radius:10px; }
.supplier-alert-panel.has-exceeded .alert-scroll { border-color:#efc3bf; }
.alert-table { min-width:1080px!important; table-layout:fixed; }
.alert-table th:nth-child(1) { width:17%; }
.alert-table th:nth-child(2) { width:9%; }
.alert-table th:nth-child(3) { width:20%; }
.alert-table th:nth-child(n+4):nth-child(-n+6) { width:13%; }
.alert-table th:nth-child(7) { width:10%; }
.alert-table th:last-child { width:72px; }
.alert-table .wrap-text { white-space:normal; overflow-wrap:anywhere; }
.alert-table .alert-remaining { font-weight:800; }
.alert-table .alert-remaining.warning { color:var(--quota-warning-ink); background:var(--quota-warning); }
.alert-table .alert-remaining.exceeded { color:#fff; background:var(--quota-danger); }

.contact-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:5px; margin-bottom:18px; border-radius:11px; background:#edf3f1; }
.contact-tabs button { min-height:42px; border:0; border-radius:8px; color:#52645e; background:transparent; cursor:pointer; font-weight:700; }
.contact-tabs button.active { color:var(--green-dark); background:#fff; box-shadow:0 2px 8px rgba(21,60,50,.09); }
.contact-module { display:none; }
.contact-module.active { display:block; }
.contact-view { min-width:0; }
.contact-scroll { max-height:61vh; border:1px solid var(--line); border-radius:10px; }
.contact-table { min-width:900px!important; table-layout:fixed; }
.contact-table th,.contact-table td { padding:10px 11px; }
.contact-table th:first-child { width:145px; }
.contact-table th.count { width:104px; }
.supplier-contact-table { min-width:990px!important; }
.supplier-contact-table th:nth-child(2) { width:96px; }
.customer-contact-table th:last-child { width:112px; }
.contact-table .wrap-text { white-space:normal; overflow-wrap:anywhere; }
.contact-table .count { text-align:center; font-variant-numeric:tabular-nums; }
.contact-table .count small { display:block; margin-top:3px; color:var(--muted); }
.contact-table .key-money { color:var(--green-dark); background:#eef8f4; font-weight:800; }
.contact-table .negative { color:var(--red); }
.contact-table tfoot th,.contact-table tfoot td { position:sticky; bottom:0; z-index:2; border-top:2px solid #b6d5ca; background:#e7f4ef; font-weight:800; }
.contact-table tfoot .key-money { background:#d7eee6; }

.estimate-disclaimer { margin-bottom:14px; padding:12px 14px; border:1px solid #ecd7ab; border-radius:10px; color:#75501d; background:var(--amber-soft); font-size:12px; line-height:1.65; }
.estimate-disclaimer p { margin:5px 0 0; }
.profile-table-section { margin-top:18px; min-width:0; }
.profile-table-section h4 { margin:0 0 4px; font-size:16px; }
.profile-table-section>p { margin:0 0 9px; color:var(--muted); font-size:11px; line-height:1.5; }
.quota-table { min-width:1320px!important; }
.quota-table th:nth-child(1) { width:190px; }
.quota-table th:nth-child(2) { width:78px; }
.quota-table th:nth-child(3) { width:300px; }
.quota-table th:nth-child(4),
.quota-table th:nth-child(5),
.quota-table th:nth-child(6) { width:145px; }
.quota-table th:nth-child(7) { width:142px; }
.quota-table th:nth-child(8) { width:105px; }
.quota-table .period-cell { white-space:normal; line-height:1.45; }
.supplier-name-actions { display:grid; gap:5px; align-items:start; }
.supplier-name-actions>span { display:flex; flex-wrap:wrap; gap:3px 8px; }
.text-button.compact { padding:0; min-height:24px; font-size:11px; }
.remaining-header,
.remaining-money { color:#fff!important; background:var(--green)!important; font-weight:800; }
.remaining-money.warning { color:var(--quota-warning-ink)!important; background:var(--quota-warning)!important; }
.remaining-money.exceeded { color:#fff!important; background:var(--quota-danger)!important; }
.remaining-money.unavailable,
.remaining-money.not_started { color:var(--muted)!important; background:#f2f5f4!important; }
.quota-state { display:inline-block; padding:4px 7px; border-radius:999px; color:var(--muted); background:#edf1f0; font-size:11px; font-weight:700; white-space:nowrap; }
.quota-state.available { color:var(--green-dark); background:var(--green-soft); }
.quota-state.warning { color:var(--quota-warning-ink); background:var(--quota-warning); }
.quota-state.exceeded { color:#fff; background:var(--quota-danger); }
.tax-table { min-width:850px!important; }
.tax-table th:nth-child(1) { width:22%; }
.tax-table th:nth-child(2) { width:11%; }
.tax-table th:nth-child(n+3) { width:16.75%; }
.due-money { color:var(--red); background:#fff7f6!important; font-weight:800; }
.refund-money { color:var(--green-dark); background:#f2faf7!important; font-weight:800; }

.focus-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,300px); gap:18px; align-items:end; margin:16px 0 18px; padding:16px 18px; border:1px solid #b9d7cd; border-radius:12px; background:linear-gradient(135deg,#f3faf7,#fff); }
.focus-card h4 { margin:2px 0 6px; color:var(--green-dark); font-size:20px; }
.focus-card h4 small { color:var(--muted); font-size:13px; }
.focus-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.focus-card .eyebrow { color:var(--green); }
.focus-card.selected { display:block; }
.focus-heading { display:flex; gap:18px; align-items:end; justify-content:space-between; }
.focus-select { display:grid; gap:6px; min-width:250px; color:var(--muted); font-size:11px; font-weight:700; }
.focus-select select { min-height:42px; padding:0 34px 0 11px; border:1px solid #bfd0ca; border-radius:9px; background:#fff; }
.focus-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin-top:14px; border:1px solid #c8ddd6; border-radius:10px; overflow:hidden; }
.focus-metrics>div { display:grid; gap:5px; min-width:0; padding:11px 13px; border-right:1px solid #d8e6e1; background:#fff; }
.focus-metrics>div:last-child { border-right:0; }
.focus-metrics span,.focus-metrics small { color:var(--muted); font-size:11px; }
.focus-metrics strong { font-size:17px; font-variant-numeric:tabular-nums; }
.focus-metrics .negative { color:var(--red); }
.focus-metrics .quota-focus.warning { background:#fff7c2; box-shadow:inset 0 0 0 2px var(--quota-warning); }
.focus-metrics .quota-focus.warning strong,
.focus-metrics .quota-focus.warning small { color:var(--quota-warning-ink); }
.focus-metrics .quota-focus.exceeded { background:#fff1f0; box-shadow:inset 0 0 0 2px #e8aaa5; }
.focus-metrics .quota-focus.exceeded strong,
.focus-metrics .quota-focus.exceeded small { color:var(--quota-danger); }
.quota-estimate { margin-top:16px; padding:15px; border:1px solid #c8ddd6; border-radius:10px; background:#f8fbfa; }
.quota-estimate-heading h5 { margin:0 0 5px; color:var(--green-dark); font-size:15px; }
.quota-estimate-heading p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.quota-estimate-form { display:flex; align-items:end; gap:9px; margin-top:13px; }
.quota-estimate-form label { display:grid; gap:6px; min-width:0; width:min(100%,360px); color:var(--muted); font-size:11px; font-weight:700; }
.quota-estimate-form input { min-height:42px; padding:0 11px; border:1px solid #bfd0ca; border-radius:9px; background:#fff; color:var(--ink); font:inherit; font-size:14px; }
.quota-estimate-form button { min-height:42px; }
.quota-estimate-result:empty { display:none; }
.quota-estimate-message { margin:12px 0 0; padding:10px 12px; border-radius:8px; color:var(--muted); background:#edf3f1; font-size:12px; line-height:1.55; }
.quota-estimate-message.invalid,.quota-estimate-message.blocked { color:#8a3f36; background:#fff0ef; }
.quota-estimate-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:12px; }
.quota-estimate-metrics>div { display:grid; align-content:start; gap:5px; min-width:0; padding:10px 11px; border:1px solid #dbe7e3; border-radius:8px; background:#fff; }
.quota-estimate-metrics span,.quota-estimate-metrics small { color:var(--muted); font-size:10px; line-height:1.4; }
.quota-estimate-metrics strong { overflow-wrap:anywhere; font-size:15px; font-variant-numeric:tabular-nums; }
.quota-estimate-metrics .quota-estimate-after.available { border-color:#b9d7cd; background:#f0faf5; }
.quota-estimate-metrics .quota-estimate-after.warning { border-color:#e2c964; background:#fff7c2; }
.quota-estimate-metrics .quota-estimate-after.warning strong,.quota-estimate-metrics .quota-estimate-after.warning small { color:var(--quota-warning-ink); }
.quota-estimate-metrics .quota-estimate-after.exceeded { border-color:#e8aaa5; background:#fff1f0; }
.quota-estimate-metrics .quota-estimate-after.exceeded strong,.quota-estimate-metrics .quota-estimate-after.exceeded small { color:var(--quota-danger); }

#supplier-setting-dialog { width:min(650px,calc(100vw - 32px)); height:auto; }
.supplier-setting-form { height:auto; }
.supplier-setting-form .form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.supplier-setting-form .quota-input { padding:11px; border:1px solid #b8d7cc; border-radius:10px; background:#f1faf7; }
.automatic-start { display:grid; align-content:start; gap:6px; padding:11px; border:1px solid var(--line); border-radius:10px; background:#f7f9f8; }
.automatic-start span,.automatic-start small { color:var(--muted); font-size:11px; line-height:1.45; }
.automatic-start strong { color:var(--green-dark); line-height:1.4; }
.supplier-setting-form .form-actions { margin-top:18px; }
.setting-identity { display:grid; gap:5px; margin-bottom:17px; padding:13px 14px; border-radius:10px; background:var(--green-soft); }
.setting-identity span { color:var(--muted); font-size:11px; }
.setting-identity strong { color:var(--green-dark); font-size:17px; overflow-wrap:anywhere; }
.setting-explanation { margin-top:15px; padding:11px 13px; border-radius:9px; color:var(--muted); background:#f5f7f6; font-size:12px; line-height:1.65; }

@media (max-width:1150px) {
  .summary-filters { grid-template-columns:minmax(220px,1fr) minmax(138px,.65fr) minmax(190px,1fr) auto auto; }
}

@media (max-width:900px) {
      .sidebar nav { grid-template-columns:repeat(7,1fr); }
  .summary-filters { grid-template-columns:minmax(230px,1fr) minmax(145px,.55fr) auto auto; }
  .summary-filters .grow { grid-column:1 / 3; }
  .tax-filters { grid-template-columns:minmax(145px,.55fr) minmax(230px,1fr) auto auto; }
  .nav-item { font-size:10px; }
  main { padding-bottom:92px; }
  .focus-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .focus-metrics>div:nth-child(3) { border-right:0; }
  .focus-metrics>div:nth-child(n+4) { border-top:1px solid #d8e6e1; }
  .quota-estimate-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width:680px) {
  .supplier-setting-form .form-grid { grid-template-columns:1fr; }
  .summary-filters,.tax-filters { grid-template-columns:1fr; }
  .summary-filters>*,.tax-filters>* { grid-column:1; }
  .focus-card { grid-template-columns:1fr; align-items:stretch; }
  .focus-heading { display:grid; }
  .focus-select { min-width:0; }
}

@media (max-width:560px) {
  .summary-filters,.tax-filters { grid-template-columns:1fr; }
  .summary-filters>*,.tax-filters>* { grid-column:1; }
  .contact-scroll { max-height:58vh; }
  .focus-card { grid-template-columns:1fr; align-items:stretch; }
  .focus-heading { display:grid; }
  .focus-select { min-width:0; }
  .focus-metrics { grid-template-columns:1fr 1fr; }
  .focus-metrics>div { border-top:1px solid #d8e6e1; }
  .focus-metrics>div:nth-child(-n+2) { border-top:0; }
  .focus-metrics>div:nth-child(2n) { border-right:0; }
  .quota-estimate-form { align-items:stretch; flex-direction:column; }
  .quota-estimate-form label { width:100%; }
  .quota-estimate-form button { width:100%; }
  .quota-estimate-metrics { grid-template-columns:1fr 1fr; }
.quota-estimate-metrics strong { font-size:13px; white-space:nowrap; }
}

/* 2.4 台账批量确认与独立纸厂回款 */
.ledger-selection-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:10px 0 12px; padding:10px 12px; border:1px solid #d4e4de; border-radius:10px; background:#f6faf8; }
.ledger-selection-toolbar>span { color:var(--green-dark); font-size:12px; font-weight:800; white-space:nowrap; }
.selection-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.selection-actions button:disabled { opacity:.55; cursor:not-allowed; }
.batch-confirm-failures { max-height:240px; overflow:auto; padding:12px 14px 12px 30px; border-radius:9px; color:#7d3933; background:#fff6f5; font-size:12px; line-height:1.7; }
.batch-confirm-failures code { font-size:10px; }
.receipt-filters { grid-template-columns:minmax(230px,280px) minmax(138px,160px) auto; }
.factory-receipts-panel>.precision-warning { margin:14px 0; }
.receipt-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:14px 0 20px; border:1px solid #cbded8; border-radius:11px; overflow:hidden; background:#f4faf7; }
.receipt-summary>div { display:grid; align-content:start; gap:5px; min-width:0; padding:12px 14px; border-right:1px solid #dbe8e4; }
.receipt-summary>div:last-child { border-right:0; }
.receipt-summary span,.receipt-summary small { color:var(--muted); font-size:11px; line-height:1.45; }
.receipt-summary strong { overflow-wrap:anywhere; font-size:16px; font-variant-numeric:tabular-nums; }
.receipt-orders-section,.receipt-history-section { margin-top:22px; }
.receipt-orders-section>.panel-title,.receipt-history-section>.panel-title { margin-bottom:9px; }
.receipt-orders-section .panel-title h4,.receipt-history-section .panel-title h4 { margin:0 0 4px; }
.receipt-orders-section .panel-title p,.receipt-history-section .panel-title p { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.receipt-table-wrap { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:10px; }
.receipt-table { width:100%; min-width:930px; border-collapse:separate; border-spacing:0; }
.receipt-table th { padding:9px 10px; color:var(--muted); background:#f4f7f6; border-bottom:1px solid var(--line); font-size:11px; text-align:left; white-space:nowrap; }
.receipt-table td { padding:9px 10px; border-bottom:1px solid #edf1ef; background:#fff; font-size:12px; vertical-align:middle; }
.receipt-table tbody tr:last-child td { border-bottom:0; }
.receipt-table th.number,.receipt-table td.number { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.receipt-table td small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.receipt-status { display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px; font-weight:700; white-space:nowrap; }
.receipt-status.unpaid { color:#76501f; background:var(--amber-soft); }
.receipt-status.partial { color:#775c00; background:#fff1b9; }
.receipt-status.paid,.receipt-status.active { color:var(--green-dark); background:var(--green-soft); }
.receipt-status.reversed { color:#8b3933; background:#ffebe9; }
.receipt-confirmation-note { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; padding:10px 12px; border:1px solid #ead5a8; border-radius:9px; color:#76501f; background:var(--amber-soft); font-size:12px; line-height:1.5; }
.receipt-confirmation-note button { flex:none; }
.receipt-confirmation-needed { color:#9a630d!important; font-weight:700; }
.receipt-row-reversed td { color:#8c7a78; background:#fffafa; }
.receipt-allocation-list { min-width:220px; white-space:normal; }
.receipt-allocation-list span { display:block; line-height:1.5; }
.danger-text { color:var(--red); }
.factory-receipt-form { height:auto; }
.factory-receipt-form .receipt-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
.receipt-allocation-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:20px 0 10px; }
.receipt-allocation-heading>div { display:grid; gap:4px; }
.receipt-allocation-heading small { color:var(--muted); font-size:11px; line-height:1.45; }
.receipt-allocation-row { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(145px,.8fr) auto; align-items:end; gap:9px; margin-bottom:8px; padding:11px; border:1px solid var(--line); border-radius:9px; background:#fbfcfc; }
.receipt-allocation-row label { display:grid; gap:6px; color:#455a54; font-size:12px; font-weight:700; }
.receipt-allocation-row input,.receipt-allocation-row select { width:100%; min-height:40px; min-width:0; padding:8px 10px; border:1px solid #cedbd7; border-radius:8px; color:var(--ink); background:white; }
.receipt-allocation-total { margin:10px 0 0; padding:10px 12px; border-radius:8px; color:#76501f; background:var(--amber-soft); font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; }
.receipt-allocation-total.valid { color:var(--green-dark); background:var(--green-soft); }
.receipt-allocation-total.invalid { color:#76501f; background:var(--amber-soft); }
#batch-order-confirmation-dialog,#factory-receipt-dialog,#factory-receipt-reversal-dialog { width:min(760px,calc(100vw - 32px)); height:auto; max-height:88vh; }
#factory-receipt-dialog { width:min(800px,calc(100vw - 32px)); }

@media (max-width:900px) {
  .receipt-filters { grid-template-columns:minmax(220px,1fr) minmax(138px,.65fr) auto; }
}
@media (max-width:680px) {
  .receipt-confirmation-note { align-items:flex-start; flex-direction:column; }
  .ledger-selection-toolbar { align-items:stretch; flex-direction:column; }
  .selection-actions { display:grid; grid-template-columns:1fr 1fr; }
  .selection-actions #ledger-confirm-selected { grid-column:1 / -1; }
  .receipt-summary { grid-template-columns:1fr 1fr; }
  .receipt-summary>div:nth-child(2n) { border-right:0; }
  .receipt-summary>div:nth-child(n+3) { border-top:1px solid #dbe8e4; }
  .receipt-filters { grid-template-columns:1fr; }
  .factory-receipt-form .receipt-fields { grid-template-columns:1fr; }
  .receipt-allocation-heading { align-items:stretch; flex-direction:column; }
  .receipt-allocation-heading button { width:100%; }
  .receipt-allocation-row { grid-template-columns:1fr; }
  .receipt-allocation-row button { width:100%; }
}

.receipt-filters { grid-template-columns:minmax(220px,280px) minmax(138px,160px) minmax(210px,1fr) auto; }
.receipt-balance-section,.receipt-actuals-section { margin-top:16px; }
.receipt-balance-section>.panel-title,.receipt-actuals-section>.panel-title { margin-bottom:9px; }
.receipt-balance-section .panel-title h4,.receipt-actuals-section .panel-title h4 { margin:0 0 4px; }
.receipt-balance-section .panel-title p,.receipt-actuals-section .panel-title p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.order-balance-summary { margin:0; grid-template-columns:repeat(4,minmax(0,1fr)); border-color:#b8d5ca; background:#f0f8f4; }
.order-balance-summary .receipt-summary-primary { background:#e4f2eb; }
.order-balance-summary .receipt-summary-primary strong { color:#17634d; font-size:21px; }
.actual-receipt-summary { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; border-color:#d7e0dd; background:#f7f9f8; }
.receipt-selection-toolbar { margin:14px 0 18px; }
.receipt-selection-toolbar>span { white-space:normal; font-variant-numeric:tabular-nums; }
.receipt-orders-table { min-width:1060px; }
.receipt-date-cell { min-width:110px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.receipt-date-cell span { display:block; line-height:1.5; }
.receipt-group-heading th { padding:10px 12px; color:var(--green-dark); background:#edf6f1; border-top:1px solid #d9e8e1; text-align:left; font-size:12px; }
.receipt-group-total td { color:#285a4b; background:#f4f8f6; border-top:1px solid #d8e5df; font-weight:800; }
.receipt-group-total td.strong-number { color:#17634d; }
.receipt-grand-total td { color:#17634d; background:#e7f3ed; border-top:1px solid #c6ded2; font-weight:800; }
.receipt-confirm-dialog { width:min(790px,calc(100vw - 32px)); height:auto; max-height:88vh; }
.receipt-date-field { display:grid; gap:6px; max-width:300px; margin:12px 0 16px; color:#455a54; font-size:12px; font-weight:700; }
.receipt-date-field input { width:100%; min-height:40px; padding:8px 10px; border:1px solid #cedbd7; border-radius:8px; color:var(--ink); background:#fff; }
.receipt-confirm-preview { margin:12px 0; }
.receipt-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; border:1px solid #d9e5e0; border-radius:10px; overflow:hidden; }
.receipt-preview-grid>div { min-width:0; padding:11px 13px; border-bottom:1px solid #e8efec; }
.receipt-preview-grid>div:nth-child(odd) { border-right:1px solid #e8efec; }
.receipt-preview-grid dt { color:var(--muted); font-size:11px; }
.receipt-preview-grid dd { margin:5px 0 0; overflow-wrap:anywhere; font-size:13px; font-weight:700; }
.receipt-preview-grid .receipt-preview-amount { grid-column:1 / -1; background:#eff8f3; }
.receipt-preview-grid .receipt-preview-amount dd { color:#17634d; font-size:20px; font-variant-numeric:tabular-nums; }
.receipt-preview-action { justify-content:flex-start; margin:0 0 10px; }
.receipt-preview-table { min-width:600px; }
.receipt-preview-table td,.receipt-preview-table th { padding:8px; }

@media (max-width:900px) {
  .receipt-filters { grid-template-columns:minmax(220px,1fr) minmax(138px,.7fr); }
  .receipt-filters .filter-submit { width:100%; }
  .order-balance-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:680px) {
  .receipt-filters { grid-template-columns:1fr; }
  .receipt-filters .filter-submit { width:100%; }
  .receipt-selection-toolbar { align-items:stretch; flex-direction:column; }
  .receipt-selection-toolbar .selection-actions { display:grid; grid-template-columns:1fr; }
  .receipt-selection-toolbar .selection-actions button { width:100%; }
  .receipt-selection-toolbar .selection-actions #receipt-register-selected { grid-column:auto; }
  .order-balance-summary,.actual-receipt-summary { grid-template-columns:1fr 1fr; }
  .order-balance-summary .receipt-summary-primary { grid-column:1 / -1; }
  .receipt-preview-grid { grid-template-columns:1fr 1fr; }
  .receipt-preview-grid>div:nth-child(odd) { border-right:1px solid #e8efec; }
  .receipt-preview-grid .receipt-preview-amount { grid-column:1 / -1; }
  .receipt-confirm-dialog { width:calc(100vw - 24px); max-height:92vh; }
}

@media (max-width:680px) {
  .factory-receipts-panel>.panel-title { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
  .factory-receipts-panel>.panel-title>div { min-width:0; }
  .factory-receipts-panel>.panel-title>button { width:100%; white-space:normal; }
  .receipt-filters { grid-template-columns:minmax(0,1fr); }
  .receipt-filters>* { min-width:0; }
}

.export-dialog { width:min(1060px,calc(100vw - 24px)); max-height:92vh; height:min(92vh,950px); }
.export-dialog-body { display:grid; grid-auto-rows:max-content; align-content:start; gap:14px; }
.export-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.export-filters label { display:grid; align-content:end; gap:7px; min-width:0; color:#455a54; font-size:13px; font-weight:700; }
.export-filters label[hidden] { display:none; }
.export-filters input,.export-filters select { width:100%; height:52px; min-height:52px; min-width:0; border:1px solid #cedbd7; border-radius:9px; padding:9px 11px; background:#fff; color:var(--ink); }
.export-filters input:focus,.export-filters select:focus { outline:0; border-color:var(--green); box-shadow:0 0 0 3px rgba(25,114,92,.1); }
.export-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; color:var(--muted); font-size:13px; }
.export-table-wrap { max-width:100%; height:clamp(160px,32vh,260px); min-height:160px; overflow:auto; border:1px solid var(--line); border-radius:10px; }
.export-table { width:100%; min-width:770px; border-collapse:separate; border-spacing:0; }
.export-table th { position:sticky; top:0; z-index:1; background:#f2f6f4; color:var(--muted); text-align:left; font-size:12px; }
.export-table th,.export-table td { padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.export-table td { font-size:12px; }
.export-table td:nth-child(5),.export-table th:nth-child(5) { text-align:right; font-variant-numeric:tabular-nums; }
.export-table input[type="checkbox"],.export-column-grid input[type="checkbox"] { width:17px; height:17px; accent-color:var(--green); }
.export-column-section { padding:12px; border:1px solid var(--line); border-radius:10px; }
.export-column-section h4 { margin:0 0 10px; }
.export-column-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 14px; }
.export-column-grid label { display:flex; align-items:center; gap:8px; min-width:0; font-size:12px; }
.export-preview-details { min-height:40px; padding:10px 12px; border-radius:9px; background:#f2f6f4; color:var(--green-dark); font-size:13px; line-height:1.6; }
.export-preview-details:empty { display:none; }
@media (max-width:760px) { .export-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }.export-column-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:460px) { .export-dialog { width:calc(100vw - 16px); max-height:94vh; height:94vh; }.export-dialog-body { padding:14px; }.export-filters,.export-column-grid { grid-template-columns:minmax(0,1fr); }.export-actions>button { width:100%; }.export-dialog .form-actions { display:grid; grid-template-columns:1fr; }.export-dialog .form-actions button { width:100%; } }

/* 手机查看是登录会话模式；屏幕宽度只控制排版，不改变授权。 */
.auth-mode-choice { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 10px; }
.auth-mode-choice button { min-height:44px; border:1px solid var(--line); border-radius:9px; color:var(--green-dark); background:#fff; font-weight:700; cursor:pointer; }
.auth-mode-choice button[aria-pressed="true"] { border-color:var(--green); background:var(--green-soft); box-shadow:inset 0 0 0 1px var(--green); }
.auth-mode-hint { margin:0 0 15px; color:var(--muted); font-size:12px; line-height:1.55; }
.mobile-nav,.mobile-record-list,.mobile-filter-toggle { display:none; }
.view-mode-banner { margin:-10px 0 17px; padding:10px 13px; border:1px solid #c5dfd4; border-radius:9px; background:var(--green-soft); color:var(--green-dark); font-size:12px; font-weight:700; line-height:1.5; }
body.mobile-view .app-shell { grid-template-columns:minmax(0,1fr); }
body.mobile-view .sidebar { display:none; }
body.mobile-view .mobile-nav { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:3px; position:fixed; z-index:30; bottom:0; left:0; width:100%; padding:7px max(5px,env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-right)); border-top:1px solid rgba(255,255,255,.16); background:#153c32; box-shadow:0 -6px 22px rgba(15,45,36,.16); }
body.mobile-view .mobile-nav .nav-item { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:0; min-height:50px; padding:5px 2px; color:#c8ded5; text-align:center; font-size:11px; }
body.mobile-view .mobile-nav .nav-item span { font-size:19px; }
body.mobile-view .mobile-nav .nav-item.active { color:#fff; background:rgba(255,255,255,.15); }
body.mobile-view .mobile-nav .access-hidden { display:none!important; }
body.mobile-view main { width:100%; max-width:860px; padding:18px 14px calc(108px + env(safe-area-inset-bottom)); }
body.mobile-view .topbar { gap:8px; align-items:flex-start; margin-bottom:16px; }
body.mobile-view .topbar h1 { font-size:26px; }
body.mobile-view .topbar-account { min-width:0; }
body.mobile-view .topbar-account .date-chip { display:none; }
body.mobile-view .account-menu summary { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.mobile-view .hero { padding:20px; }
body.mobile-view .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
body.mobile-view .stats article { min-width:0; padding:14px; }
body.mobile-view .stats strong { font-size:26px; overflow-wrap:anywhere; }
body.mobile-view .tip-grid { grid-template-columns:1fr; }
body.mobile-view .panel { padding:16px; }
body.mobile-view .panel-title { flex-wrap:wrap; gap:9px; }
body.mobile-view .mobile-filter-toggle { display:flex; width:100%; margin:0 0 9px; }
body.mobile-view .filters.mobile-filter-collapsed { display:none!important; }
body.mobile-view .filters { grid-template-columns:minmax(0,1fr); }
body.mobile-view .filters>* { min-width:0; grid-column:1!important; }
body.mobile-view .filters button { width:100%; }
body.mobile-view .date-popover .date-popover-header button { width:auto; }
body.mobile-view .date-popover { max-height:calc(100dvh - 94px); }
body.mobile-view .date-popover-header { position:sticky; top:0; z-index:2; }
body.mobile-view .date-popover .calendar-modes button,body.mobile-view .date-popover .calendar-header button,body.mobile-view .date-popover .date-preset,body.mobile-view .date-popover .calendar-day { width:auto; }
body.mobile-view .scope-line { overflow-wrap:anywhere; line-height:1.6; }
body.mobile-view .ledger-scroll,body.mobile-view .payments-scroll { display:none; }
body.mobile-view .mobile-record-list { display:grid; gap:10px; margin-top:12px; }
.mobile-record-card { min-width:0; padding:13px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.mobile-record-head,.mobile-record-foot { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.mobile-record-head strong { min-width:0; overflow-wrap:anywhere; font-size:15px; }
.mobile-record-head>span { flex:none; color:var(--muted); font-size:11px; }
.mobile-record-card p { margin:7px 0; color:var(--muted); font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.mobile-record-money { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:10px 0; border-top:1px solid var(--line); }
.mobile-record-money small { color:var(--muted); }
.mobile-record-money strong { color:var(--green-dark); font-size:17px; text-align:right; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.mobile-record-foot { align-items:center; }
.mobile-record-foot button { flex:none; }
.mobile-record-foot { flex-wrap:wrap; }
.mobile-card-select { display:flex; align-items:center; gap:8px; margin:9px 0; font-size:12px; color:var(--ink); }
.mobile-card-select input { flex:none; width:18px; height:18px; margin:0; }
.mobile-card-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; min-width:0; }
.mobile-card-actions button { max-width:100%; white-space:normal; }
body.mobile-view #payments-empty:not([hidden]) + #payments-table-wrap + #mobile-payments-list { margin-top:8px; }
body.mobile-view .receipt-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
body.mobile-view .receipt-summary>div { min-width:0; border-bottom:1px solid #dbe8e4; }
body.mobile-view .receipt-summary strong { overflow-wrap:anywhere; }
.mobile-receipt-group { margin:16px 0; }
.mobile-receipt-group h5 { margin:0 0 8px; font-size:13px; overflow-wrap:anywhere; }
.mobile-receipt-group .mobile-record-card,.mobile-receipt-history .mobile-record-card { margin-bottom:9px; }
.mobile-receipt-values { display:grid; gap:6px; padding:8px 0; border-top:1px solid var(--line); }
.mobile-receipt-values span { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; }
.mobile-receipt-values b { color:var(--ink); text-align:right; font-variant-numeric:tabular-nums; }
.mobile-receipt-allocations { padding:7px 0; border-top:1px solid var(--line); }
.mobile-receipt-allocations p { margin:3px 0; }
body.mobile-view .receipt-confirmation-note { display:block; }
body.mobile-view .receipt-confirmation-note span { display:block; }
body.mobile-view .contact-tabs { overflow-x:auto; }
body.mobile-view .contact-tabs button { min-width:max-content; }
body.mobile-view .receipt-table-wrap,body.mobile-view .contact-scroll,body.mobile-view .table-wrap { max-width:100%; }
body.mobile-view dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 30px); }
body.mobile-view dialog .dialog-body { padding:16px; }
body.mobile-view .detail-actions { display:flex; }
body.mobile-view .detail-actions button { flex:1 1 130px; }
body.mobile-view .detail-list { grid-template-columns:1fr; }
body.mobile-view .detail-list div { min-width:0; overflow-wrap:anywhere; }
body.mobile-view .backup-content-note,body.mobile-view .backup-limit-note { overflow-wrap:anywhere; }
@media (max-width:390px) { body.mobile-view main { padding-left:10px; padding-right:10px; } body.mobile-view .mobile-nav .nav-item { font-size:10px; } body.mobile-view .panel { padding:13px; } }
.date-popover-header { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:6px 12px; border-bottom:1px solid var(--line); background:#fff; font-size:12px; }
.date-popover-header .text-button { min-height:30px; }
body.mobile-view .panel.has-open-date-filter { z-index:60; }

#account-management[hidden]{display:none!important}
#auth-custom-recovery-fields{display:grid;gap:12px}
#auth-custom-recovery-fields.hidden{display:none}

[data-runtime-version]{overflow-wrap:anywhere}.runtime-info{margin:18px 0;padding:16px;border:1px solid #dce6df;border-radius:10px}.runtime-info h3{margin:0 0 8px}.runtime-details{white-space:pre-line;overflow-wrap:anywhere;color:#61746a;font-size:14px;line-height:1.65;margin:0}

/* Cash uses account names only; tables scroll within their own panel. */
.cash-negative { color:#b42318 !important; font-weight:650; }
.cash-warning { color:#92400e; }
.cash-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:18px 0; }
.cash-stats article { padding:18px; background:#f5f8fc; border:1px solid #dbe3ed; border-radius:12px; }
.cash-stats span { display:block; color:#58677c; margin-bottom:8px; }
.cash-stats strong { font-size:clamp(18px,2vw,26px); overflow-wrap:anywhere; }
.cash-page-actions,.cash-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.cash-table-wrap { max-width:100%; overflow:auto; border:1px solid #dbe3ed; border-radius:10px; }
.cash-table { width:100%; border-collapse:collapse; min-width:900px; font-variant-numeric:tabular-nums; }
.cash-table th,.cash-table td { padding:12px 14px; text-align:left; vertical-align:top; border-bottom:1px solid #e4eaf2; }
.cash-table th { background:#f3f6fa; white-space:nowrap; }
.cash-table .number { text-align:right; white-space:nowrap; }
.cash-table small { display:block; color:#66758a; margin-top:5px; font-size:12px; overflow-wrap:anywhere; }
.cash-table .cash-actions { display:table-cell; min-width:170px; }
.cash-table .cash-actions button { margin:0 7px 6px 0; }
.cash-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:14px 0; }
.cash-form-grid label,.cash-funding label,#cash-dialog-form label { display:flex; flex-direction:column; gap:7px; }
.cash-form-grid input,.cash-form-grid select,.cash-form-grid textarea,#cash-dialog-form input,#cash-dialog-form textarea { width:100%; min-height:42px; }
.cash-funding { border:1px solid #cdd9e7; border-radius:10px; padding:12px 16px; margin:16px 0; }
.cash-funding legend { padding:0 6px; font-weight:650; }
.cash-funding-status { margin:10px 0; }
.cash-funding-reason { grid-column:1/-1; }
#cash-dialog { width:min(980px,calc(100vw - 32px)); max-width:980px; }
@media(max-width:680px) { .cash-stats,.cash-form-grid { grid-template-columns:1fr; gap:10px; } .cash-page-actions { width:100%; } .cash-page-actions button { flex:1; white-space:nowrap; } #page-cash .panel-title { align-items:flex-start; flex-direction:column; } .cash-stats article { padding:14px; } .cash-funding { padding:10px; } #cash-dialog { width:calc(100vw - 20px); } }

#cash-accounts .cash-table th:last-child,#cash-accounts .cash-table td:last-child { position:sticky; right:0; background:#fff; box-shadow:-6px 0 10px -8px #8095ac; z-index:1; }
#cash-accounts .cash-table th:last-child { background:#f3f6fa; }
#cash-dialog-form .confirm-check { flex-direction:row; align-items:center; }
#cash-dialog-form .confirm-check input { width:auto; min-height:0; }

@media(max-width:680px) { #cash-accounts .cash-table th:last-child,#cash-accounts .cash-table td:last-child { position:static; box-shadow:none; } }

#cash-dialog { height:auto; max-height:88vh; }
#cash-dialog-form { height:auto; max-height:calc(88vh - 58px); overflow-y:auto; }

#cash-dialog { height:fit-content; }

.cash-no-balances { min-width:0; }
.cash-no-balances th:nth-child(2) { white-space:normal; }
.cash-no-balances .cash-actions { min-width:70px; }

.cash-table button { white-space:nowrap; }

.cash-projection-alert { border:1px solid #d59b42; background:#fff8eb; color:#744a13; border-radius:10px; padding:14px 16px; margin:12px 0; overflow-wrap:anywhere; }
.cash-projection-alert li { margin:8px 0; }

/* iPhone share: forms align, details wrap; no credentials are rendered. */
.desktop-update{position:sticky;top:0;z-index:150;background:#fff4cf;padding:12px 20px;display:flex;gap:16px;align-items:center;justify-content:center}.desktop-update[hidden],.iphone-share-panel[hidden],#iphone-pair-confirm[hidden],#iphone-pair-form[hidden]{display:none!important}
.iphone-pair-form{display:flex;gap:12px;align-items:end;max-width:680px}.iphone-pair-form label{flex:1;display:grid;gap:8px}.iphone-pair-form input,.iphone-share-panel select{min-height:44px;width:100%}.iphone-pair-form button{min-height:44px}.iphone-device-list{list-style:none;margin:12px 0;padding:0}.iphone-device-list li{display:flex;justify-content:space-between;align-items:center;gap:16px;border-top:1px solid #dce5df;padding:16px 0}.iphone-device-list span{display:block;color:#58685d;font-size:14px;margin-top:6px}.iphone-share-panel p,.iphone-device-list{overflow-wrap:anywhere}.iphone-shared-message{background:#e1f3e7;border-left:4px solid #177554;padding:16px;border-radius:10px;margin:0 0 16px}.iphone-shared-message[hidden]{display:none}.iphone-guide{max-width:860px;margin:auto;padding:28px 20px}.iphone-guide li{margin:14px 0;line-height:1.8}.iphone-guide .primary{display:inline-block;margin:8px 8px 8px 0}
@media(max-width:680px){.iphone-pair-form{display:grid;max-width:none}.iphone-device-list li{align-items:start}.desktop-update{align-items:start;font-size:14px;gap:8px;padding:10px}}

.iphone-pair-form input,.iphone-share-panel select{height:44px;padding:9px 11px;border:1px solid #cedbd7;border-radius:9px;background:#fff;color:var(--ink);font:inherit}.iphone-pair-form input:focus,.iphone-share-panel select:focus{outline:2px solid #177554;outline-offset:1px}

/* V7 current scope and company scope stay visibly distinct on narrow screens. */
.page-load-status{padding:10px 14px;margin:8px 0;background:#edf4f2;border-radius:8px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.page-load-status.hidden{display:none;}
.company-outstanding-section{margin:12px 0 18px;padding:12px 16px;border:1px solid var(--border,#d9e2dd);border-radius:10px;}
.company-outstanding-section h4{margin:0 0 6px;}
.company-outstanding-table{width:100%;border-collapse:collapse;table-layout:fixed;}
.company-outstanding-table th,.company-outstanding-table td{padding:8px 10px;text-align:left;border-bottom:1px solid #e4eae6;}
.company-outstanding-table .number{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;}
.company-outstanding-table tfoot{font-weight:700;background:#f1f6f3;}
@media(max-width:600px){.company-outstanding-section{padding:10px;}.company-outstanding-table th,.company-outstanding-table td{padding:8px 6px;}#record-form>.form-actions{flex-wrap:wrap;}}

.preview-image-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.preview-toolbar > .preview-note { flex-basis:100%; }
