/* Finance themes. Layout, document artwork, and local workflow behavior are unchanged. */
html[data-sl-theme="light"] .office-finance {
  --of-bg: #eef3f8;
  --of-panel: #ffffff;
  --of-lift: #f3f6fa;
  --of-field: #ffffff;
  --of-text: #17293f;
  --of-soft: #40566f;
  --of-gold: #76491f;
  --of-line: #b6c3d1;
  --of-field-line: #75869b;
  --of-metal: linear-gradient(125deg, #f3e8d9, #e8eef5 65%, #e6edf5);
  --of-metal-line: #a58a68;
  --of-bronze: #80512a;
  --of-bronze-hover: #68411f;
  --of-silver: #e4ebf3;
  --of-silver-hover: #d3deeb;
  --of-silver-text: #233c56;
  --of-button-line: #80512a;
  --of-chip: #e8eef5;
  --of-chip-line: #adbed1;
  --of-table-head: #e4ebf3;
  --of-table-head-text: #233c56;
  --of-table-stripe: #f0f4f9;
  --of-notice-bg: #fff3da;
  --of-notice-text: #603d11;
  --of-notice-line: #a16d2c;
  --of-error-bg: #fff0ef;
  --of-error-text: #842b27;
  --of-error-line: #b76f69;
  --of-receipt-bg: #edf5f4;
  --of-receipt-line: #6d8a88;
  --of-receipt-label: #305b55;
  --of-disabled-bg: #e5eaf0;
  --of-disabled-text: #4b5c70;
  --of-focus: #0b59a0;
  --of-focus-underlay: #ffffff;
  --of-color-scheme: light;
  color-scheme: light;
}

html[data-sl-theme="dark"] .office-finance {
  --of-bg: #111923;
  --of-panel: #1a2635;
  --of-lift: #233247;
  --of-field: #111e2e;
  --of-text: #eef4fb;
  --of-soft: #bdcadb;
  --of-gold: #f3d18d;
  --of-line: #51647c;
  --of-field-line: #72859d;
  --of-metal: linear-gradient(125deg, #263a4f, #1a2635 65%, #233042);
  --of-metal-line: #9f8a63;
  --of-bronze: #80512a;
  --of-bronze-hover: #68411f;
  --of-silver: #30425a;
  --of-silver-hover: #3b526f;
  --of-silver-text: #eef4fb;
  --of-button-line: #c49c67;
  --of-chip: #26354a;
  --of-chip-line: #657991;
  --of-table-head: #30425a;
  --of-table-head-text: #eef4fb;
  --of-table-stripe: #233247;
  --of-notice-bg: #3a2e1c;
  --of-notice-text: #ffe4ad;
  --of-notice-line: #b28a45;
  --of-error-bg: #43282b;
  --of-error-text: #ffe0dc;
  --of-error-line: #b77e77;
  --of-receipt-bg: #203638;
  --of-receipt-line: #688d85;
  --of-receipt-label: #c5e2d9;
  --of-disabled-bg: #263346;
  --of-disabled-text: #bdcadb;
  --of-focus: #ffd684;
  --of-focus-underlay: #111923;
  --of-color-scheme: dark;
  color-scheme: dark;
}

html:is([data-sl-theme="light"], [data-sl-theme="dark"]) .office-finance {
  accent-color: var(--of-gold);
}

html[data-sl-theme] .office-finance :is(.of-tool-bar, .of-toolbar, .of-hero) {
  border-color: var(--of-metal-line);
}

html[data-sl-theme] .office-finance :is(input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea) {
  background: var(--of-field);
  color: var(--of-text);
  border-color: var(--of-field-line);
  caret-color: var(--of-text);
  color-scheme: var(--of-color-scheme);
}

html[data-sl-theme] .office-finance :is(input, textarea)::placeholder {
  color: var(--of-soft);
  opacity: 1;
}

html[data-sl-theme] .office-finance :is(input[readonly], textarea[readonly]) {
  background: var(--of-lift);
  color: var(--of-soft);
}

html[data-sl-theme] .office-finance select option {
  background: var(--of-field);
  color: var(--of-text);
}

html[data-sl-theme] .office-finance :is(.of-button, .of-file-picker) {
  background: var(--of-bronze);
  color: #ffffff;
  border-color: var(--of-button-line);
  text-shadow: none;
}

/* Solid hover colors replace the original button brightness effect. */
html[data-sl-theme] .office-finance :is(.of-button, .of-file-picker):hover {
  background: var(--of-bronze-hover);
  filter: none;
}

html[data-sl-theme] .office-finance :is(.of-button.silver, .of-tab) {
  background: var(--of-silver);
  color: var(--of-silver-text);
  border-color: var(--of-field-line);
  text-shadow: none;
}

html[data-sl-theme] .office-finance :is(.of-button.silver, .of-tab):hover {
  background: var(--of-silver-hover);
  filter: none;
}

html[data-sl-theme] .office-finance :is(.of-button.active, .of-tab.active) {
  background: var(--of-bronze);
  color: #ffffff;
  border-color: var(--of-button-line);
  outline-color: var(--of-gold);
}

html[data-sl-theme] .office-finance :is(.of-button.active, .of-tab.active):hover {
  background: var(--of-bronze-hover);
}

html[data-sl-theme] .office-finance .of-button.danger {
  background: #8c332d;
  border-color: #bd7269;
  color: #ffffff;
}

html[data-sl-theme] .office-finance .of-button.danger:hover {
  background: #712720;
}

html[data-sl-theme] .office-finance :is(.of-button, .of-tab, .of-file-picker):disabled {
  background: var(--of-disabled-bg);
  color: var(--of-disabled-text);
  border-color: var(--of-field-line);
  opacity: 1;
  filter: none;
  text-shadow: none;
}

html[data-sl-theme] .office-finance :is(:focus-visible, .of-button:focus-visible, .of-tab:focus-visible, .of-file-picker:focus-visible) {
  outline: 3px solid var(--of-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--of-focus-underlay);
}

html[data-sl-theme] .office-finance .of-meta > span {
  background: var(--of-chip);
  border-color: var(--of-chip-line);
  color: var(--of-soft);
}

html[data-sl-theme] .office-finance :is(.of-file-thumb:not(.of-story-thumb), .of-folder-preview) {
  background: var(--of-field);
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance .of-file-icon {
  background: var(--of-chip);
  color: var(--of-gold);
}

html[data-sl-theme] .office-finance .of-empty {
  background: var(--of-lift);
  color: var(--of-soft);
  border-color: var(--of-field-line);
}

html[data-sl-theme] .office-finance .of-notice {
  background: var(--of-notice-bg);
  color: var(--of-notice-text);
  border-color: var(--of-notice-line);
}

html[data-sl-theme] .office-finance .of-notice p {
  color: var(--of-notice-text);
}

html[data-sl-theme] .office-finance .of-form-error {
  background: var(--of-error-bg);
  color: var(--of-error-text);
  border-color: var(--of-error-line);
}

html[data-sl-theme] .office-finance .of-dialog {
  background: var(--of-panel);
  color: var(--of-text);
  border-color: var(--of-field-line);
  color-scheme: var(--of-color-scheme);
}

html[data-sl-theme] .office-finance .of-dialog > header {
  background: var(--of-lift);
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance .of-dialog > header h2 {
  color: var(--of-text);
}

html[data-sl-theme] .office-finance .of-dialog > header .of-kicker {
  color: var(--of-gold);
}

html[data-sl-theme] .office-finance :is(.of-dialog-body > p, .of-dialog label, .of-check-row small) {
  color: var(--of-soft);
}

html[data-sl-theme] .office-finance .of-check-row {
  background: var(--of-field);
  border-color: var(--of-field-line);
}

html[data-sl-theme] .office-finance .of-item-table td {
  background: var(--of-lift);
  color: var(--of-text);
}

html[data-sl-theme] .office-finance .of-summary-row {
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance :is(.of-small, .of-detail-grid dt, .of-activity-list small) {
  color: var(--of-soft);
}

html[data-sl-theme] .office-finance .of-local-link {
  background: var(--of-lift);
  color: var(--of-soft);
}

html[data-sl-theme] .office-finance .of-delivery-receipt {
  background: var(--of-receipt-bg);
  color: var(--of-text);
  border-color: var(--of-receipt-line);
  border-left-color: var(--of-gold);
}

html[data-sl-theme] .office-finance .of-delivery-receipt dt {
  color: var(--of-receipt-label);
}

html[data-sl-theme] .office-finance .of-activity-list li {
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance .of-activity-list li::before {
  background: var(--of-gold);
}

html[data-sl-theme] .office-finance .of-pay-table th {
  background: var(--of-table-head);
  color: var(--of-table-head-text);
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance .of-pay-table td {
  background: var(--of-panel);
  color: var(--of-text);
  border-color: var(--of-line);
}

html[data-sl-theme] .office-finance .of-pay-table tr:nth-child(even) > td {
  background: var(--of-table-stripe);
}

/* Status labels retain both a name and a complete high-contrast color pair. */
html[data-sl-theme="light"] .office-finance :is(.of-type-pill, .of-status-pill) {
  background: #f5e8d2;
  color: #654016;
  border-color: #a8824b;
}

html[data-sl-theme="light"] .office-finance :is(.status-paid, .status-viewed) {
  background: #dff2e7;
  color: #175236;
  border-color: #648f75;
}

html[data-sl-theme="light"] .office-finance .status-sent {
  background: #e0eefb;
  color: #1e4c70;
  border-color: #668ba9;
}

html[data-sl-theme="light"] .office-finance .status-overdue {
  background: #fff0c9;
  color: #6b4908;
  border-color: #9d7d38;
}

html[data-sl-theme="light"] .office-finance .status-cancelled {
  background: #f9e2df;
  color: #812f28;
  border-color: #ad746b;
}

html[data-sl-theme="light"] .office-finance .status-approved {
  background: #eee4f8;
  color: #5a3479;
  border-color: #9775ae;
}

html[data-sl-theme="dark"] .office-finance :is(.of-type-pill, .of-status-pill) {
  background: #443629;
  color: #f6d596;
  border-color: #a88d67;
}

html[data-sl-theme="dark"] .office-finance :is(.status-paid, .status-viewed) {
  background: #224938;
  color: #d7f8e4;
  border-color: #659677;
}

html[data-sl-theme="dark"] .office-finance .status-sent {
  background: #213e58;
  color: #e0effb;
  border-color: #658ba8;
}

html[data-sl-theme="dark"] .office-finance .status-overdue {
  background: #574319;
  color: #fff1c7;
  border-color: #a48b4d;
}

html[data-sl-theme="dark"] .office-finance .status-cancelled {
  background: #572e2b;
  color: #ffdbd5;
  border-color: #a56a63;
}

html[data-sl-theme="dark"] .office-finance .status-approved {
  background: #423358;
  color: #eee2ff;
  border-color: #8c79a3;
}

/* The customer document remains a white paper preview in either owner theme. */
html[data-sl-theme] .office-finance .of-document-paper {
  --of-text: #182a40;
  --of-soft: #34485e;
  --of-gold: #7a5a2f;
  --of-line: #d4dce5;
  --of-focus: #0b59a0;
  --of-focus-underlay: #ffffff;
  color-scheme: light;
}

/* Preserve the illustration's own palette and focus contrast on its blue stage. */
html[data-sl-theme] .office-finance .of-storyboard {
  --of-focus: #ffd684;
  --of-focus-underlay: #111923;
}

/* Theme specificity must not turn a printed payroll report into a dark page. */
@media print {
  html[data-sl-theme] .payroll-office {
    --of-bg: #ffffff;
    --of-panel: #ffffff;
    --of-lift: #ffffff;
    --of-field: #ffffff;
    --of-text: #000000;
    --of-soft: #222222;
    --of-gold: #333333;
    --of-line: #aaaaaa;
    --of-table-head: #ffffff;
    --of-table-head-text: #000000;
    --of-table-stripe: #ffffff;
    color-scheme: light;
    background: #ffffff;
    color: #000000;
  }

  html[data-sl-theme] .payroll-office :is(.of-section, .of-summary-box, .of-notice, .of-form-error, .of-empty, .of-delivery-receipt, .of-status-pill) {
    background: #ffffff;
    color: #000000;
    border-color: #aaaaaa;
    box-shadow: none;
  }

  html[data-sl-theme] .payroll-office :is(.of-pay-table th, .of-pay-table td, .of-pay-table tr:nth-child(even) > td) {
    background: #ffffff !important;
    color: #000000;
    border-color: #aaaaaa;
  }

  html[data-sl-theme] .payroll-office :is(.of-notice p, .of-delivery-receipt dt, .of-small, .of-detail-grid dt, .of-activity-list small) {
    color: #222222;
  }
}
