

:root {
  --orange: #ff6115;
  --orange-strong: #e94f08;
  --orange-soft: #fff0e7;
  --orange-wash: #fff8f3;
  --ink: #102545;
  --ink-soft: #40536e;
  --muted: #73839a;
  --line: #e9e7e1;
  --line-strong: #ddd8ce;
  --canvas: #fffcf4;
  --surface: #ffffff;
  --surface-muted: #fffaf5;
  --success: #159669;
  --success-soft: #e8f8f0;
  --info: #3978df;
  --info-soft: #edf4ff;
  --warning: #c77810;
  --warning-soft: #fff4dd;
  --purple: #8157db;
  --purple-soft: #f2edff;
  --danger: #dc4d59;
  --danger-soft: #fff0f1;
  --shadow-sm: 0 2px 8px rgb(38 32 22 / 3%);
  --shadow-card: 0 10px 30px rgb(65 43 17 / 5%);
  --sidebar-width: 236px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: #245ba8;
  text-decoration: none;
}

a:hover {
  color: #164a96;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: clamp(27px, 2.1vw, 35px);
  font-weight: 750;
  letter-spacing: -1.15px;
  line-height: 1.1;
}

h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.35px;
  line-height: 1.25;
}

h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

p {
  margin-bottom: 12px;
}

.app-frame {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: visible;
  border-right: 1px solid var(--line);
  background: #fffefa;
  padding: 22px 13px 18px;
  transition: width 190ms ease, transform 190ms ease, box-shadow 190ms ease;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin: 0 9px 28px;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 10px;
  background: var(--orange);
  box-shadow: none;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
  transition: opacity 120ms ease;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.5px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-label {
  margin: 20px 12px 8px;
  color: #97a2b2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
  line-height: 1;
  transition: opacity 100ms ease;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
}

.nav-group {
  display: block;
}

.nav-group + .nav-group {
  margin-top: 7px;
}

.nav-group-summary {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #7a8799;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .85px;
  line-height: 1.2;
  list-style: none;
  text-transform: uppercase;
  user-select: none;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary:hover {
  background: var(--orange-wash);
  color: var(--orange-strong);
}

.nav-group-summary:focus-visible {
  outline: 3px solid rgb(255 97 21 / 32%);
  outline-offset: 2px;
}

.nav-group-chevron {
  color: #a2adbb;
  font-size: 15px;
  line-height: 1;
  transition: transform 130ms ease, color 130ms ease;
}

.nav-group:not([open]) .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group-summary:hover .nav-group-chevron {
  color: currentColor;
}

.nav-group-links {
  padding-top: 3px;
}

.nav-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  color: #53627a;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.25;
  padding: 8px 11px;
  transition: background-color 130ms ease, color 130ms ease;
}

.nav-link:hover {
  background: #fff2e9;
  color: var(--orange-strong);
}

.nav-link.active {
  background: var(--orange-soft);
  color: var(--orange-strong);
  font-weight: 750;
}

.nav-icon {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  color: #6e7f97;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  transition: color 130ms ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  color: currentColor;
}

.nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 100ms ease;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 28px 10px 2px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.app-shell {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 190ms ease;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgb(233 231 225 / 84%);
  background: rgb(255 254 250 / 90%);
  backdrop-filter: blur(12px);
  padding: 12px clamp(20px, 3vw, 42px);
}

.topbar-leading,
.account,
.account-identity {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar-leading {
  gap: 13px;
}

.sidebar-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  transition: border-color 130ms ease, color 130ms ease, background-color 130ms ease;
}

.sidebar-toggle:hover {
  border-color: #ffc3a1;
  background: var(--orange-wash);
  color: var(--orange-strong);
}

.topbar-context {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-kicker {
  color: var(--muted);
}

.topbar-page {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-page::before {
  margin-right: 9px;
  color: #b4bbc5;
  content: "/";
  font-weight: 400;
}

.account {
  gap: 12px;
}

.account-identity {
  gap: 9px;
  color: var(--ink);
}

.account-identity:hover {
  color: var(--orange-strong);
}

.account-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #fff0e7;
  color: var(--orange-strong);
  font-size: 11px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  min-width: 0;
  line-height: 1.12;
}

.account-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.app-main {
  min-width: 0;
  padding: 32px clamp(20px, 3vw, 42px) 42px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 3vw, 42px) 24px;
  border-top: 1px solid rgb(233 231 225 / 65%);
  color: #8b96a7;
  font-size: 10px;
}

.sidebar-scrim {
  display: none;
}

html.sidebar-collapsed .sidebar {
  width: 0;
  transform: translateX(-105%);
  border-right: 0;
  box-shadow: none;
  padding-right: 0;
  padding-left: 0;
  pointer-events: none;
}

html.sidebar-collapsed .app-shell {
  margin-left: 0;
}

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

.page-heading > div:first-child {
  min-width: 0;
}

.page-heading p:not(.eyebrow) {
  max-width: 750px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-heading > .btn,
.page-heading > div:last-child {
  flex: 0 0 auto;
}

.eyebrow {
  margin-bottom: 7px !important;
  color: var(--orange-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.65px;
  line-height: 1;
}

.btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  transition: background-color 130ms ease, border-color 130ms ease, box-shadow 130ms ease, color 130ms ease, transform 130ms ease;
}

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

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
}

.btn-primary,
.btn-primary:focus {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  border-color: var(--orange-strong);
  background: var(--orange-strong);
  color: #fff;
}

.btn-outline-secondary {
  border-color: #dedbd3;
  background: #fff;
  color: #516078;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  border-color: #ffc29e;
  background: var(--orange-wash);
  color: var(--orange-strong);
}

.btn-outline-danger {
  border-color: #f2b7bd;
  background: #fff;
  color: #ba3b47;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #ac2432;
}

.panel {
  min-width: 0;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  display: flex;
  min-height: 73px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 22px;
  border-bottom: 1px solid rgb(233 231 225 / 78%);
}

.panel-heading h2 {
  margin: 0;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-heading a {
  flex: 0 0 auto;
  color: var(--orange-strong);
  font-size: 11px;
  font-weight: 750;
}

.checklist-family-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
  overflow: hidden;
}

.checklist-family-summary > div {
  display: grid;
  gap: 3px;
  background: var(--surface-muted);
  padding: 11px 13px;
}

.checklist-family-summary span {
  color: var(--muted);
  font-size: 10px;
}

.checklist-family-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.checklist-family > .d-flex,
.checklist-history {
  margin-right: 22px;
  margin-left: 22px;
}

.checklist-history {
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.checklist-history summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.checklist-history table {
  margin-bottom: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 13px;
  margin: 20px 0 24px;
}

.metric {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 17px 18px 15px;
}

.metric::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  content: "";
}

.metric:nth-child(1)::before {
  background: var(--orange);
}

.metric:nth-child(2)::before {
  background: #f4a121;
}

.metric:nth-child(3)::before {
  background: var(--success);
}

.metric:nth-child(4)::before {
  background: var(--purple);
}

.metric:nth-child(5)::before {
  background: var(--info);
}

.metric:nth-child(6)::before {
  background: #e85a70;
}

.metric span {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 780;
  letter-spacing: -0.8px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric strong small {
  margin-right: 3px;
  color: #8d99a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.metrics.compact {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-top: 16px;
}

.metrics.compact .metric {
  padding: 15px 16px 13px;
}

.metrics.compact .metric strong {
  font-size: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.progress-summary .flow-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px 22px 16px;
}

.flow-list {
  padding: 4px 22px 14px;
}

.flow-list > div {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #f0eee9;
  color: var(--ink-soft);
  font-size: 12px;
}

.flow-list > div:last-child {
  border-bottom: 0;
}

.flow-list strong {
  min-width: 31px;
  border-radius: 999px;
  background: #f5f5f1;
  color: var(--ink);
  padding: 3px 9px;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.upcoming-row {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #f0eee9;
  color: var(--ink);
  padding: 12px 22px;
  transition: background-color 130ms ease;
}

.upcoming-row:hover {
  background: #fffaf5;
  color: var(--ink);
}

.upcoming-row strong:not(.money) {
  font-size: 12px;
  font-weight: 750;
}

.upcoming-row .money {
  color: var(--ink);
  font-size: 12px;
}

.grow {
  min-width: 0;
  flex: 1;
}

.upcoming-row small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-chip {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  align-content: center;
  border: 1px solid #f4d7c7;
  border-radius: 9px;
  background: var(--orange-wash);
  color: var(--orange-strong);
  padding: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.date-chip small {
  margin-top: 3px;
  color: inherit;
  font-size: 8px;
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
}

.panel-note {
  margin: 0;
  padding: 0 22px 18px;
  color: var(--muted);
  font-size: 10px;
}

.authorization-warning {
  border: 1px solid #f1ca89;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: #8e5b10;
  padding: 13px 15px;
}

.authorization-warning strong {
  color: #7c4b08;
}

.report-filters,
.inline-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.report-filters {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 15px 17px;
}

.report-filters > div {
  min-width: 150px;
  flex: 1 1 160px;
}

.report-filters label,
.inline-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.report-filters > .btn,
.report-filters > a.btn {
  margin-bottom: 0;
}

.report-filters > a:not(.btn) {
  padding: 8px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.form-control,
.form-select,
.form-control-plaintext {
  min-height: 39px;
  border-color: #dedbd3;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
  font-size: 12px;
  padding: 8px 11px;
}

.form-control-plaintext {
  border: 1px solid #efede8;
  background: #fbfaf7;
}

.form-control::placeholder {
  color: #a1aaba;
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: #ff9c6d;
  box-shadow: 0 0 0 0.2rem rgb(255 97 21 / 13%);
}

textarea.form-control {
  min-height: 98px;
  resize: vertical;
}

input[readonly],
.form-control[readonly] {
  border-color: #e6e3dc;
  background: #f8f7f3;
  color: #6e7c8f;
}

.searchable-dropdown {
  width: 100%;
}

.searchable-dropdown > .form-control {
  width: 100%;
}

.searchable-dropdown-menu {
  position: fixed;
  z-index: 1100;
  max-height: min(240px, calc(100vh - 16px));
  overflow-y: auto;
  border: 1px solid #d8d4cb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(38 32 22 / 16%);
  padding: 4px;
}

.searchable-dropdown-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 9px;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
}

.searchable-dropdown-option:hover,
.searchable-dropdown-option.is-active {
  background: var(--orange-wash);
  color: var(--orange-strong);
}

.searchable-dropdown-option[aria-selected="true"] {
  color: var(--ink);
  font-weight: 750;
}

.searchable-dropdown-marker {
  width: 15px;
  flex: 0 0 15px;
  color: var(--orange-strong);
  font-weight: 850;
  text-align: center;
}

.searchable-dropdown-empty {
  color: var(--muted);
  padding: 9px;
  font-size: 11px;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--orange);
}

.form-panel {
  width: min(100%, 680px);
  padding: 25px;
}

.form-panel.wide {
  width: min(100%, 1160px);
  max-width: none;
}

.form-panel > h2 {
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.form-grid.thirds,
.form-grid.invoice-header-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 20px;
}

.form-label {
  display: block;
  margin: 17px 0 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.form-actions .btn {
  min-width: 112px;
}

.section-title {
  margin: 26px 0 5px;
}

.hint {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.table {
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 11.5px;
}

.table.data-grid {
  min-width: 100%;
  width: max-content;
}

.table > :not(caption) > * > * {
  border-bottom-color: #eeeae3;
  background: transparent;
  padding: 12px 14px;
  vertical-align: middle;
}

.table thead th {
  border-bottom: 1px solid #e5e1d9;
  background: #fffaf5;
  color: #64738a;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  line-height: 1.25;
  text-transform: none;
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color 120ms ease;
}

.table tbody tr:hover {
  background: #fffaf5;
}

.table td {
  min-width: 100px;
  max-width: 360px;
  color: #243b5b;
  overflow-wrap: anywhere;
}

.table td.fw-semibold,
.table .fw-semibold {
  color: var(--ink);
  font-weight: 750 !important;
}

.table td.money,
.money {
  min-width: 110px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table a {
  font-weight: 650;
}

.table-scroll {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scrollbar-color: #c8c6bf transparent;
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
  height: 9px;
  width: 9px;
}

.table-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #c8c6bf;
  background-clip: padding-box;
}

.grid-toolbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid #f0ede7;
  background: #fff;
}

.grid-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.grid-count {
  color: var(--muted);
  font-size: 10.5px;
}

.grid-limit {
  width: 108px;
  min-height: 31px;
  border-color: #e0ddd5;
  border-radius: 7px;
  color: #53627a;
  font-size: 10.5px;
  padding: 5px 8px;
}

.sort-button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

.sort-button:hover {
  color: var(--orange-strong);
}

.filter-button {
  width: 22px;
  height: 22px;
  margin-left: 5px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #8d99a9;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}

.filter-button:hover,
.filter-button.filtered {
  background: var(--orange-soft);
  color: var(--orange-strong);
}

.filter-dialog {
  width: min(380px, calc(100vw - 28px));
  max-height: min(640px, 86vh);
  border: 1px solid #e2ddd4;
  border-radius: 13px;
  box-shadow: 0 20px 70px rgb(44 34 20 / 17%);
  color: var(--ink);
  padding: 20px;
}

.filter-dialog::backdrop {
  background: rgb(27 38 57 / 22%);
  backdrop-filter: blur(2px);
}

.filter-dialog h3 {
  margin: 0 0 13px;
}

.filter-values {
  max-height: 310px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid #eeeae3;
  border-radius: 8px;
  padding: 5px;
}

.filter-values label {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 6px 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.filter-values label:hover {
  background: var(--orange-wash);
}

.filter-values details {
  padding-left: 11px;
}

.filter-values summary {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  cursor: pointer;
  padding: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  padding: 48px 22px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 7px;
}

.empty-state p {
  max-width: 430px;
  margin: 0 auto 13px;
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: #f0f2f4;
  color: #687689;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  padding: 4px 8px;
  text-align: left;
  white-space: normal;
}

.status-active,
.status-paid,
.status-completed,
.status-submitted,
.status-recorded {
  background: var(--success-soft);
  color: #14784f;
}

.status-upcoming,
.status-readytobill,
.status-issued,
.status-notstarted,
.status-documentrequested {
  background: var(--info-soft);
  color: #2866be;
}

.status-billed,
.status-fullyinvoiced,
.status-partiallyinvoiced,
.status-documentreceived,
.status-assignednotstarted,
.status-assignmentstarted,
.status-startpreparing {
  background: #eef4fb;
  color: #436c9b;
}

.status-workinprogress,
.status-inprogress,
.status-partiallypaid,
.status-pendingreview,
.status-needsauthorizationreview,
.status-queriesent,
.status-draftmanagementreportsent,
.status-amendmentrevision {
  background: var(--warning-soft);
  color: #9f6411;
}

.status-finalmanagementreportsent {
  background: var(--purple-soft);
  color: #6742b8;
}

.status-missing,
.status-late,
.status-cancelled,
.status-blocked,
.status-disabled {
  background: var(--danger-soft);
  color: #b53b49;
}

.status-hidden,
.status-muted,
.status-notrequired,
.status-notinvoiced,
.status-inactive {
  background: #f1f3f5;
  color: #768294;
}

.progress-service-period {
  min-width: 192px !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.invoice-create-form {
  width: 100%;
  max-width: none;
  padding: 26px 28px 28px;
}

.invoice-create-form > h2 {
  margin-top: 28px;
}

.invoice-create-form .table-scroll {
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: visible;
}

.invoice-allocation-table {
  width: 100%;
  min-width: 1420px;
  table-layout: fixed;
}

.invoice-allocation-table > :not(caption) > * > * {
  padding: 11px 10px;
}

.invoice-allocation-table col.invoice-col-billing {
  width: 7%;
}

.invoice-allocation-table col.invoice-col-customer {
  width: 14%;
}

.invoice-allocation-table col.invoice-col-service {
  width: 11%;
}

.invoice-allocation-table col.invoice-col-firm {
  width: 12%;
}

.invoice-allocation-table col.invoice-col-manager {
  width: 11%;
}

.invoice-allocation-table col.invoice-col-period {
  width: 15%;
}

.invoice-allocation-table col.invoice-col-upstream {
  width: 190px;
}

.invoice-allocation-table col.invoice-col-payment {
  width: 150px;
}

.invoice-allocation-table col.invoice-col-money {
  width: 7%;
}

.invoice-allocation-table col.invoice-col-money-wide {
  width: 8%;
}

.invoice-allocation-table col.invoice-col-allocate {
  width: 140px;
}

.invoice-allocation-table td {
  min-width: 0;
  max-width: none;
  overflow-wrap: break-word;
}

.invoice-allocation-table th:nth-child(n + 9),
.invoice-allocation-table td:nth-child(n + 9) {
  text-align: right;
}

.invoice-allocation-table td:nth-child(1),
.invoice-allocation-table td:nth-child(6),
.invoice-allocation-table td:nth-child(n + 9) {
  white-space: nowrap;
}

.invoice-allocation-table td:nth-child(2),
.invoice-allocation-table td:nth-child(3),
.invoice-allocation-table td:nth-child(4),
.invoice-allocation-table td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-period {
  white-space: nowrap;
}

.invoice-upstream-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.invoice-upstream-item:last-child {
  margin-bottom: 0;
}

.invoice-upstream-item > span {
  font-size: 0.82rem;
  color: var(--muted);
}

.invoice-payment-detail .invoice-upstream-item > span:first-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.invoice-allocation-table input[type="number"] {
  width: 100%;
  min-width: 110px;
  text-align: right;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 34px;
  padding: 19px 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.summary-strip span {
  color: var(--muted);
  font-size: 10px;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.cancellation {
  padding: 20px;
}

.cancellation summary,
.manual-period summary,
details summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.cancellation > p,
.manual-period small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

.manual-period {
  margin-top: 12px;
  border-top: 1px solid #eeeae3;
  padding-top: 11px;
}

.manual-period .inline-form {
  margin-top: 12px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--orange-strong);
  font-size: 11px;
  font-weight: 750;
}

.inline-form .form-control,
.inline-form .form-select {
  width: auto;
  max-width: 300px;
}

.inline-form input[type="date"] {
  min-width: 145px;
}

.inline-form details {
  width: 100%;
}

.inline-form details form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.align-end {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.progress-filters {
  align-items: flex-end;
  gap: 14px 16px;
  margin: 0;
}

.progress-filters > label {
  display: flex;
  min-width: 190px;
  flex: 0 1 245px;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.progress-filters > label:nth-child(2) {
  min-width: 190px;
}

.progress-filters .form-control,
.progress-filters .form-select {
  width: 100%;
  max-width: none;
}

.progress-filters .form-select {
  min-width: 180px;
}

.progress-filters > .btn {
  align-self: flex-end;
}

.workflow-batch-bar {
  align-items: flex-end;
  gap: 16px 20px;
  border-bottom: 1px solid #f0ede7;
  background: #fffaf5;
  padding: 16px 19px 15px;
}

.workflow-batch-bar > label,
.workflow-batch-bar [data-batch-workflow-fields] > label,
.workflow-batch-bar [data-workflow-version-container] {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.workflow-batch-bar > label {
  min-width: 235px;
  flex: 1 1 250px;
}

.workflow-batch-bar [data-batch-workflow-fields] {
  display: flex;
  min-width: 0;
  flex: 2 1 440px;
  align-items: flex-end;
  gap: 16px;
}

.workflow-batch-bar [data-batch-workflow-fields] > label:first-child {
  min-width: 280px;
  flex: 1 1 330px;
}

.workflow-batch-bar [data-workflow-version-container] {
  min-width: 94px;
  flex: 0 1 105px;
}

.workflow-batch-bar .form-select,
.workflow-batch-bar .form-control {
  width: 100%;
  max-width: none;
}

.workflow-batch-bar > .btn {
  align-self: flex-end;
  flex: 0 0 auto;
}

.workflow-batch-bar + .hint {
  margin: 0;
  border-bottom: 1px solid #f0ede7;
  background: #fffaf5;
  padding: 0 19px 14px;
}

.progress-update-timeline {
  display: grid;
  gap: 11px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.progress-update-timeline li {
  border-left: 3px solid #ffc29e;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fffaf5;
  padding: 11px 14px;
}

.progress-update-timeline p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.progress-update-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.progress-update-meta span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--canvas);
  padding: 24px;
}

.login-card {
  width: min(100%, 440px);
  border: 1px solid #ece7df;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 22px 58px rgb(54 36 13 / 10%);
  padding: 36px;
}

.login-card .brand-mark {
  margin-bottom: 25px;
  background-color: var(--orange);
  background-image: none;
  color: #fff;
}

.login-card .btn-primary,
.login-card .btn-primary:focus {
  background-color: var(--orange);
  background-image: none;
  color: #fff;
}

.login-card h1 {
  font-size: 28px;
}

.login-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

.alert {
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.alert-success {
  border-color: #bfe9d1;
  background: var(--success-soft);
  color: #176e4c;
}

.alert-danger {
  border-color: #f4c1c6;
  background: var(--danger-soft);
  color: #ad3541;
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors {
  margin-top: 14px;
  border: 1px solid #f4c1c6;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #ad3541;
  font-size: 11px;
  padding: 9px 12px;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 18px;
}

.field-validation-error {
  display: block;
  margin-top: 5px;
  color: #b53b49;
  font-size: 10.5px;
  font-weight: 600;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(255 97 21 / 32%);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 216px;
  }

  .app-main {
    padding-top: 28px;
  }

  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  }

  .metrics.compact {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.85fr);
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  .sidebar {
    overflow-y: auto;
    scrollbar-color: #d9d3c8 transparent;
    scrollbar-width: thin;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(84vw, 300px);
    transform: translateX(-105%);
    overflow-y: auto;
    scrollbar-color: #d9d3c8 transparent;
    scrollbar-width: thin;
    box-shadow: 20px 0 50px rgb(32 24 14 / 14%);
    padding: 22px 13px 18px;
  }

  .app-shell,
  html.sidebar-collapsed .app-shell {
    margin-left: 0;
  }

  html.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(16 37 69 / 28%);
    cursor: default;
    opacity: 0;
    pointer-events: none;
    transition: opacity 190ms ease;
  }

  html.sidebar-mobile-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .metrics.compact {
    grid-template-columns: repeat(4, minmax(135px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
  }

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

  .topbar {
    min-height: 62px;
  }

  .page-heading {
    gap: 16px;
  }

  .workflow-batch-bar [data-batch-workflow-fields] {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 10px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar-context {
    gap: 5px;
  }

  .topbar-kicker {
    display: none;
  }

  .topbar-page::before {
    display: none;
  }

  .account-copy {
    display: none;
  }

  .account .btn {
    min-height: 32px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 10px;
  }

  .app-main {
    padding: 23px 14px 32px;
  }

  .app-footer {
    display: grid;
    gap: 4px;
    padding: 16px 14px 20px;
  }

  h1 {
    font-size: 26px;
  }

  .page-heading {
    flex-direction: column;
  }

  .page-heading > .btn,
  .page-heading > div:last-child {
    align-self: flex-start;
  }

  .page-heading > div:last-child {
    display: flex;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 16px 0 20px;
  }

  .metric {
    padding: 14px 13px 12px;
  }

  .metric strong {
    font-size: 19px;
  }

  .metrics.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .panel-heading {
    min-height: auto;
    align-items: flex-start;
    padding: 17px;
  }

  .panel-heading a {
    white-space: nowrap;
  }

  .progress-summary .flow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    padding: 4px 17px 14px;
  }

  .flow-list,
  .panel-note {
    padding-right: 17px;
    padding-left: 17px;
  }

  .upcoming-row {
    padding-right: 17px;
    padding-left: 17px;
  }

  .report-filters {
    padding: 14px;
  }

  .report-filters > div {
    min-width: 100%;
  }

  .form-panel,
  .invoice-create-form {
    padding: 18px;
  }

  .form-grid,
  .form-grid.thirds,
  .form-grid.invoice-header-grid {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    flex: 1 1 140px;
  }

  .grid-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .grid-tools {
    margin-left: auto;
  }

  .table > :not(caption) > * > * {
    padding: 10px 11px;
  }

  .table td {
    min-width: 96px;
  }

  .invoice-create-form .table-scroll {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .invoice-allocation-table {
    min-width: 1060px;
  }

  .inline-form {
    align-items: stretch;
  }

  .inline-form .form-control,
  .inline-form .form-select {
    width: 100%;
    max-width: none;
  }

  .inline-form > label,
  .inline-form > div {
    min-width: 100%;
  }

  .progress-filters {
    gap: 12px;
  }

  .progress-filters > label,
  .progress-filters > label:nth-child(2) {
    min-width: 100%;
    flex-basis: 100%;
  }

  .progress-filters > .btn {
    align-self: flex-start;
  }

  .workflow-batch-bar {
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .workflow-batch-bar > label,
  .workflow-batch-bar [data-batch-workflow-fields] {
    min-width: 100%;
    flex-basis: 100%;
  }

  .workflow-batch-bar [data-batch-workflow-fields] {
    gap: 12px;
  }

  .workflow-batch-bar [data-batch-workflow-fields] > label:first-child,
  .workflow-batch-bar [data-workflow-version-container] {
    min-width: 0;
    flex: 1 1 180px;
  }

  .workflow-batch-bar > .btn {
    align-self: flex-start;
  }

  .workflow-batch-bar + .hint {
    padding: 0 14px 13px;
  }

  .summary-strip {
    gap: 15px 24px;
    padding: 17px;
  }

  .progress-update-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .progress-update-meta span {
    white-space: normal;
  }

  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 27px 23px;
  }
}

@media (max-width: 420px) {
  .account form {
    display: none;
  }

  .sidebar-toggle {
    width: 34px;
    height: 34px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .progress-summary .flow-list {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    flex-direction: column;
  }
}

/* UI/UX Wave 1 — global hierarchy, data density and action consistency */
:root {
  --content-max: 1680px;
  --shadow-elevated: 0 12px 34px rgb(28 39 55 / 7%);
}

.app-main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-top: 28px;
}

.topbar {
  min-height: 64px;
  background: rgb(255 255 255 / 92%);
}

.sidebar {
  background: #fff;
  box-shadow: 8px 0 28px rgb(27 38 55 / 2%);
}

.brand {
  margin-bottom: 24px;
}

.nav-group-summary {
  min-height: 32px;
  color: #728096;
}

.nav-link {
  min-height: 40px;
  border: 1px solid transparent;
  padding-right: 10px;
  padding-left: 10px;
}

.nav-link.active {
  border-color: #ffd5bf;
  box-shadow: inset 3px 0 0 var(--orange);
}

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

.page-heading h1 {
  margin-bottom: 8px;
}

.page-heading .eyebrow {
  margin-bottom: 8px !important;
}

.page-heading > .btn,
.page-heading > div:last-child .btn {
  box-shadow: 0 7px 18px rgb(255 97 21 / 14%);
}

.panel {
  border-color: #e5e8ec;
  box-shadow: 0 5px 18px rgb(28 39 55 / 4%);
}

.panel:hover {
  border-color: #dde1e6;
}

.data-panel {
  overflow: hidden;
}

.panel-heading {
  min-height: 68px;
  padding: 17px 20px;
  background: linear-gradient(180deg, #fff 0%, #fffdfb 100%);
}

.report-filters {
  gap: 10px 12px;
  border-color: #e5e8ec;
  background: #fff;
  box-shadow: 0 4px 16px rgb(28 39 55 / 3%);
  padding: 13px 15px;
}

.report-filters > div {
  min-width: 140px;
}

.report-filters .filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.btn-quiet {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none !important;
}

.btn-quiet:hover,
.btn-quiet:focus-visible {
  border-color: var(--line);
  background: #f7f8fa;
  color: var(--ink-soft);
}

.table-scroll,
.table-responsive {
  border-radius: 0 0 var(--radius) var(--radius);
}

.table.data-grid {
  min-width: 960px;
}

.table.data-grid thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom-color: #dfe3e8;
  background: #f8f9fb;
  color: #53627a;
  padding-top: 10px;
  padding-bottom: 10px;
}

.table.data-grid tbody tr:hover {
  background: #fff9f5;
}

.table.data-grid tbody td {
  height: 48px;
}

.record-link {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: #f2f5f9;
  color: #35577f;
  padding: 4px 7px;
  font-size: 10.5px;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
}

.record-link:hover {
  background: var(--orange-soft);
  color: var(--orange-strong);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.table-action {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
  color: #53627a !important;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 750 !important;
  line-height: 1;
}

.table-action:hover,
.table-action:focus-visible {
  border-color: #ffc7a8;
  background: var(--orange-wash);
  color: var(--orange-strong) !important;
}

.metrics {
  gap: 12px;
}

.metric {
  min-height: 118px;
  border-color: #e5e8ec;
  box-shadow: 0 5px 18px rgb(28 39 55 / 4%);
  padding: 18px 18px 16px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

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

.metric strong {
  margin-top: 9px;
  font-size: clamp(20px, 1.55vw, 25px);
}

.dashboard-grid {
  align-items: start;
}

.empty-state {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
}

.checklist-family {
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.checklist-family:hover {
  border-color: #dce1e7;
  box-shadow: var(--shadow-elevated);
}

.form-control,
.form-select {
  border-color: #d9dee5;
  background-color: #fff;
}

.form-control:hover,
.form-select:hover {
  border-color: #cdd4dc;
}

@media (max-width: 900px) {
  .app-main {
    padding-top: 22px;
  }

  .page-heading {
    gap: 14px;
  }

  .report-filters > div {
    flex-basis: calc(50% - 8px);
  }
}

@media (max-width: 680px) {
  .page-heading {
    display: grid;
  }

  .page-heading > .btn,
  .page-heading > div:last-child {
    justify-self: stretch;
  }

  .page-heading > .btn {
    width: 100%;
  }

  .report-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-filters > div,
  .report-filters .filter-actions {
    width: 100%;
    min-width: 0;
  }

  .report-filters .filter-actions .btn {
    flex: 1;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 104px;
  }
}

@media (max-width: 420px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .table.data-grid {
    min-width: 820px;
  }
}


/* Fixed register pages own the viewport; only their inner content areas scroll. */
.app-body.fixed-table-page {
  height: 100dvh;
  overflow: hidden;
}

.app-body.fixed-table-page .app-frame,
.app-body.fixed-table-page .app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-body.fixed-table-page .sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* UI/UX Wave 2 — fixed register pages with inner scrolling */
.app-main.table-page {
  display: flex;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 20px;
}

.app-main.table-page + .app-footer {
  display: none;
}

.table-page > .page-heading,
.table-page > .report-filters {
  flex: 0 0 auto;
}

.table-page > .data-panel {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
}

.table-page > .data-panel > .grid-toolbar {
  flex: 0 0 auto;
}

.table-page > .data-panel > .table-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.table-page .table-scroll .table.data-grid thead th {
  top: 0;
}

.page-content-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8c6bf transparent;
  scrollbar-width: thin;
}

.page-content-scroll::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.page-content-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #c8c6bf;
  background-clip: padding-box;
}

.checklist-page-scroll {
  padding-right: 4px;
}

.checklist-page-scroll > .panel:last-child {
  margin-bottom: 0;
}

.schedule-grid {
  width: 100% !important;
  min-width: 1180px !important;
  table-layout: fixed;
}

.schedule-grid th:nth-child(1),
.schedule-grid td:nth-child(1) {
  width: 14%;
}

.schedule-grid th:nth-child(2),
.schedule-grid td:nth-child(2) {
  width: 14%;
}

.schedule-grid th:nth-child(3),
.schedule-grid td:nth-child(3) {
  width: 8%;
}

.schedule-grid th:nth-child(4),
.schedule-grid td:nth-child(4) {
  width: 10%;
}

.schedule-grid th:nth-child(5),
.schedule-grid td:nth-child(5) {
  width: 9%;
}

.schedule-grid th:nth-child(6),
.schedule-grid td:nth-child(6) {
  width: 45%;
}

.schedule-grid > tbody > tr > td {
  height: auto;
  padding-top: 9px;
  padding-bottom: 9px;
}

.schedule-grid > tbody > tr > td:not(.schedule-actions) {
  vertical-align: middle;
}

.schedule-actions {
  min-width: 520px !important;
  max-width: none !important;
  vertical-align: top !important;
}

.schedule-primary-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.schedule-edit-button {
  flex: 0 0 auto;
  margin-bottom: 1px;
}

.schedule-generate-form {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 7px;
}

.schedule-generate-form > label {
  min-width: 0;
  flex: 1 1 130px;
  margin: 0;
  font-size: 9px;
}

.schedule-generate-form > label .form-control {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 32px;
  margin-top: 4px;
  padding: 5px 8px;
  font-size: 10.5px;
}

.schedule-generate-form > button {
  min-height: 32px;
  flex: 0 0 auto;
}

.schedule-actions .manual-period {
  margin-top: 7px;
  padding-top: 7px;
}

.schedule-actions .manual-period summary {
  font-size: 10px;
}

.schedule-actions .manual-period .schedule-generate-form {
  margin-top: 8px;
  flex-wrap: wrap;
}

.schedule-actions .manual-period .schedule-generate-form > label {
  flex: 1 1 135px;
  max-width: 190px;
}

.schedule-actions .manual-period small {
  margin-top: 7px;
  font-size: 9.5px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .app-main.table-page {
    height: calc(100dvh - 62px);
    max-height: calc(100dvh - 62px);
    padding-bottom: 14px;
  }
}

@media (max-width: 680px) {
  .app-main.table-page {
    padding-bottom: 12px;
  }

  .schedule-grid {
    min-width: 1080px !important;
  }
}



/* UI/UX Wave 2B — extend fixed register behavior across remaining list pages */
.table-page > .data-panel > form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.table-page > .data-panel > form > .grid-toolbar {
  flex: 0 0 auto;
}

.table-page > .data-panel > form > .table-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.progress-table-page > .form-panel,
.progress-table-page > .metrics {
  flex: 0 0 auto;
}

.progress-table-page > .form-panel {
  margin-bottom: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.progress-table-page > .metrics {
  margin-top: 0;
  margin-bottom: 12px;
}

.progress-data-panel .workflow-batch-bar,
.progress-data-panel form > .hint {
  flex: 0 0 auto;
}

.progress-data-panel .workflow-batch-bar {
  padding: 10px 14px 6px;
}

.progress-data-panel form > .hint {
  margin: 0;
  padding: 0 14px 8px;
}

@media (max-height: 760px) and (min-width: 901px) {
  .progress-table-page > .page-heading {
    margin-bottom: 12px;
  }

  .progress-table-page > .form-panel {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .progress-table-page > .metrics {
    gap: 8px;
    margin-bottom: 8px;
  }

  .progress-table-page .metric {
    min-height: 86px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
}



/* UI/UX Wave 2C — fixed dashboard shell and robust sidebar/content sizing */
@media (min-width: 901px) {
  .app-shell {
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
  }

  html.sidebar-collapsed .app-shell {
    width: 100%;
    max-width: 100%;
  }
}

.app-main.dashboard-page {
  display: flex;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 20px;
}

.app-main.dashboard-page + .app-footer {
  display: none;
}

.dashboard-page > .page-heading {
  flex: 0 0 auto;
}

.dashboard-scroll {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: #c8c6bf transparent;
  scrollbar-width: thin;
}

.dashboard-scroll::-webkit-scrollbar {
  width: 9px;
}

.dashboard-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #c8c6bf;
  background-clip: padding-box;
}

.dashboard-scroll > .report-filters {
  margin-top: 0;
}

.dashboard-scroll > .dashboard-grid:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .app-shell,
  html.sidebar-collapsed .app-shell {
    width: 100%;
    max-width: 100%;
  }

  .app-main.dashboard-page {
    height: calc(100dvh - 62px);
    max-height: calc(100dvh - 62px);
    padding-bottom: 14px;
  }
}


@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}



/* 2026-09 permanent single-panel sidebar. */
:root {
  --sidebar-width: 224px;
  --nav-neutral: #f4f4f5;
  --nav-neutral-hover: #f7f7f8;
  --nav-accent-soft: #fff1e8;
  --shell-canvas: #f4f6f8;
}

html,
body {
  min-width: 0;
  max-width: 100%;
  background: var(--shell-canvas);
}

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

.app-frame,
.app-shell,
.app-main {
  min-width: 0;
}

.sidebar {
  display: flex;
  width: var(--sidebar-width);
  max-width: 100vw;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #e8e9ec;
  background: #fff;
  padding: 0;
  box-shadow: none;
}

.sidebar-panel {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  padding: 16px 12px 18px;
  scrollbar-color: #d8dadd transparent;
  scrollbar-width: thin;
}

.sidebar-panel-header {
  display: flex;
  min-height: 46px;
  align-items: center;
  margin: 0 2px 16px;
  padding: 0 4px 9px;
  border-bottom: 1px solid #f0f1f2;
}

.sidebar-panel-title {
  display: grid;
  min-width: 0;
  line-height: 1.12;
}

.sidebar-panel-title strong {
  color: #24272c;
  font-size: 14px;
  font-weight: 760;
}

.sidebar-panel-title small {
  margin-top: 4px;
  color: #9a9fa8;
  font-size: 9px;
}

.nav-group + .nav-group {
  margin-top: 4px;
}

.nav-group-summary {
  min-height: 40px;
  gap: 10px;
  margin: 0;
  padding: 8px 9px;
  border-radius: 9px;
  color: #676d76;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: background-color 130ms ease, color 130ms ease;
}

.nav-group-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nav-group-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  color: #747a82;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.nav-group-summary:hover {
  background: var(--nav-neutral-hover);
  color: #24272c;
}

.nav-group[open] > .nav-group-summary {
  background: var(--nav-accent-soft);
  color: var(--orange-strong);
  font-weight: 720;
}

.nav-group[open] > .nav-group-summary .nav-group-icon,
.nav-group[open] > .nav-group-summary .nav-group-chevron {
  color: currentColor;
}

.nav-group-chevron {
  color: #9a9fa7;
  font-size: 14px;
}

.nav-group-links {
  position: relative;
  gap: 2px;
  padding: 5px 0 5px 33px;
}

.nav-group-links::before {
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: 19px;
  width: 1px;
  background: #e5e7e9;
  content: "";
}

.nav-group-links .nav-link {
  position: relative;
  min-height: 35px;
  gap: 0;
  border-radius: 9px;
  padding: 7px 9px;
  color: #777d86;
  font-size: 12px;
  font-weight: 520;
}

.nav-group-links .nav-icon {
  display: none;
}

.nav-group-links .nav-link:hover {
  background: #f6f7f8;
  color: #2c3036;
}

.nav-group-links .nav-link.active {
  background: #f0f1f2;
  color: #202328;
  font-weight: 700;
}

.nav-group-links .nav-link.active::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -14px;
  width: 2px;
  border-radius: 99px;
  background: var(--orange);
  content: "";
}

.sidebar-foot {
  margin-top: auto;
  padding: 24px 8px 2px;
  color: #9a9fa8;
}

.topbar {
  min-height: 64px;
  border-bottom: 1px solid #e8eaed;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(24 30 38 / 2%);
}

.app-main {
  background: var(--shell-canvas);
}

html.sidebar-collapsed .sidebar {
  width: var(--sidebar-width);
  max-width: 100vw;
  transform: none;
  padding: 0;
  pointer-events: auto;
}

html.sidebar-collapsed .app-shell {
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}

@media (min-width: 901px) {
  .topbar .sidebar-toggle {
    display: none;
  }

  .app-shell,
  html.sidebar-collapsed .app-shell {
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(86vw, 224px);
    max-width: calc(100vw - 12px);
    transform: translateX(-105%);
    overflow: hidden;
    box-shadow: 20px 0 50px rgb(32 24 14 / 14%);
  }

  .sidebar-panel {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 12px 18px;
  }

  .topbar .sidebar-toggle {
    display: grid;
  }

  html.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .app-shell,
  html.sidebar-collapsed .app-shell {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .nav-group-links {
    padding-left: 33px;
  }
}


/* 2026-09 minimalist application redesign */
:root {
  --orange: #2563eb;
  --orange-strong: #1d4ed8;
  --orange-soft: #eff6ff;
  --orange-wash: #f8fafc;
  --ink: #18181b;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --canvas: #f7f7f8;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --warning: #a16207;
  --warning-soft: #fffbeb;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: none;
  --shadow-card: none;
  --shadow-elevated: none;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --content-max: none;
  --sidebar-width: 216px;
}

html,
body {
  min-width: 0;
  background: var(--canvas);
  color: var(--ink);
}

body {
  font-size: 13px;
  line-height: 1.45;
}

a {
  color: #2563eb;
}

a:hover {
  color: #1d4ed8;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(22px, 1.65vw, 28px);
  font-weight: 700;
  letter-spacing: -0.55px;
}

h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 13px;
  font-weight: 700;
}

.eyebrow {
  display: none;
}

.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
  background: #fafafa;
  box-shadow: none;
}

.sidebar-panel {
  background: #fafafa;
  padding: 14px 10px 16px;
}

.sidebar-panel-header {
  min-height: 42px;
  margin: 0 4px 10px;
  padding: 0 6px 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar-panel-title strong {
  font-size: 13px;
  font-weight: 700;
}

.sidebar-panel-title small {
  color: #a1a1aa;
  font-size: 9px;
}

.nav-group + .nav-group {
  margin-top: 2px;
}

.nav-group-summary {
  min-height: 36px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #52525b;
  font-size: 12px;
  font-weight: 600;
}

.nav-group-summary:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.nav-group[open] > .nav-group-summary {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 650;
}

.nav-group-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  color: #71717a;
  font-size: 14px;
}

.nav-group-links {
  padding: 3px 0 5px 29px;
}

.nav-group-links::before {
  left: 16px;
  background: #e4e4e7;
}

.nav-group-links .nav-link {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 6px 8px;
  color: #71717a;
  font-size: 11.5px;
  font-weight: 500;
}

.nav-group-links .nav-link:hover {
  background: #f4f4f5;
  color: #27272a;
}

.nav-group-links .nav-link.active {
  background: #fff;
  color: #18181b;
  font-weight: 650;
  box-shadow: inset 2px 0 0 #2563eb;
}

.nav-group-links .nav-link.active::before {
  display: none;
}

.sidebar-foot {
  padding: 18px 8px 2px;
  color: #a1a1aa;
  font-size: 9px;
}

.live-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  box-shadow: none;
}

.app-shell {
  margin-left: var(--sidebar-width);
}

.topbar {
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(8px);
  padding: 9px 26px;
}

.topbar-context {
  color: #a1a1aa;
  font-size: 10.5px;
}

.topbar-kicker {
  color: #a1a1aa;
}

.topbar-page {
  color: #52525b;
  font-weight: 600;
}

.account-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 7px;
  background: #f4f4f5;
  color: #3f3f46;
}

.account-copy strong {
  font-size: 10.5px;
  font-weight: 650;
}

.account-copy small {
  color: #a1a1aa;
}

.app-main {
  width: 100%;
  max-width: none;
  padding: 24px 28px 34px;
}

.app-footer {
  border-top: 1px solid var(--line);
  padding: 14px 28px 18px;
  color: #a1a1aa;
}

.page-heading {
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.page-heading p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-heading > .btn,
.page-heading > div:last-child .btn {
  box-shadow: none;
}

.btn {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 600;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
  transform: none;
}

.btn-sm {
  min-height: 29px;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 10.5px;
}

.btn-primary,
.btn-primary:focus {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: none;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.btn-outline-secondary {
  border-color: #d4d4d8;
  background: #fff;
  color: #52525b;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  border-color: #a1a1aa;
  background: #f4f4f5;
  color: #18181b;
}

.panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.panel:hover {
  border-color: var(--line);
}

.panel-heading {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.panel-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.report-filters {
  gap: 9px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  padding: 10px 12px;
}

.report-filters > div {
  min-width: 130px;
}

.report-filters label,
.inline-form label,
.form-label {
  color: #52525b;
  font-size: 10px;
  font-weight: 600;
}

.form-control,
.form-select,
.form-control-plaintext {
  min-height: 34px;
  border-color: #d4d4d8;
  border-radius: 6px;
  background: #fff;
  color: #18181b;
  font-size: 11.5px;
  padding: 6px 9px;
}

.form-control:hover,
.form-select:hover {
  border-color: #a1a1aa;
}

.form-control:focus,
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

.form-control::placeholder {
  color: #a1a1aa;
}

.form-control[readonly],
input[readonly] {
  border-color: #e4e4e7;
  background: #fafafa;
  color: #71717a;
}

textarea.form-control {
  min-height: 86px;
}

.form-panel,
.invoice-create-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  padding: 20px;
}

.form-panel {
  width: min(100%, 760px);
}

.form-panel.wide {
  width: 100%;
  max-width: 1180px;
}

.form-grid {
  gap: 0 16px;
}

.form-label {
  margin: 14px 0 5px;
}

.form-actions {
  gap: 8px;
  margin-top: 20px;
}

.form-actions .btn {
  min-width: 96px;
}

.section-title {
  margin: 22px 0 4px;
}

.hint {
  color: #71717a;
  font-size: 10px;
}

.data-panel {
  overflow: hidden;
}

.grid-toolbar {
  min-height: 50px;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.grid-search {
  display: block;
  width: min(320px, 42vw);
  margin: 0;
}

.grid-search-input {
  width: 100%;
  min-height: 32px;
  padding-left: 10px;
}

.grid-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.grid-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #71717a;
  font-size: 10px;
  font-weight: 500;
}

.grid-limit {
  width: 68px;
  min-height: 29px;
  border-color: #d4d4d8;
  border-radius: 5px;
  color: #3f3f46;
  font-size: 10.5px;
  padding: 4px 7px;
}

.grid-reset[hidden] {
  display: none !important;
}

.table-scroll,
.table-responsive {
  border-radius: 0;
}

.table {
  color: #27272a;
  font-size: 11.5px;
}

.table.data-grid:not(.invoice-allocation-table):not(.schedule-grid) {
  min-width: 760px;
}

.table > :not(caption) > * > * {
  border-bottom-color: #ececee;
  padding: 10px 12px;
}

.table thead th,
.table.data-grid thead th {
  border-bottom: 1px solid #d4d4d8;
  background: #fafafa;
  color: #52525b;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  padding-top: 9px;
  padding-bottom: 9px;
  text-transform: none;
}

.table.data-grid tbody td {
  height: 42px;
}

.table tbody tr:hover,
.table.data-grid tbody tr:hover {
  background: #fafafa;
}

.table td {
  color: #3f3f46;
}

.table td.fw-semibold,
.table .fw-semibold {
  color: #18181b;
  font-weight: 650 !important;
}

.table a {
  font-weight: 600;
}

.sort-button:hover {
  color: #1d4ed8;
}

.filter-button {
  width: 20px;
  height: 20px;
  margin-left: 3px;
  color: #a1a1aa;
}

.filter-button:hover,
.filter-button.filtered {
  background: #eff6ff;
  color: #2563eb;
}

.record-link {
  border-radius: 5px;
  background: #f4f4f5;
  color: #3f3f46;
  padding: 3px 6px;
  font-size: 10.5px;
  font-weight: 650 !important;
}

.record-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.table-action {
  min-height: 27px;
  border-color: #e4e4e7;
  border-radius: 5px;
  color: #52525b !important;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 600 !important;
}

.table-action:hover,
.table-action:focus-visible {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8 !important;
}

.grid-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
}

.grid-count {
  color: #71717a;
  font-size: 10.5px;
}

.grid-pagination {
  display: flex;
  align-items: center;
  gap: 3px;
}

.grid-page {
  display: grid;
  min-width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #52525b;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 550;
}

.grid-page:hover:not(:disabled) {
  border-color: #d4d4d8;
  background: #fafafa;
  color: #18181b;
}

.grid-page.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 650;
}

.grid-page:disabled {
  cursor: default;
  color: #d4d4d8;
}

.grid-page-gap {
  color: #a1a1aa;
  padding: 0 2px;
}

.filter-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgb(24 24 27 / 14%);
  padding: 16px;
}

.filter-dialog::backdrop {
  background: rgb(24 24 27 / 18%);
  backdrop-filter: blur(1px);
}

.filter-values {
  border-color: var(--line);
  border-radius: 6px;
}

.filter-values label:hover,
.searchable-dropdown-option:hover,
.searchable-dropdown-option.is-active {
  background: #f4f4f5;
  color: #18181b;
}

.column-picker {
  max-height: 360px;
  overflow: auto;
  margin-bottom: 12px;
}

.column-picker .check-line {
  margin: 0;
  border-bottom: 1px solid #f4f4f5;
  padding: 7px 4px;
}

.badge {
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 9.5px;
  font-weight: 600;
  padding: 3px 7px;
}

.status-active,
.status-paid,
.status-completed,
.status-submitted,
.status-recorded {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.status-upcoming,
.status-readytobill,
.status-issued,
.status-notstarted,
.status-documentrequested,
.status-billed,
.status-fullyinvoiced,
.status-partiallyinvoiced,
.status-documentreceived,
.status-assignednotstarted,
.status-assignmentstarted,
.status-startpreparing {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.status-workinprogress,
.status-inprogress,
.status-partiallypaid,
.status-pendingreview,
.status-needsauthorizationreview,
.status-queriesent,
.status-draftmanagementreportsent,
.status-amendmentrevision {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.status-finalmanagementreportsent {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.status-missing,
.status-late,
.status-cancelled,
.status-blocked,
.status-disabled {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.status-hidden,
.status-muted,
.status-notrequired,
.status-notinvoiced,
.status-inactive {
  border-color: #e4e4e7;
  background: #fafafa;
  color: #71717a;
}

.metrics {
  gap: 10px;
  margin: 14px 0 18px;
}

.metric {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  padding: 14px 15px 12px;
  transition: none;
}

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

.metric::before {
  display: none;
}

.metric span {
  color: #71717a;
  font-size: 9.5px;
  font-weight: 600;
}

.metric strong {
  margin: 7px 0 2px;
  font-size: clamp(19px, 1.4vw, 23px);
  font-weight: 700;
  letter-spacing: -0.4px;
}

.metric p {
  color: #a1a1aa;
  font-size: 9.5px;
}

.dashboard-grid {
  gap: 14px;
}

.flow-list {
  padding: 2px 16px 12px;
}

.flow-list > div {
  min-height: 36px;
  border-bottom-color: #f4f4f5;
  font-size: 11px;
}

.flow-list strong {
  border-radius: 5px;
  background: #f4f4f5;
  padding: 2px 7px;
  font-size: 10px;
}

.upcoming-row {
  min-height: 58px;
  gap: 11px;
  border-top-color: #f4f4f5;
  padding: 10px 16px;
}

.upcoming-row:hover {
  background: #fafafa;
}

.date-chip {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-color: #e4e4e7;
  border-radius: 6px;
  background: #fafafa;
  color: #3f3f46;
  font-size: 14px;
}

.summary-strip {
  gap: 16px 28px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
  padding: 14px 16px;
}

.workflow-batch-bar,
.workflow-batch-bar + .hint {
  border-color: var(--line);
  background: #fafafa;
}

.progress-update-timeline li {
  border-left-color: #bfdbfe;
  background: #fafafa;
}

.empty-state {
  min-height: 150px;
  padding: 32px 18px;
}

.alert {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
}

.login-shell {
  background: #f7f7f8;
}

.login-card {
  width: min(100%, 400px);
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: none;
  padding: 28px;
}

.login-card .brand-mark {
  background: #18181b;
}

.login-card h1 {
  font-size: 24px;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgb(37 99 235 / 40%);
  outline-offset: 2px;
}

.app-main.table-page {
  height: calc(100dvh - 56px);
  max-height: calc(100dvh - 56px);
  padding-bottom: 16px;
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 216px;
  }

  .sidebar {
    width: min(86vw, 240px);
  }

  .topbar {
    min-height: 54px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .app-main {
    padding: 20px 16px 28px;
  }

  .app-main.table-page {
    height: calc(100dvh - 54px);
    max-height: calc(100dvh - 54px);
  }
}

@media (max-width: 680px) {
  .page-heading {
    align-items: stretch;
    margin-bottom: 14px;
  }

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

  .grid-search {
    width: 100%;
  }

  .grid-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .grid-page-size {
    margin-left: auto;
  }

  .grid-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-pagination {
    max-width: 100%;
    overflow-x: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .table.data-grid:not(.invoice-allocation-table):not(.schedule-grid) {
    min-width: 680px;
  }
}


/* 2026-09 actual DataTables.net integration */
div.dt-container {
  width: 100%;
  color: var(--ink);
  font-size: 11.5px;
}

div.dt-container div.dt-layout-row {
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

div.dt-container div.dt-layout-row:last-child {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

div.dt-container div.dt-layout-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

div.dt-container .dt-layout-start { justify-content: flex-start; }
div.dt-container .dt-layout-end { justify-content: flex-end; }
div.dt-container .dt-search { margin: 0; }
div.dt-container .dt-search label { display: none; }

div.dt-container .dt-search input {
  width: min(320px, 42vw);
  min-height: 32px;
  margin: 0;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #fff;
  color: #18181b;
  font: inherit;
  padding: 6px 10px;
}

div.dt-container .dt-search input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
  outline: 0;
}

div.dt-container .dt-length {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #71717a;
  font-size: 10px;
}

div.dt-container .dt-length label { margin: 0; }

div.dt-container .dt-length select {
  min-height: 30px;
  margin: 0 4px 0 0;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  background: #fff;
  color: #3f3f46;
  font: inherit;
  padding: 4px 22px 4px 7px;
}

div.dt-container .dt-info {
  color: #71717a;
  font-size: 10.5px;
}

div.dt-container .dt-paging {
  display: flex;
  align-items: center;
  gap: 3px;
}

div.dt-container .dt-paging .dt-paging-button {
  min-width: 29px;
  height: 29px;
  margin: 0;
  border: 1px solid transparent !important;
  border-radius: 5px;
  background: transparent !important;
  color: #52525b !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 10.5px;
  padding: 0 7px !important;
}

div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
  border-color: #d4d4d8 !important;
  background: #fafafa !important;
  color: #18181b !important;
}

div.dt-container .dt-paging .dt-paging-button.current {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 650;
}

div.dt-container .dt-paging .dt-paging-button.disabled {
  color: #d4d4d8 !important;
  cursor: default;
}

div.dt-container table.dataTable {
  width: 100% !important;
  margin: 0 !important;
  border-spacing: 0;
}

div.dt-container table.dataTable thead th,
div.dt-container table.dataTable thead td {
  border-bottom: 1px solid #d4d4d8;
  background: #fafafa;
  color: #52525b;
  font-size: 10px;
  font-weight: 650;
  padding: 9px 12px;
}

div.dt-container table.dataTable tbody td {
  border-bottom: 1px solid #ececee;
  color: #3f3f46;
  padding: 10px 12px;
}

div.dt-container table.dataTable tbody tr:hover > * {
  background: #fafafa;
}

div.dt-container table.dataTable > tbody > tr.selected > * {
  box-shadow: none;
}

div.dt-container .dt-columns-button { white-space: nowrap; }

.data-panel > div.dt-container {
  overflow: hidden;
}

.data-panel > div.dt-container > .dt-layout-table {
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.data-panel > div.dt-container > .dt-layout-table .dt-layout-cell {
  display: block;
  width: 100%;
  overflow: auto;
}

.dt-column-dialog {
  width: min(360px, calc(100vw - 24px));
}

@media (max-width: 680px) {
  div.dt-container div.dt-layout-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  div.dt-container div.dt-layout-cell {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  div.dt-container .dt-search,
  div.dt-container .dt-search input {
    width: 100%;
  }

  div.dt-container .dt-layout-end { justify-content: flex-start; }

  div.dt-container .dt-paging {
    max-width: 100%;
    overflow-x: auto;
  }
}


/* DataTables: scrollable body with fixed header and a top horizontal scrollbar. */
div.dt-container .dt-scroll {
  width: 100%;
  min-width: 0;
}

div.dt-container .dt-scroll-head {
  position: relative;
  z-index: 3;
  overflow: hidden !important;
  border-bottom: 1px solid #d4d4d8;
  background: #fafafa;
}

div.dt-container .dt-scroll-head table.dataTable {
  margin-bottom: 0 !important;
}

div.dt-container .dt-scroll-body {
  position: relative;
  max-height: 52vh !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-bottom: 0 !important;
  background: #fff;
}

div.dt-container .dt-scroll-body table.dataTable {
  margin-top: 0 !important;
}

div.dt-container .dt-scroll-top {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 13px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: #a1a1aa #f4f4f5;
}

div.dt-container .dt-scroll-top[hidden] {
  display: none;
}

div.dt-container .dt-scroll-top-spacer {
  height: 1px;
}

div.dt-container .dt-scroll-top::-webkit-scrollbar {
  height: 10px;
}

div.dt-container .dt-scroll-top::-webkit-scrollbar-track {
  background: #f4f4f5;
}

div.dt-container .dt-scroll-top::-webkit-scrollbar-thumb {
  border: 2px solid #f4f4f5;
  border-radius: 999px;
  background: #a1a1aa;
}

div.dt-container .dt-scroll-top::-webkit-scrollbar-thumb:hover {
  background: #71717a;
}

div.dt-container .dt-scroll-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

div.dt-container .dt-scroll-body::-webkit-scrollbar-track {
  background: #f4f4f5;
}

div.dt-container .dt-scroll-body::-webkit-scrollbar-thumb {
  border: 2px solid #f4f4f5;
  border-radius: 999px;
  background: #a1a1aa;
}

div.dt-container .dt-scroll-body::-webkit-scrollbar-thumb:hover {
  background: #71717a;
}

@media (max-width: 680px) {
  div.dt-container .dt-scroll-body {
    max-height: 58vh !important;
  }
}
