:root {
  --bg-color: #f4f6f9;
  --surface-color: #ffffff;
  --surface-hover: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #005691;
  --primary-hover: #004373;
  --primary-light: #e0f2fe;
  --teal: #087c78;
  --teal-light: #e4f7f5;
  --green: #15803d;
  --green-light: #edf9f0;
  --amber: #b45309;
  --amber-light: #fff7e8;
  --red: #c2413b;
  --red-light: #fff1f1;
  --blue: #2563eb;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 4%);
  --shadow: 0 8px 22px rgb(15 23 42 / 7%);
  --shadow-lg: 0 18px 42px rgb(15 23 42 / 11%);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 180ms ease;
  color: var(--text-primary);
  background: var(--bg-color);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.arca-reconciliation-section {
  position: relative;
}

.arca-match-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.arca-match-banner.is-matched {
  background: #ecfdf5;
  border-color: #a7f3d0;
  border-left-color: #10b981;
  color: #065f46;
}

.arca-match-banner.is-missing {
  background: #fff1f2;
  border-color: #fecdd3;
  border-left-color: #e11d48;
  color: #9f1239;
}

.arca-match-dot,
.arca-table-indicator {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.arca-match-banner strong,
.arca-match-banner small {
  display: block;
}

.arca-match-banner small {
  margin-top: 3px;
  color: inherit;
  opacity: 0.82;
}

.arca-tax-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.arca-tax-summary div {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
}

.arca-tax-summary span,
.arca-tax-fields label>span,
.arca-tax-difference span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.arca-tax-message {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.arca-tax-message svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.arca-tax-message.is-valid {
  color: #047857;
  background: #ecfdf5;
}

.arca-tax-message.is-warning {
  color: #b45309;
  background: #fffbeb;
}

.arca-tax-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.arca-tax-fields label {
  display: grid;
  gap: 7px;
}

.arca-tax-difference {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.arca-tax-difference.has-difference {
  color: #b91c1c;
  background: #fef2f2;
}

.arca-tax-difference.is-zero {
  color: #047857;
  background: #ecfdf5;
}

[data-arca-reconciliation].is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 760px) {

  .arca-tax-summary,
  .arca-tax-fields {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-color);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 1px 0 rgb(15 23 42 / 2%);
  backdrop-filter: blur(14px);
}

.access-readonly-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #b8d8ed;
  border-radius: var(--radius-sm);
  background: #f2f9fd;
  color: #155b82;
  font-size: 12px;
  font-weight: 650;
}

.review-form-fields {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: 36px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}

.brand-divider {
  width: 1px;
  height: 36px;
  background: var(--line-strong);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-family: Manrope, Inter, sans-serif;
  color: #15354a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding-left: 30px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.main-nav a:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.main-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}

.main-nav a:active {
  transform: translateY(1px);
}

.main-nav svg {
  width: 16px;
  height: 16px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  min-width: 0;
}

.header-edison-logo {
  display: block;
  width: 161px;
  height: 60px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}

.user-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.user-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-name svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.page-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.wide-shell {
  width: min(1760px, calc(100% - 48px));
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  max-width: 900px;
  margin: 4px 0 5px;
  font-family: Manrope, Inter, sans-serif;
  color: #102a43;
  font-size: 29px;
  font-weight: 800;
  line-height: 1.2;
}

.page-heading p {
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.subtle {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.heading-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.compact-heading {
  margin-bottom: 18px;
}

.heading-statuses,
.review-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--primary-hover);
}

.button,
.icon-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 750;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--primary);
  box-shadow: 0 4px 10px rgb(0 86 145 / 18%);
  color: #fff;
}

.button-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 7px 16px rgb(0 86 145 / 24%);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.button-secondary:hover {
  border-color: #92b7d2;
  background: #f8fcff;
  color: var(--primary);
}

.button-wide {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.button.is-loading::before {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 55%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  content: "";
}

.sync-button .button-spinner {
  display: none;
}

.sync-button.is-loading::before {
  display: none;
  content: none;
}

.sync-button.is-loading .refresh-icon {
  display: none;
}

.sync-button.is-loading .button-spinner {
  display: inline-flex;
}

.sync-button.is-loading .button-spinner svg {
  animation: spin .75s linear infinite;
}

[data-sharepoint-sync-form] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sync-status {
  min-width: 0;
  color: var(--text-secondary);
  font-size: .79rem;
  font-weight: 600;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-button:hover {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--primary);
}

.icon-button:active {
  transform: scale(.96);
}

.logout-button:hover {
  border-color: #f2c7c5;
  background: var(--red-light);
  color: var(--red);
}

.icon-button.danger {
  color: var(--red);
}

.icon-button.danger:hover {
  border-color: #f2c7c5;
  background: var(--red-light);
}

.text-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}

.text-link:hover {
  color: var(--primary-hover);
}

.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
}

.flash {
  display: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  animation: toast-in 240ms ease both;
}

.toast>svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.toast button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: .7;
}

.toast button:hover {
  background: rgb(15 23 42 / 7%);
  opacity: 1;
}

.toast button svg {
  width: 15px;
  height: 15px;
}

.toast-success {
  border-color: #b7e0c3;
  background: #f1fbf4;
  color: #176438;
}

.toast-error {
  border-color: #f0c0bd;
  background: #fff5f4;
  color: #a03430;
}

.toast-warning {
  border-color: #f1d299;
  background: #fff9ed;
  color: #965211;
}

.toast-info {
  border-color: #b8d8ec;
  background: #f3faff;
  color: #0c5a8b;
}

.toast.is-leaving {
  animation: toast-out 220ms ease both;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.metric-strip-dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  position: relative;
  min-height: 122px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.metric:hover {
  border-color: #c5d5e0;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-static {
  cursor: default;
}

.metric-static:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  transform: none;
}

.metric-icon {
  display: grid !important;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 11px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-label {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-family: Manrope, Inter, sans-serif;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.metric-approved .metric-icon {
  background: var(--green-light);
  color: var(--green);
}

.metric-payment .metric-icon {
  background: var(--teal-light);
  color: var(--teal);
}

.metric-last-instruction .metric-icon {
  background: #eef2ff;
  color: #4f46e5;
}

.metric-date {
  font-size: 18px !important;
  line-height: 1.25 !important;
}

.metric-empty-value {
  color: var(--text-muted) !important;
}

.metric-warning {
  border-color: #f0d9b1;
}

.metric-warning .metric-icon {
  background: var(--amber-light);
  color: var(--amber);
}

.content-section,
.form-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.content-section {
  margin-top: 20px;
  padding: 22px;
}

.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 20px;
  align-items: start;
}

.dashboard-insight-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.dashboard-insight-heading {
  margin-bottom: 14px;
}

.dashboard-insight-heading h2 {
  margin: 3px 0 5px;
  color: var(--text-primary);
  font-family: Manrope, Inter, sans-serif;
  font-size: 18px;
  line-height: 1.25;
}

.dashboard-insight-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.insight-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
}

.insight-icon-age {
  background: var(--amber-light);
  color: var(--amber);
}

.insight-icon-vendor {
  background: var(--teal-light);
  color: var(--teal);
}

.chart-currency-toggle {
  display: inline-flex;
  gap: 3px;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.chart-currency-toggle button {
  min-width: 54px;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.chart-currency-toggle button:hover {
  color: var(--primary);
}

.chart-currency-toggle button.active {
  background: var(--surface-color);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dashboard-chart {
  min-height: 218px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fbfcfe;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.chart-bar-item {
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) minmax(80px, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 3px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), transform var(--transition);
}

.chart-bar-item:hover {
  background: #f0f7fb;
  transform: translateX(2px);
}

.chart-bar-item:focus-visible {
  outline: 3px solid rgb(0 86 145 / 20%);
  outline-offset: 1px;
}

.chart-bar-label {
  display: grid;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.chart-bar-label small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.chart-bar-track {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf3;
}

.chart-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #3f91bf);
  transition: width 520ms cubic-bezier(.2, .8, .2, 1);
}

.dashboard-creditor-chart .chart-bar-fill {
  background: linear-gradient(90deg, var(--teal), #43aaa1);
}

.chart-bars.is-rendered .chart-bar-fill {
  width: var(--bar-size);
}

.chart-bar-value {
  display: grid;
  min-width: 92px;
  color: var(--text-primary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  justify-items: end;
  gap: 2px;
}

.chart-bar-value small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.dashboard-chart-empty {
  margin: 75px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.ageing-breakdown {
  display: grid;
  gap: 2px;
}

.ageing-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: background var(--transition);
}

.ageing-breakdown-row:hover {
  background: var(--surface-hover);
}

.ageing-breakdown-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ageing-breakdown-row strong,
.ageing-breakdown-row b {
  color: var(--text-primary);
  font-size: 11px;
}

.ageing-breakdown-row small {
  color: var(--text-muted);
  font-size: 10px;
}

.ageing-breakdown-values {
  text-align: right;
  justify-items: end;
}

.dashboard-note {
  display: flex;
  gap: 6px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.dashboard-note svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.dashboard-creditor-table-wrap {
  overflow-x: auto;
}

.dashboard-creditor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dashboard-creditor-table th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.dashboard-creditor-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #f0f3f6;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dashboard-creditor-table td:first-child {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-creditor-table td a {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-creditor-table td a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.payment-filter-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid #cde5f4;
  border-radius: 8px;
  background: #f1f8fc;
  color: #245b7a;
  font-size: 12px;
}

.payment-filter-notice svg {
  width: 15px;
  height: 15px;
}

.payment-filter-notice a {
  margin-left: auto;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  color: #16344b;
  font-size: 17px;
  font-weight: 800;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading.compact h2 {
  font-size: 15px;
}

.count-badge {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.table-section {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 14px 15px;
  border-bottom: 1px solid #edf1f5;
  color: #334155;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: #f8fbfd;
}

td strong,
td small {
  display: block;
}

td strong {
  color: var(--text-primary);
  font-weight: 700;
}

td small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.centered {
  text-align: center;
}

.registered-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
}

.invoice-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.invoice-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.invoice-search:focus-within {
  border-color: #78a7c8;
  box-shadow: 0 0 0 3px rgb(19 101 157 / 12%);
}

.invoice-search svg {
  width: 16px;
  height: 16px;
}

.invoice-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 0.7;
  font-size: 0.62rem;
  margin-left: 1px;
}

.sort-arrows span {
  display: block;
  height: 0.42rem;
  line-height: 0.42rem;
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--primary);
}

.sort-button:focus-visible {
  outline: 2px solid #78a7c8;
  outline-offset: 3px;
}

.sort-button[data-sort-direction="asc"] .sort-arrows span:first-child {
  color: #1b8a67;
}

.sort-button[data-sort-direction="desc"] .sort-arrows span:last-child {
  color: #b86a1d;
}

.centered-sort {
  justify-content: center;
}

.amount {
  white-space: nowrap;
  color: #1e415a;
  font-weight: 750;
}

.empty-cell {
  padding: 42px;
  color: var(--text-secondary);
  text-align: center;
}

.duplicate-row {
  background: #fffaf0;
}

.duplicate-row:hover {
  background: #fff6e6;
}

.duplicate-alert {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 4px 7px;
  border: 1px solid #f0c76b;
  border-radius: 999px;
  background: #fff5d9;
  color: #98530b;
  font-size: 9px;
  font-weight: 800;
  animation: blink-alert 1.7s ease-in-out infinite;
}

.duplicate-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #f0c76b;
  border-left: 4px solid #d88409;
  border-radius: var(--radius-sm);
  background: #fff9e9;
  color: #80460a;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  line-height: 1.45;
}

.duplicate-banner svg {
  color: #c87104;
}

.status,
.recipient-check {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pending {
  border-color: #f0d3a7;
  background: var(--amber-light);
  color: #9a570d;
}

.status-approved,
.status-instructed {
  border-color: #b7dfc3;
  background: var(--green-light);
  color: #176a3b;
}

.status-failed {
  border-color: #edc0bd;
  background: var(--red-light);
  color: #a83c36;
}

.recipient-match {
  border-color: #b7dfc3;
  background: var(--green-light);
  color: #176a3b;
}

.recipient-mismatch {
  border-color: #edbbb8;
  background: var(--red-light);
  color: #aa3732;
}

.recipient-check+small {
  margin-top: 5px;
  color: var(--red);
  font-size: 10px;
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.tabs a {
  padding: 8px 13px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.tabs a:hover {
  color: var(--primary);
  background: #f1f7fb;
}

.tabs a.active {
  background: var(--primary);
  box-shadow: 0 3px 7px rgb(0 86 145 / 20%);
  color: #fff;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(500px, 1.25fr) minmax(410px, .75fr);
  align-items: start;
  gap: 20px;
}

.review-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.review-nav .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.review-nav .is-disabled {
  border-color: transparent;
  background: #f5f7fa;
  color: #c2ccd6;
}

.review-nav-count {
  min-width: 58px;
  padding: 0 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.document-viewer {
  position: sticky;
  top: 92px;
  height: calc(100vh - 116px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #d7e0e8;
  border-radius: var(--radius);
  background: #273746;
  box-shadow: var(--shadow);
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px 0 15px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  background: #183146;
  color: #f8fbff;
  font-size: 12px;
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.viewer-controls span {
  min-width: 52px;
  color: #d7e2eb;
  text-align: center;
}

.viewer-controls .icon-button {
  color: #dce9f3;
}

.viewer-controls .icon-button:hover {
  border-color: rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

.viewer-stage {
  position: relative;
  display: grid;
  place-items: start center;
  height: calc(100% - 48px);
  padding: 24px;
  overflow: auto;
  background: #405364;
}

.viewer-stage canvas,
.viewer-stage img {
  display: none;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 12px 30px rgb(0 0 0 / 27%);
}

.viewer-stage canvas.visible,
.viewer-stage img.visible {
  display: block;
}

.viewer-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.viewer-loading,
.viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #e9f1f6;
  font-size: 12px;
}

.viewer-error[hidden],
.viewer-loading[hidden] {
  display: none;
}

.viewer-loading svg,
.htmx-request svg {
  animation: spin 1s linear infinite;
}

.review-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.form-section {
  padding: 19px;
}

.extracted-field,
.field-block,
.form-grid>label,
.payment-form>label {
  display: block;
  min-width: 0;
  margin-bottom: 14px;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0px;
}

.field-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.confidence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  height: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #c9f7df;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.confidence-missing {
  min-width: auto;
  height: auto;
  padding: 4px 8px;
  background: #eef2f6;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.manual-check {
  color: #177542;
  font-size: 10px;
  font-weight: 800;
}

.low-confidence .confidence {
  background: #ffdadd;
  color: var(--red);
}

.low-confidence input {
  border-color: #e3a3a0;
  box-shadow: inset 3px 0 #c84b45;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
  min-height: 64px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebeca;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4a99c9;
  box-shadow: 0 0 0 3px rgb(0 86 145 / 12%);
}

.recipient-alert {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 3px solid;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.invoice-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.invoice-data-grid>.extracted-field,
.invoice-data-grid>.field-block {
  min-width: 0;
}

.data-span-full {
  grid-column: 1 / -1;
}

.field-title {
  display: block;
}

.currency-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.currency-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.currency-choice label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: color var(--transition);
}

.currency-choice label::before {
  width: 13px;
  height: 13px;
  border: 1px solid #9fb0c0;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
  content: "";
  transition: border-color var(--transition), background var(--transition);
}

.currency-choice input:checked+label {
  color: var(--primary);
}

.currency-choice input:checked+label::before {
  border-color: var(--primary);
  background: var(--primary);
}

.data-span-full .field-label {
  margin-bottom: 7px;
}

.data-span-full .field-label label {
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

.manual-provider-panel {
  margin: 0 0 14px;
}

.manual-provider-panel[hidden] {
  display: none;
}

.manual-provider-name {
  display: block;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.data-span-full select {
  margin-top: 0;
}

.classification-block {
  margin-top: 12px;
}

.classification-block .field-block {
  margin-bottom: 0;
}

.item-legends {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.item-legends li {
  padding: 9px 10px;
  border-left: 3px solid #70b8c1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #f2fafb;
  color: #395363;
  font-size: 11px;
  line-height: 1.45;
}

.inline-error,
.empty-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.inline-error {
  border-color: #edc0bd;
  background: var(--red-light);
  color: #a03430;
}

.empty-inline {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--text-secondary);
}

.fiscal-section {
  border-left: 3px solid var(--primary);
}

.fiscal-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.fiscal-refresh:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  transform: rotate(25deg);
}

.fiscal-refresh svg {
  width: 18px;
  height: 18px;
}

.fiscal-spinner {
  align-items: center;
}

.fiscal-spinner svg {
  width: 16px;
  height: 16px;
}

.fiscal-refresh .fiscal-spinner {
  display: none;
}

.fiscal-refresh.htmx-request .refresh-icon,
.fiscal-refresh:has(.fiscal-spinner.htmx-request) .refresh-icon {
  display: none;
}

.fiscal-refresh.htmx-request .fiscal-spinner,
.fiscal-refresh .fiscal-spinner.htmx-request {
  display: inline-flex;
}

.fiscal-summary {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.fiscal-summary div {
  padding: 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fiscal-summary div:nth-child(even) {
  border-right: 0;
}

.fiscal-summary div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.fiscal-summary span,
.fiscal-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.fiscal-summary span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.fiscal-summary strong {
  margin-top: 4px;
  color: #263c4d;
  font-size: 11px;
}

.fiscal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 15px;
}

.fiscal-columns h4 {
  margin: 0 0 7px;
  color: #365064;
  font-size: 11px;
}

.data-list {
  margin: 0;
  padding-left: 18px;
  color: #516578;
  font-size: 10px;
}

.data-list li {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.raw-details {
  margin-top: 14px;
  font-size: 11px;
}

.raw-details summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 750;
}

.raw-details pre {
  max-height: 260px;
  padding: 11px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: #1e3343;
  color: #d8e9f2;
  font-size: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

.sticky-actions {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #cbd9e2;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 8px 22px rgb(15 23 42 / 10%);
  backdrop-filter: blur(12px);
}

.sticky-actions>span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10px;
}

.items-section {
  padding: 20px;
}

.items-section .section-heading {
  padding: 20px 22px 0;
}

.payment-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 14px;
}

.payment-form .span-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.future-state {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 180px;
  padding: 28px;
  border: 1px dashed #b9c8d4;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 62%);
}

.future-state>svg {
  width: 34px;
  height: 34px;
  color: var(--amber);
}

.future-state h2 {
  margin: 0 0 7px;
  font-family: Manrope, Inter, sans-serif;
  color: #16344b;
  font-size: 18px;
}

.future-state p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.login-shell {
  width: min(1420px, calc(100% - 64px));
  height: 100svh;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(12px, 2.8vh, 28px) 0;
}

.login-experience {
  display: grid;
  grid-template-columns: minmax(360px, 44%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dfe7ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 56px rgb(15 35 54 / 12%);
}

.login-visual {
  min-height: 100%;
  background: #12334a;
}

.login-visual img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: 46% center;
  display: block;
}

.login-content {
  display: flex;
  position: relative;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: clamp(38px, 6vw, 82px);
  background: #fff;
}

.login-brandmarks {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  width: 100%;
}

.login-brand {
  display: block;
  object-fit: contain;
  object-position: center;
}

.login-brand-edison {
  width: min(312px, calc(60% - 10px));
  height: 105px;
}

.login-brand-tripoli {
  width: min(208px, calc(40% - 10px));
  height: 70px;
}

.login-copy {
  width: min(490px, 100%);
  margin: auto;
  padding: 54px 0;
}

.login-copy .eyebrow {
  margin: 0 0 14px;
  color: #087c78;
}

.login-copy h1 {
  margin: 0;
  font-family: Manrope, Inter, sans-serif;
  color: #102f48;
  font-size: clamp(28px, 2.55vw, 39px);
  font-weight: 800;
  line-height: 1.22;
}

.login-copy>p:not(.eyebrow) {
  max-width: 390px;
  margin: 18px 0 31px;
  color: #60758a;
  font-size: 20px;
  line-height: 2;
}

.login-microsoft-button {
  display: inline-flex;
  width: min(400px, 100%);
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 13px 22px;
  border: 1px solid #005691;
  border-radius: 10px;
  background: #005691;
  box-shadow: 0 10px 20px rgb(0 86 145 / 20%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.login-microsoft-button:hover {
  background: #004373;
  box-shadow: 0 13px 24px rgb(0 86 145 / 27%);
  transform: translateY(-2px);
}

.login-microsoft-button:focus-visible {
  outline: 3px solid rgb(14 165 233 / 35%);
  outline-offset: 3px;
}

.login-microsoft-button svg {
  width: 21px;
  height: 21px;
}

.login-copyright {
  margin: 0;
  color: #8a9aac;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes blink-alert {

  0%,
  100% {
    border-color: #f0c76b;
    box-shadow: 0 0 0 0 rgb(216 132 9 / 0);
  }

  50% {
    border-color: #dd8c19;
    box-shadow: 0 0 0 4px rgb(216 132 9 / 13%);
  }
}

.payment-page-heading {
  margin-bottom: 18px;
}

.payment-batch-form {
  min-width: 0;
}

.payment-command-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.payment-command-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.payment-command-fields label {
  display: grid;
  gap: 0px;
  min-width: 180px;
  color: #405064;
  font-size: 11px;
  font-weight: 750;
}

.payment-command-fields input,
.payment-command-fields select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.payment-command-fields input:focus,
.payment-command-fields select:focus {
  border-color: #78a7c8;
  box-shadow: 0 0 0 3px rgb(19 101 157 / 12%);
}

.payment-command-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}

.payment-selection-count {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.payment-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.payment-submit-button svg {
  width: 15px;
  height: 15px;
}

.payment-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(292px, 355px);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.payment-table-panel {
  min-width: 0;
  margin-top: 0;
  padding: 0;
}

.payment-table-wrap {
  overflow-x: auto;
}

.payment-table th,
.payment-table td {
  padding: 4px 6px;
  white-space: nowrap;
}

.payment-table th {
  font-size: 11px;
}

.payment-table td {
  font-size: 11px;
}

.payment-table .status,
.payment-table .recipient-check {
  min-height: auto;
  font-size: 11px;
}

.payment-vendor,
.payment-document {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-check-cell {
  width: 38px;
  text-align: center;
}

.payment-check-cell input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.payment-table tbody tr.is-selected {
  background: #edf8f4;
}

.payment-table tbody tr.is-selected:hover {
  background: #e4f4ee;
}

.payment-summary {
  position: sticky;
  top: 86px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.payment-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 14px;
  border-bottom: 1px solid #e7edf2;
}

.payment-summary-heading .eyebrow {
  margin-bottom: 4px;
}

.payment-summary-heading h2 {
  margin: 0;
  color: #16344b;
  font-family: Manrope, Inter, sans-serif;
  font-size: 15px;
}

.payment-summary-heading>svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.payment-summary-section {
  padding: 14px 17px;
  border-bottom: 1px solid #edf1f5;
}

.payment-summary-label,
.payment-estimate-total,
.payment-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-summary-label {
  color: #405064;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.payment-summary-label strong {
  color: #1d415a;
  font-size: 11px;
  letter-spacing: 0;
}

.payment-provider-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.payment-provider-row {
  padding-bottom: 7px;
  border-bottom: 1px dashed #e5ecf1;
  color: #526577;
  font-size: 11px;
}

.payment-provider-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.payment-provider-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-provider-row strong {
  flex: 0 0 auto;
  color: #25475f;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.payment-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

.payment-estimate {
  padding: 14px 17px 17px;
  background: #f7fbfe;
}

.payment-rate {
  min-height: 29px;
  color: #65788a;
  font-size: 11px;
  line-height: 1.45;
}

.payment-estimate-total {
  margin-top: 9px;
  padding-top: 11px;
  border-top: 1px solid #dce8f0;
  color: #2c4659;
  font-size: 12px;
  font-weight: 750;
}

.payment-estimate-total strong {
  color: #12613f;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.payment-submit-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 30 43 / 34%);
  backdrop-filter: blur(3px);
}

.payment-submit-modal[hidden] {
  display: none;
}

.payment-submit-dialog {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(330px, 100%);
  padding: 25px;
  border: 1px solid #d9e5ed;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.payment-submit-dialog>svg {
  width: 30px;
  height: 30px;
  color: var(--primary);
  animation: spin .8s linear infinite;
}

.payment-submit-dialog strong {
  color: #1d3d54;
  font-family: Manrope, Inter, sans-serif;
  font-size: 14px;
}

.payment-submit-dialog span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.onvio-annulment-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-color: #f0cfcc;
  background: #fffafa;
}

.onvio-annulment-section h2 {
  margin: 2px 0 6px;
  font-size: 17px;
}

.button-danger {
  border-color: #e6a8a4;
  background: #c8433e;
  color: #fff;
  white-space: nowrap;
}

.button-danger:hover {
  border-color: #ad2f2a;
  background: #ad2f2a;
}

@media (max-width: 720px) {
  .onvio-annulment-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

.payment-history-section {
  margin-top: 20px;
  padding: 0;
}

.payment-history-section .section-heading,
.payment-history-detail-section .section-heading {
  padding: 18px 20px 14px;
}

.payment-history-section .table-wrap,
.payment-history-detail-section .table-wrap {
  border-top: 1px solid #e7edf2;
}

.history-count {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.payment-history-table th,
.payment-history-table td {
  padding: 11px 14px;
  white-space: nowrap;
}

.payment-history-table td {
  font-size: 11px;
}

.history-detail-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10px;
  white-space: nowrap;
}

.history-detail-button svg {
  width: 13px;
  height: 13px;
}

.payment-history-heading .back-link {
  margin-bottom: 14px;
}

.payment-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow-sm);
}

.payment-history-summary div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 15px 17px;
  background: #fff;
}

.payment-history-summary span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.payment-history-summary strong {
  overflow: hidden;
  color: #29485e;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-history-detail-section {
  margin-top: 20px;
  padding: 0;
}

.onvio-catalog-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid #1d8d76;
  border-radius: var(--radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.onvio-catalog-card h2,
.onvio-section-heading h2 {
  margin: 2px 0 4px;
  color: #1d3d54;
  font-family: Manrope, Inter, sans-serif;
  font-size: 17px;
}

.onvio-catalog-card p,
.onvio-section-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.onvio-catalog-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.onvio-catalog-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.onvio-catalog-upload .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.onvio-catalog-filename {
  max-width: 220px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onvio-catalog-upload .button svg,
.onvio-history-actions svg {
  width: 14px;
  height: 14px;
}

.onvio-command-bar {
  margin-bottom: 18px;
}

.onvio-command-bar .payment-command-fields label {
  min-width: 110px;
}

.onvio-command-bar input[type="number"] {
  width: 110px;
}

.onvio-month-field {
  display: grid;
  gap: 4px;
  min-width: 80px;
  color: #405064;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}

.onvio-month-field input {
  width: 78px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.onvio-command-help {
  margin: 0;
  max-width: 390px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.onvio-section {
  margin-top: 18px;
  padding: 0;
}

.onvio-unmatched-section {
  border-left: 3px solid #d48a13;
}

.onvio-section-heading {
  align-items: center;
  padding: 17px 20px 14px;
}

.onvio-selection-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.onvio-selection-action>span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.onvio-selection-action .button {
  min-height: 36px;
  font-size: 11px;
  white-space: nowrap;
}

.onvio-selection-action .button svg {
  width: 15px;
  height: 15px;
}

.onvio-table th,
.onvio-table td {
  padding: 7px 10px;
  white-space: nowrap;
}

.onvio-table tr.is-selected td {
  background: #f0faf6;
}

.onvio-table .payment-vendor {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arca-table-indicator {
  color: #476277;
  font-size: 11px;
  font-weight: 700;
}

.onvio-file-link {
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

.onvio-file-link:hover {
  text-decoration: underline;
}

.onvio-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.onvio-history-actions form {
  margin: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(18px) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 1140px) {
  .app-header {
    gap: 18px;
    padding: 0 20px;
  }

  .main-nav a {
    padding: 8px 9px;
  }

  .main-nav a span {
    display: none;
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metric-strip-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-insights {
    grid-template-columns: 1fr;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }

  .document-viewer {
    position: relative;
    top: 0;
    height: 72vh;
    min-height: 500px;
  }

  .payment-workspace {
    grid-template-columns: 1fr;
  }

  .payment-summary {
    position: static;
  }

  .payment-history-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 880px) {
  .metric-strip-dashboard {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .app-header {
    min-height: 60px;
    gap: 10px;
    padding: 0 12px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .brand-divider,
  .brand-copy,
  .header-edison-logo,
  .user-name {
    display: none;
  }

  .main-nav {
    flex: 1;
    justify-content: center;
  }

  .main-nav a {
    padding: 8px 7px;
  }

  .main-nav a svg {
    width: 17px;
    height: 17px;
  }

  .page-shell,
  .wide-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 24px;
  }

  .page-heading h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions .button {
    width: 100%;
  }

  .metric-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric {
    min-height: 116px;
  }

  .metric-strip-dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-insight-card {
    padding: 16px;
  }

  .chart-bar-item {
    grid-template-columns: minmax(70px, 0.8fr) minmax(52px, 1fr);
    gap: 8px;
  }

  .chart-bar-track {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .chart-bar-value {
    grid-column: 1;
    min-width: 0;
    text-align: left;
  }

  .dashboard-creditor-table {
    min-width: 620px;
  }

  .payment-filter-notice {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .payment-filter-notice a {
    width: 100%;
    margin-left: 23px;
  }

  .tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .tabs a {
    flex: 1;
    text-align: center;
    white-space: nowrap;
  }

  .invoice-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-command-bar,
  .payment-command-action {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-command-fields {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payment-command-fields label {
    min-width: 0;
  }

  .payment-submit-button {
    width: 100%;
  }

  .payment-history-summary {
    grid-template-columns: 1fr;
  }

  .invoice-search {
    width: 100%;
  }

  .content-section {
    padding: 16px;
  }

  .table-section {
    padding: 0;
  }

  .document-viewer {
    height: 62vh;
    min-height: 420px;
  }

  .viewer-stage {
    padding: 12px;
  }

  .invoice-data-grid,
  .fiscal-summary,
  .fiscal-columns,
  .payment-form {
    grid-template-columns: 1fr;
  }

  .fiscal-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line) !important;
  }

  .fiscal-summary div:last-child {
    border-bottom: 0 !important;
  }

  .sticky-actions {
    bottom: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .sticky-actions .button {
    width: 100%;
  }

  .sticky-actions>span {
    display: none;
  }

  .login-shell {
    width: min(100% - 24px, 620px);
    height: 100svh;
    padding: 12px 0;
  }

  .login-experience {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  .login-visual {
    min-height: 0;
    height: 28%;
    max-height: none;
  }

  .login-visual img {
    min-height: 0;
    object-position: center 58%;
  }

  .login-content {
    min-height: 0;
    padding: 22px 24px;
  }

  .login-brandmarks {
    gap: 12px;
  }

  .login-brand-tripoli {
    height: 46px;
  }

  .login-brand-edison {
    height: 69px;
  }

  .login-copy {
    margin: auto 0;
    padding: 20px 0;
  }

  .login-copy h1 {
    font-size: 27px;
  }

  .toast-container {
    top: 72px;
    right: 12px;
  }
}
