:root {
  --font-ui: "Segoe UI Variable Text", "Aptos", "Segoe UI", "Calibri", sans-serif;
  --bg: #e6ecf2;
  --surface: #ffffff;
  --surface-soft: #f8f1de;
  --surface-border: #d4dce7;
  --surface-border-strong: #acbacb;

  --text: #0f1723;
  --text-soft: #536475;
  --text-faint: #7d8897;

  --topbar-green: #1b7f34;

  --orange: #f59e0b;
  --green: #17964f;
  --red: #dc2626;
  --blue: #17385f;
  --brand-gold: #ffc423;
  --brand-black: #070a0d;
  --brand-green: #16964f;
  --brand-navy: #102746;
  --brand-teal: #0d5663;
  --brand-ivory: #fbf7ea;

  --shadow: 0 22px 46px rgba(7, 10, 13, 0.1);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  /* SAP / nav */
  --nav-dark: #070a0d;
  --nav-text: #ffffff;
  --nav-hover: #ffd765;
  --nav-active: #ffc423;
  --sap-group-grey: #17355d;
  --sap-close-dip: #f8dc7b;
  --sap-closing-sap: #d7e3f2;
  --sap-variance: #f2d3b7;
  --sap-date-col: #f7f5ed;
  --table-head-bg: #17385f;
  --table-head-bg-strong: #0b1d34;
  --table-head-text: #ffffff;
  --table-row-alt: #f8f2e3;
  --table-row-hover: #e7f0f3;
  --table-sticky-cell: #fcf8ee;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: var(--font-ui);
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 46%, var(--bg) 100%);
  color: var(--text);
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
label,
button,
input,
select,
textarea,
table,
th,
td,
a {
  font-family: var(--font-ui);
}

button,
input,
select,
textarea,
table,
th,
td {
  font: inherit;
  font-family: inherit;
}

/* =========================
   HEADER
   ========================= */

.topbar {
  background: var(--topbar-green);
  color: #ffffff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);

  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;

  position: sticky;
  top: 0;
  z-index: 1000;
}

/* SAP top nav */
.topbar.sap-nav,
.sap-topbar {
  background:
    linear-gradient(180deg, rgba(255, 196, 35, 0.08) 0%, rgba(255, 196, 35, 0) 28%),
    linear-gradient(180deg, #0c1014 0%, #070a0d 100%);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 18px;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  border-bottom: 4px solid var(--brand-gold);

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 20px;
  flex-wrap: nowrap;
  position: relative;
  min-height: 86px;
  overflow: visible;
  z-index: 1400;
}

.topbar.sap-nav .brand-block,
.sap-topbar .brand-block {
  display: contents;
}

.topbar.sap-nav .brand-logos,
.sap-topbar .brand-logos {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  position: static;
  z-index: 2;
}

.topbar.sap-nav .brand-copy,
.sap-topbar .brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 180px;
  align-items: flex-start;
  text-align: left;
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 2px 18px 2px 0;
  min-width: 260px;
}

.topbar.sap-nav .brand-title,
.sap-topbar .brand-title {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.topbar.sap-nav .brand-logo,
.sap-topbar .brand-logo {
  width: 148px;
  max-width: 100%;
  height: auto;
  display: block;
  flex: 0 0 auto;
  position: static;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}

.topbar.sap-nav .brand-logo-edge,
.sap-topbar .brand-logo-edge {
  margin-left: 0;
}

.topbar.sap-nav .brand-edge-slot,
.sap-topbar .brand-edge-slot {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  z-index: 4;
}

.topbar.sap-nav .partner-logo,
.sap-topbar .partner-logo {
  width: 102px;
  max-width: 100%;
  height: auto;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.24));
}

.topbar.sap-nav h1,
.sap-topbar h1 {
  margin: 0;
  font-size: clamp(30px, 2.4vw, 35px);
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.topbar.sap-nav .sub,
.sap-topbar .sub {
  font-size: 11px;
  color: #ffd765;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.topbar.sap-nav .nav,
.sap-topbar .nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 0 1 auto;
  width: auto;
  padding-top: 0;
  margin: 0 auto;
  max-width: none;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 1450;
  scrollbar-width: none;
}

.topbar.sap-nav .nav-row,
.sap-topbar .nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: auto;
  min-height: 54px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 196, 35, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1450;
}

.topbar.sap-nav .nav a,
.topbar.sap-nav .nav .nav-dropdown-toggle,
.topbar.sap-nav .nav .nav-logout,
.sap-topbar .nav a,
.sap-topbar .nav .nav-logout {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-radius: 8px;
  flex: 0 0 auto;
  opacity: 0.94;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

.topbar.sap-nav .nav .nav-dropdown-toggle,
.topbar.sap-nav .nav .nav-logout,
.sap-topbar .nav .nav-dropdown-toggle,
.sap-topbar .nav .nav-logout {
  appearance: none;
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: none;
}

.topbar.sap-nav .nav .nav-logout,
.sap-topbar .nav .nav-logout {
  color: #f3f7fb;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}

.topbar.sap-nav .nav .nav-dropdown-label,
.sap-topbar .nav .nav-dropdown-label {
  display: inline-flex;
  align-items: center;
}

.topbar.sap-nav .nav .nav-dropdown-caret,
.sap-topbar .nav .nav-dropdown-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  opacity: 0.95;
  transform: translateY(1px);
}

.topbar.sap-nav .nav .nav-dropdown-caret::before,
.sap-topbar .nav .nav-dropdown-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.18s ease;
}

.topbar.sap-nav .nav a:hover,
.topbar.sap-nav .nav .nav-dropdown-toggle:hover,
.topbar.sap-nav .nav .nav-logout:hover {
  color: #ffffff;
  border-color: rgba(255, 196, 35, 0.34);
  opacity: 1;
  background: rgba(255, 196, 35, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: none;
}

.topbar.sap-nav .nav a.active,
.topbar.sap-nav .nav .nav-dropdown-toggle.active,
.topbar.sap-nav .nav .nav-dropdown.active > .nav-dropdown-toggle {
  color: #070a0d;
  border-color: var(--nav-active);
  opacity: 1;
  background: linear-gradient(180deg, #ffd765 0%, #ffc423 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 196, 35, 0.08);
  text-shadow: none;
  transform: none;
}

.topbar.sap-nav .nav .nav-dropdown.is-open > .nav-dropdown-toggle,
.sap-topbar .nav .nav-dropdown.is-open > .nav-dropdown-toggle {
  background: rgba(255, 196, 35, 0.08);
  border-color: rgba(255, 196, 35, 0.34);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 196, 35, 0.08);
}

.topbar.sap-nav .nav .nav-dropdown.is-open .nav-dropdown-caret::before,
.sap-topbar .nav .nav-dropdown.is-open .nav-dropdown-caret::before {
  transform: rotate(180deg);
}

.topbar.sap-nav .nav .nav-dropdown,
.sap-topbar .nav .nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1500;
}

.topbar.sap-nav .nav .nav-dropdown-menu,
.sap-topbar .nav .nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 236px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 196, 35, 0.32);
  background:
    linear-gradient(180deg, rgba(17, 28, 40, 0.99) 0%, rgba(9, 16, 24, 0.99) 100%);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  z-index: 1600;
}

.topbar.sap-nav .nav .nav-dropdown-menu[hidden],
.sap-topbar .nav .nav-dropdown-menu[hidden] {
  display: none !important;
}

.topbar.sap-nav .nav .nav-dropdown.is-open .nav-dropdown-menu,
.sap-topbar .nav .nav-dropdown.is-open .nav-dropdown-menu {
  display: grid;
  gap: 6px;
}

.topbar.sap-nav .nav .nav-dropdown-menu a,
.sap-topbar .nav .nav-dropdown-menu a {
  display: block;
  padding: 11px 13px;
  border-radius: 12px;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.97;
}

.topbar.sap-nav .nav .nav-dropdown-menu a:hover,
.sap-topbar .nav .nav-dropdown-menu a:hover {
  background: rgba(255, 196, 35, 0.14);
  border-bottom: 0;
  color: #fff6d6;
}

.topbar.sap-nav .nav .nav-dropdown-menu a.active,
.sap-topbar .nav .nav-dropdown-menu a.active {
  background: rgba(255, 196, 35, 0.18);
  color: #fff6d6;
}

/* =========================
   STICKY FILTERS
   ========================= */

.filters-panel,
.kpi-grid,
.process-strip {
  position: sticky;
  top: 90px;
  z-index: 900;
  background: var(--bg);
}

/* =========================
   TABLES
   ========================= */

.table-wrap {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(16, 39, 70, 0.12);
  max-height: 500px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(7, 10, 13, 0.04);
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #8a96a6 #f3f5f7;
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f4f6f8;
  border-left: 1px solid var(--surface-border);
  border-top: 1px solid var(--surface-border);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #9aa4b3;
  border-radius: 999px;
  border: 2px solid #f4f6f8;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #7b8798;
}

.table-shell,
.table-card {
  padding: 14px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(16, 39, 70, 0.1);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(7, 10, 13, 0.04);
}

table {
  width: 100%;
  min-width: 980px;
  background: #fff;
}

/* keep collapse ONLY for normal tables */
table:not(.transactions-table) {
  border-collapse: collapse;
}

th, td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--surface-border);
  font-size: 13px;
  white-space: nowrap;
}

/* sticky header */
.table-wrap thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  color: #143258;
  z-index: 500;
  border-top: 1px solid #b79a59;
  border-bottom: 2px solid #b79a59;
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* generic sticky first column */
.table-wrap table th:first-child,
.table-wrap table td:first-child {
  position: sticky;
  left: 0;
}

.table-wrap table th:first-child {
  background: #ffffff;
  color: #143258;
  z-index: 650;
}

.table-wrap table td:first-child {
  background: var(--table-sticky-cell);
  z-index: 600;
  border-right: 1px solid var(--surface-border-strong);
}

.table-wrap tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

.table-wrap tbody tr:hover td {
  background: var(--table-row-hover);
}

.table-wrap tbody tr:nth-child(even) td:first-child,
.table-wrap tbody tr:hover td:first-child {
  background: inherit;
}

/* =========================
   TRANSACTIONS TABLE
   ========================= */

.transactions-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: separate !important;
  border-spacing: 0;
  table-layout: auto;
}

.transactions-table th,
.transactions-table td {
  font-size: 14px;
  padding: 7px 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.transactions-table thead th {
  top: 0;
  background:
    linear-gradient(180deg, rgba(15, 20, 26, 0.96) 0%, rgba(6, 9, 11, 1) 100%);
  color: #ffe08a;
  z-index: 500;
  border-top: 1px solid rgba(255, 196, 35, 0.75);
  border-bottom: 2px solid rgba(255, 196, 35, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transactions-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

.transactions-table tbody tr:hover {
  background: var(--table-row-hover);
}

/* lock first column cleanly */
.transactions-table th:first-child,
.transactions-table td:first-child {
  position: sticky;
  left: 0;
  min-width: 60px;
  width: 60px;
  max-width: 60px;
  text-align: center;
  border-right: 1px solid var(--surface-border-strong);
}

.transactions-table thead th:first-child {
  background:
    linear-gradient(180deg, rgba(12, 16, 20, 0.98) 0%, rgba(6, 9, 11, 1) 100%);
  color: #ffe08a;
  z-index: 700;
}

.transactions-table tbody td:first-child {
  background: var(--table-sticky-cell);
  z-index: 650;
  transform: translateZ(0);
}

.transactions-table tbody tr:nth-child(even) td:first-child {
  background: var(--table-row-alt);
}

.transactions-table tbody tr:hover td:first-child {
  background: var(--table-row-hover);
}

/* keep second column readable */
.transactions-table th:nth-child(2),
.transactions-table td:nth-child(2) {
  min-width: 210px;
}

/* wider cost centre */
.transactions-table th:nth-child(10),
.transactions-table td:nth-child(10) {
  min-width: 260px;
}

/* dropdowns inside transaction rows */
.transactions-table select {
  font-size: 10px;
  height: 28px;
  min-width: 128px;
  padding: 3px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
}

/* tighter date input */
.field input[type="date"] {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 6px 8px;
  font-size: 12px;
  height: 32px;
}

/* =========================
   SAP TABLES
   ========================= */

.sap-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  max-height: 74vh;
}

#sapTable {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

#sapTable th,
#sapTable td {
  padding: 7px 8px;
  border: 1px solid #dde4ee;
  font-size: 12px;
}

#sapTable thead tr.group-row th {
  position: sticky;
  top: 0;
  background: var(--sap-group-grey);
  color: #fff;
}

#sapTable thead tr.column-row th {
  position: sticky;
  top: 31px;
  background: #f7f7f7;
}

#sapTable thead th.close-dip { background: var(--sap-close-dip); }
#sapTable thead th.closing-sap { background: var(--sap-closing-sap); }
#sapTable thead th.variance { background: var(--sap-variance); }
#sapTable thead th.date-col { background: var(--sap-date-col); }

#sapTable tbody td {
  text-align: right;
}

#sapTable tbody td.date-col {
  text-align: center;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: #fbfdff;
}

/* =========================
   UI
   ========================= */

.card {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(7, 10, 13, 0.04);
  padding: 18px;
  width: 100%;
  margin: 0 0 14px 0;
  overflow: hidden;
  border: 1px solid rgba(16, 39, 70, 0.1);
  background: #ffffff;
}

.card.compact-card {
  padding: 14px 12px;
  background: #ffffff;
  border: 1px solid rgba(16, 39, 70, 0.1);
  box-shadow: 0 12px 24px rgba(7, 10, 13, 0.04);
  position: relative;
}

.card.compact-card::before {
  display: none;
}

.page {
  width: calc(100% - 8px);
  max-width: none;
  margin: 0 auto;
  padding: 18px 8px 28px;
}

.sap-page,
.page.sap-page {
  width: calc(100% - 8px);
  max-width: none;
  margin: 0 auto;
  padding: 18px 8px 24px;
}

.sap-page .card,
.page.sap-page .card {
  width: 100%;
  margin: 0 0 14px 0;
}

.toolbar {
  padding: 6px 0 4px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.toolbar.compact-toolbar {
  gap: 12px 18px;
  justify-content: flex-start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: min(180px, 100%);
  flex: 1 1 180px;
}

.toolbar.compact-toolbar .field {
  flex: 0 0 190px;
  min-width: 190px;
}

.field label {
  font-size: 13px;
  color: #5a4617;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 196, 35, 0.7);
  border-radius: 8px;
  background: #ffffff;
  color: #3d3216;
  font-weight: 700;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(255, 196, 35, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 196, 35, 0.12);
  transform: none;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-end;
}

.toolbar.compact-toolbar .actions {
  flex: 1 1 auto;
  align-self: flex-end;
}

.toolbar.compact-toolbar .actions button,
.toolbar.compact-toolbar > button,
.toolbar.compact-toolbar > .field > button {
  min-width: 140px;
}

button {
  background: #fff6d6;
  color: #3d3216;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 196, 35, 0.7);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 18px rgba(6, 9, 11, 0.06);
}

button:hover {
  background: #ffe9a3;
  color: #2b220b;
  border-color: rgba(255, 196, 35, 0.95);
  box-shadow: 0 12px 20px rgba(6, 9, 11, 0.08);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  color: #3d3216;
}

.compact-toolbar .actions button:first-child {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(6, 9, 11, 0.08);
}

button:disabled,
button.secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  font-size: 13px;
  color: var(--text-soft);
}

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 14px;
}

.page-intro-copy {
  max-width: 760px;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1.08;
  color: #102746;
  letter-spacing: -0.02em;
}

.page-intro p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.table-context {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding: 2px 4px 12px;
}

.table-context h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  color: #143258;
}

.table-context p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--text-soft);
}

.table-context-note {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a6a09;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 900px) {
  .topbar.sap-nav {
    flex-wrap: wrap;
    align-items: flex-start;
    padding-right: 14px;
    min-height: 0;
  }

  .topbar.sap-nav .brand-block,
  .sap-topbar .brand-block {
    display: contents;
  }

  .topbar.sap-nav .brand-logos,
  .sap-topbar .brand-logos {
    flex-wrap: nowrap;
    gap: 8px;
    order: 1;
  }

  .topbar.sap-nav .brand-copy,
  .sap-topbar .brand-copy {
    min-width: 0;
    position: static;
    align-items: flex-start;
    text-align: left;
    order: 2;
    width: 100%;
    transform: none;
    padding: 0;
  }

  .topbar.sap-nav .brand-edge-slot,
  .sap-topbar .brand-edge-slot {
    position: static;
    order: 3;
    margin-left: auto;
    transform: none;
  }

  .topbar.sap-nav .brand-logo,
  .sap-topbar .brand-logo {
    width: 108px;
    position: static;
    right: auto;
    top: auto;
    transform: none;
  }

  .topbar.sap-nav .partner-logo,
  .sap-topbar .partner-logo {
    width: 52px;
  }

  .topbar.sap-nav .nav,
  .sap-topbar .nav {
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
    align-items: flex-start;
    overflow: visible;
    padding-top: 0;
    order: 4;
    margin: 10px 0 0;
  }

  .topbar.sap-nav .nav-row,
  .sap-topbar .nav-row {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    min-height: 0;
    padding: 6px;
    border: 1px solid rgba(255, 196, 35, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: none;
    backdrop-filter: none;
  }

  .page,
  .sap-page,
  .page.sap-page {
    padding: 16px 12px 24px;
  }

  .page-intro,
  .table-context {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 14px;
  }

  .card.compact-card {
    padding: 12px;
  }

  .toolbar {
    align-items: stretch;
  }

  .field,
  .actions {
    flex-basis: 100%;
  }

  .toolbar.compact-toolbar .field,
  .toolbar.compact-toolbar .actions {
    flex-basis: 100%;
    min-width: 0;
  }

  .actions button,
  .toolbar button,
  .toolbar .secondary,
  .toolbar input,
  .toolbar select {
    width: 100%;
  }

  .table-wrap,
  .sap-table-wrap {
    max-height: none;
  }
}

.topbar,
.topbar.sap-nav,
.sap-topbar,
.topbar.sap-nav .nav-row,
.sap-topbar .nav-row,
.topbar.sap-nav .nav a,
.topbar.sap-nav .nav .nav-dropdown-toggle,
.sap-topbar .nav a,
.sap-topbar .nav .nav-dropdown-toggle,
.card,
.panel,
.stat-card,
.table-card,
.table-wrap,
.sap-table-wrap,
button,
input,
select,
textarea,
.page-btn,
.pagination .page-btn,
.summary-tile {
  border-radius: 8px !important;
}

/* =========================
   NPL DASHBOARD REFRESH
   ========================= */

:root {
  --bg: #dfe8ef;
  --surface: rgba(250, 252, 253, 0.96);
  --surface-soft: #edf4f8;
  --surface-border: #c8d7e2;
  --surface-border-strong: #8ea4b6;
  --text: #142739;
  --text-soft: #4b6478;
  --text-faint: #728597;
  --topbar-green: #0f5f8e;
  --blue: #0f5f8e;
  --brand-gold: #b79a59;
  --brand-black: #0f2130;
  --brand-navy: #123654;
  --brand-teal: #0d5f77;
  --brand-ivory: #f3f6f8;
  --nav-dark: #123654;
  --nav-hover: #d1b476;
  --nav-active: #b79a59;
  --sap-group-grey: #204a6b;
  --sap-close-dip: #cddbe7;
  --sap-closing-sap: #dce7f0;
  --sap-variance: #e5d8c1;
  --sap-date-col: #eef3f7;
  --table-head-bg: #143758;
  --table-head-bg-strong: #0f2d46;
  --table-row-alt: #f2f7fa;
  --table-row-hover: #e3edf4;
  --table-sticky-cell: #f6f9fb;
  --shadow: 0 24px 54px rgba(9, 28, 44, 0.12);
}

html body {
  background:
    radial-gradient(circle at top left, rgba(15, 95, 142, 0.16) 0%, rgba(15, 95, 142, 0) 28%),
    radial-gradient(circle at top right, rgba(183, 154, 89, 0.12) 0%, rgba(183, 154, 89, 0) 24%),
    linear-gradient(180deg, #f4f8fb 0%, #e7eef4 42%, #dfe8ef 100%) !important;
  color: var(--text);
}

html body .topbar.sap-nav,
html body .sap-topbar {
  background:
    linear-gradient(135deg, rgba(183, 154, 89, 0.18) 0%, rgba(183, 154, 89, 0) 36%),
    linear-gradient(180deg, #194d72 0%, #123654 58%, #0d2940 100%) !important;
  border-bottom: 4px solid rgba(183, 154, 89, 0.9) !important;
  box-shadow:
    0 20px 42px rgba(9, 28, 44, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
}

html body .topbar.sap-nav .sub,
html body .sap-topbar .sub {
  color: #dcc38c !important;
}

html body .topbar.sap-nav .nav-row,
html body .sap-topbar .nav-row {
  border-color: rgba(202, 220, 235, 0.26) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
}

html body .topbar.sap-nav .nav a:hover,
html body .topbar.sap-nav .nav .nav-dropdown-toggle:hover,
html body .sap-topbar .nav a:hover,
html body .sap-topbar .nav .nav-dropdown-toggle:hover,
html body .topbar.sap-nav .nav .nav-dropdown.is-open > .nav-dropdown-toggle,
html body .sap-topbar .nav .nav-dropdown.is-open > .nav-dropdown-toggle {
  border-color: rgba(183, 154, 89, 0.4) !important;
  background: rgba(183, 154, 89, 0.14) !important;
}

html body .topbar.sap-nav .nav a.active,
html body .topbar.sap-nav .nav .nav-dropdown-toggle.active,
html body .topbar.sap-nav .nav .nav-dropdown.active > .nav-dropdown-toggle,
html body .sap-topbar .nav a.active,
html body .sap-topbar .nav .nav-dropdown-toggle.active,
html body .sap-topbar .nav .nav-dropdown.active > .nav-dropdown-toggle {
  color: #102230 !important;
  border-color: rgba(183, 154, 89, 0.95) !important;
  background: linear-gradient(180deg, #d7bf86 0%, #b79a59 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(9, 28, 44, 0.18) !important;
}

html body .topbar.sap-nav .nav .nav-dropdown-menu,
html body .sap-topbar .nav .nav-dropdown-menu {
  border-color: rgba(183, 154, 89, 0.36) !important;
  background: linear-gradient(180deg, rgba(18, 40, 62, 0.99) 0%, rgba(12, 28, 43, 0.99) 100%) !important;
}

html body .topbar.sap-nav .nav .nav-dropdown-menu a:hover,
html body .topbar.sap-nav .nav .nav-dropdown-menu a.active,
html body .sap-topbar .nav .nav-dropdown-menu a:hover,
html body .sap-topbar .nav .nav-dropdown-menu a.active {
  background: rgba(183, 154, 89, 0.18) !important;
  color: #f8f1df !important;
}

html body .page-hero-copy h1,
html body .hero h1 {
  color: #123654 !important;
  letter-spacing: -0.02em;
}

html body .page-hero-copy p,
html body .hero p {
  color: #496173 !important;
}

html body .meta-pill,
html body .status-badge,
html body .switch-link,
html body .visual-board,
html body .status-banner,
html body .toolbar-card,
html body .hero {
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.98) 0%, rgba(233, 241, 246, 0.98) 100%) !important;
  border-color: rgba(15, 95, 142, 0.18) !important;
  box-shadow: 0 16px 34px rgba(9, 28, 44, 0.08) !important;
}

html body .meta-label,
html body .business-window-note,
html body .compact-toolbar .field label,
html body .toolbar.compact-toolbar .field label,
html body label[for="reconDate"] {
  color: #547086 !important;
}

html body .meta-value,
html body .status-badge,
html body .switch-link {
  color: #16344f !important;
}

html body .card,
html body .table-card,
html body .stat-card,
html body .table-shell,
html body .rule-table-card,
html body .site-board,
html body .table-wrap,
html body .sap-table-wrap {
  background: linear-gradient(180deg, rgba(252, 253, 254, 0.98) 0%, rgba(243, 247, 250, 0.98) 100%) !important;
  border-color: rgba(17, 57, 86, 0.12) !important;
  box-shadow: 0 18px 38px rgba(9, 28, 44, 0.08) !important;
}

html body .site-board + .site-board {
  border-top-color: rgba(17, 57, 86, 0.12) !important;
}

html body .field label {
  color: #51697b !important;
}

html body button,
html body .btn,
html body .mini-btn,
html body .multi-select-trigger,
html body .field input,
html body .field select,
html body .field textarea,
html body .summary-tile,
html body input#reconDate,
html body .compact-toolbar .field input,
html body .toolbar.compact-toolbar .field input {
  border-color: rgba(183, 154, 89, 0.78) !important;
  background: #ffffff !important;
  color: #3d3216 !important;
  box-shadow: none !important;
}

html body button,
html body .btn,
html body .mini-btn,
html body .page-btn,
html body .switch-link,
html body .multi-select-trigger {
  background: #ffffff !important;
  border-color: rgba(183, 154, 89, 0.78) !important;
  color: #3d3216 !important;
  text-shadow: none !important;
}

html body button:hover,
html body .btn:hover,
html body .mini-btn:hover,
html body .page-btn:hover,
html body .switch-link:hover,
html body .multi-select-trigger:hover {
  background: #fff9ec !important;
  border-color: rgba(183, 154, 89, 0.96) !important;
  color: #2b220b !important;
}

html body .switch-link:hover {
  background: #fff9ec !important;
}

html body .switch-link.active {
  background: #ffffff !important;
  border-color: rgba(183, 154, 89, 0.96) !important;
  color: #2b220b !important;
}

html body .field input:focus,
html body .field select:focus,
html body .field textarea:focus,
html body .summary-tile:focus,
html body .multi-select-trigger:focus,
html body input#reconDate:focus,
html body .compact-toolbar .field input:focus,
html body .toolbar.compact-toolbar .field input:focus {
  outline: none;
  border-color: rgba(183, 154, 89, 0.96) !important;
  box-shadow: 0 0 0 3px rgba(183, 154, 89, 0.14) !important;
}

html body .multi-select.open .multi-select-trigger {
  background: #ffffff !important;
  border-color: rgba(183, 154, 89, 0.96) !important;
  color: #2b220b !important;
}

html body .multi-select-trigger::after {
  color: #5d7384 !important;
}

html body .status-banner[data-tone="info"] {
  border-color: rgba(15, 95, 142, 0.2) !important;
  background: rgba(227, 238, 244, 0.94) !important;
  color: #17385f !important;
}

html body .status-badge[data-tone="dirty"],
html body .status-badge[data-tone="success"],
html body .rule-table tbody tr.recon-only-row td {
  background: rgba(227, 238, 244, 0.92) !important;
  border-color: rgba(15, 95, 142, 0.28) !important;
  color: #20465f !important;
}

html body .rule-table tbody tr.recon-only-row:nth-child(even) td {
  background: rgba(216, 229, 238, 0.92) !important;
}

html body .table-wrap thead th,
html body .transactions-table thead th,
html body .rule-table th {
  background: #ffffff !important;
  color: #143258 !important;
  border-top-color: #b79a59 !important;
  border-bottom-color: #b79a59 !important;
}

html body .table-wrap table th:first-child,
html body .transactions-table thead th:first-child {
  background: #ffffff !important;
  color: #143258 !important;
}

html body .table-wrap tbody tr:nth-child(even) td,
html body .transactions-table tbody tr:nth-child(even),
html body .table-wrap table td:first-child,
html body .transactions-table tbody td:first-child {
  background: #f2f7fa !important;
}

html body .table-wrap tbody tr:hover td,
html body .transactions-table tbody tr:hover,
html body .transactions-table tbody tr:hover td:first-child {
  background: #e4edf4 !important;
}

html body .page-btn {
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.98) 0%, rgba(232, 240, 245, 0.98) 100%) !important;
  color: #17385f !important;
  border-color: rgba(15, 95, 142, 0.22) !important;
}

html body .page-btn:hover {
  background: linear-gradient(180deg, rgba(236, 244, 249, 0.98) 0%, rgba(219, 231, 239, 0.98) 100%) !important;
}

html body .page-btn.active {
  background: linear-gradient(180deg, #1a6798 0%, #123f61 100%) !important;
  color: #ffffff !important;
  border-color: rgba(15, 95, 142, 0.55) !important;
}

html body .loading-placeholder td,
html body .skeleton-row td,
html body .loading-skeleton td {
  background: #f1f6fa !important;
}

html body .loading-placeholder td::after,
html body .skeleton-row td::after,
html body .loading-skeleton td::after {
  background: linear-gradient(90deg, rgba(18, 54, 84, 0.05) 0%, rgba(15, 95, 142, 0.18) 50%, rgba(18, 54, 84, 0.05) 100%) !important;
}

/* =========================
   FORMAL FLAT UI
   ========================= */

html body .topbar.sap-nav,
html body .sap-topbar {
  background: #123654 !important;
  box-shadow: none !important;
}

html body .topbar.sap-nav .nav-row,
html body .sap-topbar .nav-row,
html body .topbar.sap-nav .nav .nav-dropdown-menu,
html body .sap-topbar .nav .nav-dropdown-menu {
  background: #163d5e !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html body .topbar.sap-nav .nav a,
html body .topbar.sap-nav .nav .nav-dropdown-toggle,
html body .topbar.sap-nav .nav .nav-logout,
html body .sap-topbar .nav a,
html body .sap-topbar .nav .nav-dropdown-toggle,
html body .sap-topbar .nav .nav-logout,
html body .switch-link,
html body .page-btn,
html body button,
html body .btn,
html body .mini-btn {
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}

html body button,
html body .btn,
html body .mini-btn {
  background: #ffffff !important;
  border-color: rgba(183, 154, 89, 0.78) !important;
  color: #3d3216 !important;
}

html body .topbar.sap-nav .nav a,
html body .topbar.sap-nav .nav .nav-dropdown-toggle,
html body .topbar.sap-nav .nav .nav-logout,
html body .sap-topbar .nav a,
html body .sap-topbar .nav .nav-dropdown-toggle,
html body .sap-topbar .nav .nav-logout {
  background: transparent !important;
  color: #f3f7fb !important;
  border-color: transparent !important;
}

html body button:hover,
html body .btn:hover,
html body .mini-btn:hover,
html body .switch-link:hover,
html body .page-btn:hover {
  background: #fff9ec !important;
  border-color: rgba(183, 154, 89, 0.96) !important;
  color: #2b220b !important;
  background-image: none !important;
  box-shadow: none !important;
}

html body .switch-link,
html body .page-btn,
html body .status-badge,
html body .meta-pill,
html body .visual-board,
html body .status-banner,
html body .toolbar-card,
html body .hero,
html body .card,
html body .table-card,
html body .stat-card,
html body .table-shell,
html body .rule-table-card,
html body .site-board,
html body .table-wrap,
html body .sap-table-wrap,
html body .field input,
html body .field select,
html body .field textarea,
html body .multi-select-trigger,
html body input#reconDate {
  background-image: none !important;
  box-shadow: none !important;
}

html body .switch-link,
html body .status-badge,
html body .meta-pill,
html body .visual-board,
html body .status-banner,
html body .toolbar-card,
html body .hero,
html body .card,
html body .table-card,
html body .stat-card,
html body .table-shell,
html body .rule-table-card,
html body .site-board,
html body .table-wrap,
html body .sap-table-wrap {
  background: #f8fbfd !important;
}

html body .field input,
html body .field select,
html body .field textarea,
html body .multi-select-trigger,
html body input#reconDate {
  background: #ffffff !important;
}

html body .topbar.sap-nav .nav a.active,
html body .topbar.sap-nav .nav .nav-dropdown-toggle.active,
html body .topbar.sap-nav .nav .nav-dropdown.active > .nav-dropdown-toggle,
html body .sap-topbar .nav a.active,
html body .sap-topbar .nav .nav-dropdown-toggle.active,
html body .sap-topbar .nav .nav-dropdown.active > .nav-dropdown-toggle {
  background: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: inset 0 -2px 0 #b79a59 !important;
}

html body .topbar.sap-nav .nav .nav-logout:hover,
html body .sap-topbar .nav .nav-logout:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: inset 0 -2px 0 rgba(183, 154, 89, 0.9) !important;
}

html body .table-wrap thead th,
html body .transactions-table thead th,
html body .rule-table th,
html body .table-wrap table th:first-child,
html body .transactions-table thead th:first-child {
  background-image: none !important;
  box-shadow: none !important;
}

/* =========================
   NPL TABLE HEADINGS
   ========================= */

html body .table-wrap thead th,
html body .transactions-table thead th,
html body .vehicle-table thead th,
html body .vehicle-table th.orange,
html body .vehicle-table th.green,
html body .vehicle-table th.gray,
html body .opening-table th,
html body .entries-table th,
html body .locator-table thead th,
html body .locator-table thead .column-row th,
html body .balance-table th,
html body .rule-table th,
html body .sap-table-wrap thead th,
html body #sapTable thead th,
html body th {
  background: #ffffff !important;
  color: #143258 !important;
  border-top: 1px solid #b79a59 !important;
  border-bottom: 2px solid #b79a59 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
