/* Shared light / dark workspace palettes. Reports download with a white paper layout. */
:root{--canvas:#f3f6fa;--surface:#fff;--surface-soft:#f7f9fc;--surface-raised:#fff;--ink:#21344b;--muted:#63778c;--line:#dde5ee;--green:#087e8b;--accent:#087e8b;--accent-soft:#e9f7f8;--danger:#bd3b49;--shadow:0 5px 22px #162e4910;--site-soft:#f4fafb;--site-band:#e6f3f4}
:root[data-theme=dark]{--canvas:#101923;--surface:#182534;--surface-soft:#1e2f40;--surface-raised:#223447;--ink:#e2ecf6;--muted:#a2b5c9;--line:#34485b;--green:#31b8c3;--accent:#65d4dc;--accent-soft:#163f49;--danger:#ff939c;--shadow:0 7px 28px #0002;--site-soft:#1c2c3b;--site-band:#234150}
body{background:var(--canvas);color:var(--ink);font-family:'Segoe UI','Microsoft YaHei',sans-serif;font-size:14px;line-height:1.65}
main{max-width:1700px;padding-left:32px;padding-right:32px}.topbar{height:76px;border-color:var(--line);gap:16px}.account-top{gap:15px;font-size:12px}.breadcrumb{font-size:12px}.account-top a,.account-top button,.breadcrumb b{color:var(--muted)}
.sidebar{background:var(--surface);border-right:1px solid var(--line);padding-top:30px}.brand{color:var(--ink);font-weight:700}.brand small{color:var(--muted)}.nav-caption,.sidebar-bottom{color:var(--muted)}.nav{color:var(--muted);font-size:13px;border-radius:10px;padding:12px 15px;transition:background .15s,color .15s}.nav span{font-size:20px;width:24px}.nav:hover{background:var(--surface-soft);color:var(--accent)}.nav.active{background:var(--accent-soft);color:var(--accent);box-shadow:inset 3px 0 var(--accent);font-weight:650}.sidebar-bottom{border-color:var(--line)}
h1,h2,h3,h4{color:var(--ink)}h1{font-size:29px;letter-spacing:-.5px}.page-heading{margin:28px 0 26px}.eyebrow{color:var(--accent);letter-spacing:1px;font-size:11px}.subtitle,.subtle,.helper,.today{color:var(--muted);font-size:12px;line-height:1.8}.card,.import-card,.daily-import-card,.progress-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.card{padding:24px}.card-heading h2{font-size:17px;font-weight:650}.card-heading{gap:16px;margin-bottom:22px}.summary-grid{gap:16px}.metric{background:var(--surface);border-color:var(--line);border-radius:13px;box-shadow:var(--shadow)}.metric strong{color:var(--ink);font-weight:700}.metric p,.metric small{color:var(--muted)}
button,a,input,textarea,select{transition:background-color .15s,border-color .15s,color .15s}button{cursor:pointer}button:disabled{cursor:not-allowed}.primary,.period-downloads a.primary{background:var(--green);border-color:var(--green);color:#fff;border-radius:8px;font-weight:600;padding:10px 16px}.primary:hover{filter:brightness(1.08)}.secondary{background:var(--surface);border:1px solid var(--line);color:var(--ink);border-radius:8px;padding:9px 14px;font-size:12px}.secondary:hover{border-color:var(--accent);background:var(--accent-soft)}.text-link{font-size:12px;color:var(--accent)}.danger,.text-link.danger{color:var(--danger)}.primary.danger{background:#b83a49;border-color:#b83a49;color:white}.icon-button{color:var(--muted)}
input:not([type=checkbox]):not([type=radio]),textarea,select{color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:13px;line-height:1.5;padding:10px 12px}input::placeholder,textarea::placeholder{color:var(--muted);opacity:.8}input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:2px}input[type=checkbox],input[type=radio]{accent-color:var(--green)}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}label{color:var(--muted)}
table{font-size:12px;color:var(--ink)}th{background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:650}td{color:var(--ink)}td,th{border-bottom-color:var(--line);padding:13px 14px}tr:hover td{background:var(--surface-soft)}td small{color:var(--muted)}.table-wrap{border:1px solid var(--line);border-radius:9px;scrollbar-color:var(--muted) var(--surface-soft)}.table-wrap td:first-child,.table-wrap th:first-child{padding-left:14px}.table-wrap td:last-child,.table-wrap th:last-child{padding-right:14px}.table-footer{font-size:12px;color:var(--muted)}.channel-filters{grid-template-columns:1fr .8fr 1.5fr .9fr 1.5fr auto;gap:12px}.channel-filters .search{margin:0}.channel-selection{background:var(--surface-soft);border-color:var(--line);padding:12px 16px;border-radius:9px}.channel-write .text-link+.text-link{margin-left:14px}.site-pill{display:inline-block;color:var(--accent);background:var(--accent-soft);border-radius:5px;padding:3px 8px;font-size:11px;white-space:nowrap}.channel-inline-status{padding:6px 9px!important;font-size:12px!important;border-color:var(--status-border)!important;background:var(--status-bg)!important;color:var(--status-color)!important}
.theme-control{display:inline-flex;gap:3px;align-items:center;padding:3px 5px 3px 9px;background:var(--surface);border:1px solid var(--line);border-radius:9px;color:var(--accent);flex-shrink:0}.theme-control svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}.theme-control select{padding:4px 6px;background:transparent;border:0;font-size:12px;max-width:112px}.theme-control .sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0)}
dialog{background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:0 24px 100px #0005;padding:28px;border-radius:16px;max-height:90vh;overflow:auto}dialog::backdrop{background:#07172588;backdrop-filter:blur(3px)}dialog .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}dialog label{display:flex;flex-direction:column;gap:7px}.dialog-error,.account-error{color:var(--danger)}.mutation-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;color:var(--muted)}#channelTrashDialog{width:min(880px,94vw)}.trash-table{max-height:55vh;overflow:auto}.trash-table th{position:sticky;top:0}.line-edit-dialog{width:min(940px,96vw)}.line-edit-dialog h2{margin:0}.line-edit-dialog .eyebrow{margin:0 0 3px}.line-edit-context{display:grid;grid-template-columns:1fr 1fr;gap:18px;max-width:540px}.line-edit-context label{margin:0}.line-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0 16px}.line-metric-grid input{width:100%}.line-notes-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.line-notes-grid textarea{width:100%;resize:vertical}.line-edit-note{background:var(--accent-soft);color:var(--accent);padding:12px 15px;font-size:12px;border-radius:8px}.line-edit-footer{display:flex;justify-content:space-between;align-items:center;margin-top:20px;border-top:1px solid var(--line);padding-top:18px}.line-edit-dialog summary{color:var(--muted);font-size:12px;cursor:pointer}.line-edit-dialog input:disabled{opacity:.55}.line-write{font-size:12px}body[data-role=viewer] .line-write{display:none!important}
.pr-report{color:var(--ink);background:var(--surface-soft);border:1px solid var(--line);padding:30px;border-radius:14px;max-width:none;font-size:14px}.pr-report h2{border-color:var(--accent);color:var(--ink)}.pr-report .pr-card{background:var(--surface);border-color:var(--line);border-radius:12px;padding:24px}.pr-report table,.pr-report .pr-kpis>div{background:var(--surface);border-color:var(--line)}.pr-report th{background:var(--surface-soft);color:var(--muted)}.pr-report td,.pr-report th{border-color:var(--line);padding:12px}.pr-report .pr-twrap{border:1px solid var(--line);border-radius:8px}.pr-report .pr-kpis strong{color:var(--accent)}.pr-report .pr-sub,.pr-report .pr-small,.pr-report .pr-kpis small{color:var(--muted)}.pr-report .pr-chart{background:var(--surface-soft)}.pr-report .pr-plan{background:var(--accent-soft);color:var(--ink);border-color:var(--accent);border-radius:0 8px 8px 0}.pr-appendix>summary{color:var(--accent)}.pr-report .pr-lines td:first-child{background:var(--surface)}.pr-report .pr-lines th:first-child{background:var(--surface-soft)}.pr-action{background:var(--accent-soft);border-color:var(--line);color:var(--accent)}.pr-report .pr-section-head h3{margin:18px 0 12px}.pr-report .pr-section-head{margin-top:8px}.pr-report .pr-lines th{white-space:nowrap}.pr-report .pr-lines{font-size:12px}.pr-report .pr-lines td:nth-child(2){min-width:230px}.pr-report svg text{fill:var(--muted)}.pr-report svg line{stroke:var(--line)}
.auth-main{position:relative}.auth-main>.theme-control{position:absolute;top:24px;right:28px}.auth-aside{background:linear-gradient(145deg,#123446,#0c6570);border-right:1px solid var(--line)}.auth-card h2{color:var(--ink)}.auth-card>p,.auth-note{color:var(--muted)!important}.auth-card{background:var(--surface);padding:32px;border:1px solid var(--line);border-radius:18px;max-width:460px;box-shadow:var(--shadow)}.auth-card button[type=submit]{background:var(--green)}.auth-card input{background:var(--surface-soft);border-color:var(--line);color:var(--ink)}.auth-main{max-width:none;margin:0}.auth-links a,.auth-link-button{color:var(--accent)}
:root[data-theme=dark] :is(.daily-source,.daily-backend,.daily-vendor,.daily-review,.daily-fee-help,.daily-drop,.import-drop-zone,.import-file-item,.import-content-mode,.import-template-bar,.template-form-grid,.template-sample-bar,.import-input-tabs,.import-preview-card,.import-text-panel,.period-controls,.period-date-grid label,.channel-batch-field,.channel-batch-scope,.channel-paste-columns,.account-credentials,.account-status,.audit-filters,.summary-toolbar,.summary-total,.summary-week,.information,.line-note-row td,.site-note-editor,.site-note-grid,.site-action-editor,.applied-additions,.vendor-note,.source-details,.detail-table td,.readable-table .data-row td,.anomaly-table .data-row td,.readable-table .site-group th,.site-note-editor summary,.anomaly-heading,.history-item,.progress-card,.empty-state){background:var(--surface-soft)!important;border-color:var(--line)!important;color:var(--ink)}
:root[data-theme=dark] :is(.daily-import-card h2,.daily-source h3,.daily-heading p,.daily-source p,.daily-section-title p,.daily-vendor label,.daily-fee-help,.daily-footer p,.daily-eyebrow,.daily-source-actions,.daily-backend small,.period-form label,.period-saved-label,.period-shortcuts,.period-site-edit label,.period-site-edit h3,.site-note-grid label,.site-note-grid h3,.site-action-editor label,.site-action-editor label span,.source-details,.source-note-cell,.readable-table tbody td,.readable-table tbody td small,.readable-table .site-group th>small,.channel-filters label,.channel-selection strong,.history-item h3,.history-item p,.summary-options label,.audit-filters label,.audit-table td,.anomaly-heading h3,.anomaly-heading p,.anomaly-reason>b,.line-source-note>b,.line-source-note>span){color:var(--ink)!important}
:root[data-theme=dark] :is(.readable-table th,.detail-table th,.summary-table th,.audit-table th,.summary-week td,.summary-total td){background:var(--surface-raised)!important;border-color:var(--line)!important;color:var(--ink)!important}
:root[data-theme=dark] :is(.period-shortcuts button,.period-date-grid label:has(input:checked),.metric-switch button,.import-input-tabs button,.metric-scroll-controls button,.line-count-link){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}:root[data-theme=dark] :is(.metric-switch button.selected,.import-input-tabs button.selected){background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
:root[data-theme=dark] .status-running{--status-color:#71e0df;--status-bg:#123f48;--status-border:#2f7180}:root[data-theme=dark] .status-testing{--status-color:#f6d56f;--status-bg:#423b25;--status-border:#796b3b}:root[data-theme=dark] .status-paused{--status-color:#ffa5a5;--status-bg:#442d36;--status-border:#805264}:root[data-theme=dark] .status-pending{--status-color:#c8d6e7;--status-bg:#2b3a4d;--status-border:#56677c}:root[data-theme=dark] .currency-badge{background:var(--accent-soft);color:var(--accent)}:root[data-theme=dark] .connection{background:var(--surface-soft);color:var(--muted);border-color:var(--line)}:root[data-theme=dark] .pr-report .pr-coverage{background:#443a20;color:#f1d395}:root[data-theme=dark] .draft-text{background:var(--surface-soft)!important;color:var(--ink)}:root[data-theme=dark] .pr-report svg rect[fill='#eaf0f5']{fill:var(--surface-raised)}:root[data-theme=dark] .auth-aside{background:linear-gradient(145deg,#142534,#173f4e)}
@media(max-width:1200px){.channel-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.account-top{gap:9px}.topbar{height:auto;min-height:76px;padding:15px 0;flex-wrap:wrap}}
@media(max-width:780px){main{padding:0 16px}.topbar{gap:10px}.account-top{font-size:11px;justify-content:flex-start}.theme-control select{font-size:11px}.page-heading{margin:22px 0}.card{padding:18px}h1{font-size:24px}.sidebar{padding:14px 16px}.sidebar nav{overflow:auto}.nav{min-width:94px;font-size:12px;padding:10px}.channel-filters{grid-template-columns:1fr 1fr}.channel-filters .channel-search-label{grid-column:1/-1}.line-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.line-notes-grid{grid-template-columns:1fr;gap:0}.line-edit-dialog{padding:20px}.pr-report{padding:16px}.pr-report .pr-card{padding:16px}.pr-section-head{flex-wrap:wrap}.auth-main{padding:70px 20px 32px}.auth-card{padding:25px}.auth-main>.theme-control{top:18px;right:20px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.pr-report .pr-lines-edit td:last-child{background:var(--surface);min-width:65px}.pr-report .pr-lines-edit th:last-child{background:var(--surface-soft)}.line-edit-dialog label{color:var(--muted);font-size:12px}:root[data-theme=dark] .primary,:root[data-theme=dark] .period-downloads a.primary,:root[data-theme=dark] .auth-card button[type=submit]{color:#092b35}:root[data-theme=dark] .primary.danger{color:#fff}.sidebar-bottom a{color:var(--accent)}

.daily-source{padding:18px;border-radius:12px;background:var(--surface-soft);border:1px solid var(--line)}.daily-heading{border-color:var(--line)}:root[data-theme=dark] :is(textarea,input:not([type=checkbox]):not([type=radio]),select:not(.channel-inline-status)){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}:root[data-theme=dark] label{color:var(--muted)}:root[data-theme=dark] .daily-heading label{color:var(--muted)}:root[data-theme=dark] .daily-section-title>span{background:var(--accent-soft);color:var(--accent)}:root[data-theme=dark] textarea::placeholder{color:var(--muted)}

/* Workspace surfaces and readable financial tables. */
:root{--week-bg:#fff6df;--week-ink:#715213;--grid-ink:#087e8b07;--row-hover:#eef8fa}
:root[data-theme=dark]{--week-bg:#333424;--week-ink:#f3d895;--grid-ink:#65d4dc05;--row-hover:#263f52}
body{background-image:radial-gradient(ellipse at 90% 0%,var(--accent-soft),transparent 55%),linear-gradient(var(--grid-ink) 1px,transparent 1px),linear-gradient(90deg,var(--grid-ink) 1px,transparent 1px);background-size:auto,32px 32px,32px 32px;background-attachment:fixed}
.topbar{border-bottom:1px solid var(--line)}.brand-mark{box-shadow:0 0 22px #1bc6d51c}.metric{border-top:3px solid var(--accent)}.metric strong,.daily-totals strong{font-variant-numeric:tabular-nums;letter-spacing:-.4px}.card-heading h2{letter-spacing:.2px}
.delivery-table-wrap,.daily-join-table{border-color:var(--line);scrollbar-color:var(--muted) var(--surface)}
.delivery-table{font-size:13px}.delivery-table th,.delivery-table td{color:var(--ink);border-color:var(--line);font-variant-numeric:tabular-nums}
.delivery-table thead th{background:var(--surface-raised);color:var(--muted);font-size:12px}.delivery-table th small{color:var(--muted);font-size:11px}
.delivery-day th,.delivery-day td{background:var(--surface);color:var(--ink)}
.delivery-week th,.delivery-week td{background:var(--week-bg);color:var(--week-ink);border-top-color:var(--line)}
.delivery-total th,.delivery-total td{background:var(--accent-soft);color:var(--accent);border-bottom-color:var(--accent)}
.delivery-table tbody tr:hover td,.delivery-table tbody tr:hover th{filter:none;box-shadow:inset 0 1px var(--line),inset 0 -1px var(--line)}.delivery-day:hover td,.delivery-day:hover th{background:var(--row-hover)}
.delivery-legend,.delivery-form label{color:var(--muted)}.delivery-legend i{border-color:var(--line)}.delivery-day-key{background:var(--surface)}.delivery-week-key{background:var(--week-bg)}.delivery-total-key{background:var(--accent-soft)}.delivery-partial{color:var(--week-ink)}
.daily-totals>div{background:var(--accent-soft);border-color:var(--line);border-top:2px solid var(--accent)}.daily-totals span,.daily-join-table small,.daily-join-review details{color:var(--muted)}.daily-totals strong,.daily-match{color:var(--accent)}
.daily-join-table th{background:var(--surface-raised);color:var(--muted);z-index:2}.daily-join-table td{background:var(--surface);color:var(--ink);font-variant-numeric:tabular-nums}.daily-line-unmatched td,.daily-line-ambiguous td,.daily-line-duplicate td{background:var(--week-bg)}.daily-unmatched{color:var(--week-ink)}.daily-spend-only-fields{display:grid;grid-template-columns:1fr;gap:6px;margin-top:10px}
:root[data-theme=dark] .import-review-table th,:root[data-theme=dark] .import-review-table td{background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] #dailyBackendReview.daily-fixed-columns th span{color:var(--ink)}:root[data-theme=dark] #dailyBackendReview.daily-fixed-columns th small{color:var(--muted)}
:root[data-theme=dark] #dailyBackendReview input.daily-cell-invalid{background:#483c25!important;color:#ffe4a6!important;border-color:#c6983c!important}
.line-channel-section{border:1px solid var(--line);border-left:3px solid var(--accent);background:var(--surface-soft);padding:16px 18px;border-radius:9px;margin:18px 0 24px}.line-channel-section h3{margin:0;font-size:15px}.line-channel-section>label{margin:14px 0}.line-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.line-identity-grid :is(input,select){min-width:0;width:100%}.line-channel-section select{width:100%;min-width:0}.line-metric-grid{row-gap:12px}
.pr-report .pr-lines-edit td:last-child,.pr-report .pr-lines-edit th:last-child{min-width:100px;width:100px}.pr-report .pr-lines-edit td:last-child button{display:block;white-space:nowrap;width:100%;margin:4px 0}.pr-report .pr-lines-edit td{font-variant-numeric:tabular-nums}.pr-report .pr-lines td:first-child{font-weight:600}.pr-report .pr-lines td:nth-child(2){min-width:190px}
@media(max-width:780px){.line-identity-grid{grid-template-columns:1fr 1fr}.line-channel-section{padding:14px}.delivery-table th,.delivery-table td{padding:12px}.daily-totals strong{font-size:20px}}
@media(max-width:480px){.line-identity-grid{grid-template-columns:1fr}.line-edit-footer{align-items:flex-start;gap:12px}}

.line-budget-section{border:1px solid var(--line);border-radius:9px;padding:16px;margin:16px 0;background:var(--surface-soft)}.line-budget-section h3{margin:0}.line-budget-grid{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:12px}.line-budget-grid input{width:100%;min-width:0}.pr-report .pr-line-card{background:var(--surface);border-color:var(--line)}.pr-report .pr-line-planning{background:var(--accent-soft)}.pr-report .pr-line-identity span,.pr-report .pr-line-planning dt,.pr-report .pr-line-metrics dt,.pr-report .pr-line-planning small,.pr-report .pr-line-notes b{color:var(--muted)}.pr-report .pr-line-planning dd,.pr-report .pr-line-metrics dd{color:var(--ink)}.pr-report .pr-line-notes{border-color:var(--line)}@media(max-width:780px){.line-budget-grid{grid-template-columns:1fr}}

.data-deletion-dialog{width:min(700px,calc(100vw - 32px));max-height:90vh;overflow:auto}.data-deletion-select{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}.data-deletion-select label{display:grid;gap:7px}.data-deletion-preview{padding:16px;border:1px solid var(--line);background:var(--surface-soft);border-radius:9px;line-height:1.9;overflow-wrap:anywhere}.data-deletion-preview strong{display:block;font-size:17px}.data-trash-item{display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:1px solid var(--line);padding:14px 0}.data-trash-item small{display:block;color:var(--muted);margin-top:4px}body[data-role=viewer] .data-delete-write{display:none!important}@media(max-width:650px){.data-deletion-select{grid-template-columns:1fr}.history-item{flex-wrap:wrap}}
